From e7470da8c75defaa7eb9bbc0c896861fbb7a3e23 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Fri, 25 Jul 2025 15:54:54 -0700 Subject: [PATCH 001/174] scope std::endl --- Mu2eKinKal/inc/KKFit.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mu2eKinKal/inc/KKFit.hh b/Mu2eKinKal/inc/KKFit.hh index 8cfb4091fb..1de97ae885 100644 --- a/Mu2eKinKal/inc/KKFit.hh +++ b/Mu2eKinKal/inc/KKFit.hh @@ -42,6 +42,9 @@ #include #include #include + +using std::endl; + namespace mu2e { using KinKal::SensorLine; using KinKal::TimeRange; From 02a964d4f015a727ea786cbe40356cc4cc886ce2 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Tue, 30 Sep 2025 13:49:12 -0700 Subject: [PATCH 002/174] add calorimeter digis to standard mixing flow --- Blinding/src/MergeDigis_module.cc | 15 ++++++++++++++- EventMixing/inc/Mu2eProductMixer.hh | 6 ++++++ EventMixing/src/Mu2eProductMixer.cc | 13 +++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Blinding/src/MergeDigis_module.cc b/Blinding/src/MergeDigis_module.cc index 2dd183d9e7..c8352e6d7a 100644 --- a/Blinding/src/MergeDigis_module.cc +++ b/Blinding/src/MergeDigis_module.cc @@ -22,6 +22,7 @@ #include "Offline/TrackerConditions/inc/StrawElectronics.hh" #include "Offline/TrackerMC/inc/StrawDigiBundle.hh" #include "Offline/TrackerMC/inc/StrawDigiBundleCollection.hh" +#include "Offline/RecoDataProducts/inc/CaloDigi.hh" namespace mu2e{ class MergeDigis: public art::EDProducer{ @@ -35,6 +36,10 @@ namespace mu2e{ fhicl::Name("MergeStrawDigiMCs"), fhicl::Comment("True/false to merge tracker MC truth") }; + fhicl::Sequence calo_digi_tags{ + fhicl::Name("CaloDigiCollections"), + fhicl::Comment("art::InputTags of source CaloDigis") + }; }; using Parameters = art::EDProducer::Table; @@ -46,6 +51,9 @@ namespace mu2e{ bool _tracker_mc; ProditionsHandle _tracker_conditions_handle; + // calorimeter + std::vector _calo_digi_tags; + private: void produce(art::Event&); }; @@ -54,7 +62,8 @@ namespace mu2e{ MergeDigis::MergeDigis(const Parameters& config): art::EDProducer(config), _tracker_digi_tags(config().tracker_digi_tags()), - _tracker_mc(config().tracker_mc()){ + _tracker_mc(config().tracker_mc()), + _calo_digi_tags(config().calo_digi_tags()){ // tracker for (const auto& tag: _tracker_digi_tags){ this->consumes(tag); @@ -64,6 +73,10 @@ namespace mu2e{ this->produces(); // calorimeter... + for (const auto& tag: _calo_digi_tags){ + this->consumes(tag); + } + this->produces(); // crv... diff --git a/EventMixing/inc/Mu2eProductMixer.hh b/EventMixing/inc/Mu2eProductMixer.hh index c43f533236..b594e50e4b 100644 --- a/EventMixing/inc/Mu2eProductMixer.hh +++ b/EventMixing/inc/Mu2eProductMixer.hh @@ -44,6 +44,7 @@ #include "Offline/MCDataProducts/inc/PhysicalVolumeInfoMultiCollection.hh" #include "Offline/RecoDataProducts/inc/StrawDigi.hh" #include "Offline/MCDataProducts/inc/StrawDigiMC.hh" +#include "Offline/RecoDataProducts/inc/CaloDigi.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" @@ -109,6 +110,7 @@ namespace mu2e { fhicl::Table strawDigiMixer { fhicl::Name("strawDigiMixer") }; fhicl::Table strawDigiADCWaveformMixer { fhicl::Name("strawDigiADCWaveformMixer") }; fhicl::Table strawDigiMCMixer { fhicl::Name("strawDigiMCMixer") }; + fhicl::Table caloDigiMixer { fhicl::Name("caloDigiMixer") }; fhicl::Table eventWindowMarkerMixer { fhicl::Name("eventWindowMarkerMixer") }; fhicl::OptionalTable cosmicLivetimeMixer { fhicl::Name("cosmicLivetimeMixer") }; fhicl::OptionalTable volumeInfoMixer { fhicl::Name("volumeInfoMixer") }; @@ -172,6 +174,10 @@ namespace mu2e { StrawDigiMCCollection& out, art::PtrRemapper const& remap); + bool mixCaloDigis(std::vector const& in, + CaloDigiCollection& out, + art::PtrRemapper const& remap); + bool mixEventWindowMarkers(std::vector const& in, EventWindowMarker& out, art::PtrRemapper const& remap); diff --git a/EventMixing/src/Mu2eProductMixer.cc b/EventMixing/src/Mu2eProductMixer.cc index 29a69668c5..47d0ac5e82 100644 --- a/EventMixing/src/Mu2eProductMixer.cc +++ b/EventMixing/src/Mu2eProductMixer.cc @@ -117,6 +117,11 @@ namespace mu2e { (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixStrawDigiMCs, *this); } + for(const auto& e: conf.caloDigiMixer().mixingMap()) { + helper.declareMixOp + (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixCaloDigis, *this); + } + for(const auto& e: conf.eventWindowMarkerMixer().mixingMap()) { helper.declareMixOp (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixEventWindowMarkers, *this); @@ -480,6 +485,14 @@ namespace mu2e { return true; } + bool Mu2eProductMixer::mixCaloDigis(std::vector const& in, + CaloDigiCollection& out, + art::PtrRemapper const& remap) + { + art::flattenCollections(in, out); + return true; + } + bool Mu2eProductMixer::mixEventWindowMarkers(std::vector const& in, EventWindowMarker& out, art::PtrRemapper const& remap){ From 3870e851ad093c569b5a016f49bcb04f75cf676b Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Tue, 30 Sep 2025 14:13:04 -0700 Subject: [PATCH 003/174] generalize timing chains to allow for non-uniform digitization windows --- TrackerMC/inc/TimeBasedBucket.hh | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/TrackerMC/inc/TimeBasedBucket.hh b/TrackerMC/inc/TimeBasedBucket.hh index ff2f76cf78..0acad79e68 100644 --- a/TrackerMC/inc/TimeBasedBucket.hh +++ b/TrackerMC/inc/TimeBasedBucket.hh @@ -18,7 +18,7 @@ namespace mu2e{ template class TimeBasedBucket{ public: - TimeBasedBucket(double); + TimeBasedBucket(); // forwarded calls to underlying container size_t size() const; @@ -28,12 +28,12 @@ namespace mu2e{ TBB_const_iterator end() const; // whether a candidate item "fits" into this bucket's gross time window - bool Accepts(T); + bool Accepts(T, double); // insertion --- assumes that appends are pre-sorted - void Append(T); + void Append(T, double); protected: std::vector _container; - double _window; + std::vector _windows; private: /**/ }; @@ -49,7 +49,7 @@ namespace mu2e{ template class TimeBasedBuckets{ public: - TimeBasedBuckets(double); + TimeBasedBuckets(); // forwarded calls to underlying container size_t size() const; @@ -59,16 +59,15 @@ namespace mu2e{ TBBS_const_iterator end() const; // insertion - void Insert(T); + void Insert(T, double); protected: std::vector< TimeBasedBucket > _buckets; - double _window; private: /**/ }; template - TimeBasedBucket::TimeBasedBucket(double window): _window(window){ + TimeBasedBucket::TimeBasedBucket(){ /**/ } @@ -106,15 +105,15 @@ namespace mu2e{ // whether a candidate item "fits" into this bucket's gross time window template - bool TimeBasedBucket::Accepts(T candidate){ + bool TimeBasedBucket::Accepts(T candidate, double window){ // empty bucket rejects nothing if (this->size() < 1){ return true; } // otherwise, check between first/last times, accounting for windowing - double lower = _container.front().time() - _window; - double upper = _container.back().time() + _window; + double lower = _container.front().time() - window; + double upper = _container.back().time() + _windows.back(); double now = candidate.time(); bool rv = (lower <= now) && (now <= upper); return rv; @@ -122,12 +121,13 @@ namespace mu2e{ // insertion --- assumes that appends are pre-sorted template - void TimeBasedBucket::Append(T candidate){ + void TimeBasedBucket::Append(T candidate, double window){ _container.push_back(candidate); + _windows.push_back(window); } template - TimeBasedBuckets::TimeBasedBuckets(double window): _window(window){ + TimeBasedBuckets::TimeBasedBuckets(){ /**/ } @@ -165,12 +165,12 @@ namespace mu2e{ // insertion template - void TimeBasedBuckets::Insert(T item){ + void TimeBasedBuckets::Insert(T item, double window){ // if the item belongs in a preexisting bucket, put it there bool inserted = false; for (auto& bucket: (*this)){ - if (bucket.Accepts(item)){ - bucket.Append(item); + if (bucket.Accepts(item, window)){ + bucket.Append(item, window); inserted = true; return; } @@ -178,9 +178,9 @@ namespace mu2e{ // otherwise, this item defines a new bucket if (!inserted){ - TimeBasedBucket bucket(_window); + TimeBasedBucket bucket; _buckets.push_back(bucket); - this->Insert(item); + this->Insert(item, window); } } } From eff58b2c4cd8e92d9528b7d989bb31cc0a4e16f7 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Tue, 30 Sep 2025 17:57:45 -0700 Subject: [PATCH 004/174] implement calorimeter digi collision resolution and include in merge module --- Blinding/CMakeLists.txt | 1 + Blinding/src/MergeDigis_module.cc | 14 +- Blinding/src/SConscript | 2 + CaloMC/inc/CaloDigiWrapper.hh | 28 +++ CaloMC/inc/CaloDigiWrapperCollection.hh | 61 +++++++ CaloMC/src/CaloDigiWrapper.cc | 23 +++ CaloMC/src/CaloDigiWrapperCollection.cc | 198 +++++++++++++++++++++ TrackerMC/src/StrawDigiBundleCollection.cc | 4 +- 8 files changed, 328 insertions(+), 3 deletions(-) create mode 100644 CaloMC/inc/CaloDigiWrapper.hh create mode 100644 CaloMC/inc/CaloDigiWrapperCollection.hh create mode 100644 CaloMC/src/CaloDigiWrapper.cc create mode 100644 CaloMC/src/CaloDigiWrapperCollection.cc diff --git a/Blinding/CMakeLists.txt b/Blinding/CMakeLists.txt index 134c529921..251cb4b9d9 100755 --- a/Blinding/CMakeLists.txt +++ b/Blinding/CMakeLists.txt @@ -80,6 +80,7 @@ cet_build_plugin(MergeDigis art::module LIBRARIES REG Offline::Blinding Offline::TrackerMC + Offline::CaloMC ) cet_build_plugin(TrackDigiExtractor art::module diff --git a/Blinding/src/MergeDigis_module.cc b/Blinding/src/MergeDigis_module.cc index c8352e6d7a..23f6783382 100644 --- a/Blinding/src/MergeDigis_module.cc +++ b/Blinding/src/MergeDigis_module.cc @@ -23,6 +23,7 @@ #include "Offline/TrackerMC/inc/StrawDigiBundle.hh" #include "Offline/TrackerMC/inc/StrawDigiBundleCollection.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" +#include "Offline/CaloMC/inc/CaloDigiWrapperCollection.hh" namespace mu2e{ class MergeDigis: public art::EDProducer{ @@ -117,7 +118,18 @@ namespace mu2e{ event.put(std::move(dgmc)); } - // calorimeter... + // calorimeter: two easy steps: + // i) read all digis into a CaloDigiWrapperCollection + // ii) defer collision resolution to that collection + CaloDigiWrapperCollection wrappers; + for (const auto& tag: _calo_digi_tags){ + auto handle = event.getValidHandle(tag); + wrappers.Append(*handle); + } + CaloDigiWrapperCollection calo_resolved; + wrappers.ResolveCollisions(calo_resolved); + auto calo_digis = calo_resolved.GetDigis(); + event.put(std::move(calo_digis)); // crv... } diff --git a/Blinding/src/SConscript b/Blinding/src/SConscript index 18335f5df8..3b7009c547 100644 --- a/Blinding/src/SConscript +++ b/Blinding/src/SConscript @@ -38,6 +38,7 @@ helper.make_plugins([ 'mu2e_SeedService', 'mu2e_TrackerConditions', 'mu2e_TrackerMC', + 'mu2e_CaloMC', ]) helper.make_dict_and_map([ @@ -54,4 +55,5 @@ helper.make_dict_and_map([ 'mu2e_SeedService', 'mu2e_TrackerConditions', 'mu2e_TrackerMC', + 'mu2e_CaloMC', ]) diff --git a/CaloMC/inc/CaloDigiWrapper.hh b/CaloMC/inc/CaloDigiWrapper.hh new file mode 100644 index 0000000000..1f8f7a84ed --- /dev/null +++ b/CaloMC/inc/CaloDigiWrapper.hh @@ -0,0 +1,28 @@ +// Ed Callaghan +// Simple wrapper around calorimeter digis to interface into a partitioning scheme +// September 2025 + +#ifndef CaloMC_CaloDigiWrapper_hh +#define CaloMC_CaloDigiWrapper_hh + +// mu2e +#include "Offline/RecoDataProducts/inc/CaloDigi.hh" + +namespace mu2e{ + class CaloDigiWrapper{ + public: + CaloDigiWrapper(const CaloDigi&); + const CaloDigi& Digi() const; + + // interface for sorting into buckets of overlapping digitization windows + const double time() const; + + protected: + const CaloDigi _digi; + + private: + /**/ + }; +} // namespace mu2e + +#endif diff --git a/CaloMC/inc/CaloDigiWrapperCollection.hh b/CaloMC/inc/CaloDigiWrapperCollection.hh new file mode 100644 index 0000000000..1308f713cd --- /dev/null +++ b/CaloMC/inc/CaloDigiWrapperCollection.hh @@ -0,0 +1,61 @@ +// Ed Callaghan +// Container for CaloDigiWrappers, with functionality to resolve overlapping digitization windows +// September 2025 + +#ifndef CaloMC_CaloDigiWrapperCollection_hh +#define CaloMC_CaloDigiWrapperCollection_hh + +// stl +#include +#include +#include +#include + +// mu2e +#include "Offline/CaloMC/inc/CaloDigiWrapper.hh" +#include "Offline/TrackerMC/inc/TimeBasedBucket.hh" + +namespace mu2e{ + using CDWC_iterator = std::vector::iterator; + using CDWC_const_iterator = std::vector::const_iterator; + + class CaloDigiWrapperCollection{ + public: + using SiPMID_t = int; + using sample_t = int; + using pos_t = size_t; + // forwarded calls to underlying container + size_t size() const; + CDWC_iterator begin(); + CDWC_const_iterator begin() const; + CDWC_iterator end(); + CDWC_const_iterator end() const; + CaloDigiWrapper& operator[](size_t); + const CaloDigiWrapper& operator[](size_t) const; + CaloDigiWrapper& front(); + const CaloDigiWrapper& front() const; + CaloDigiWrapper& back(); + const CaloDigiWrapper& back() const; + + // insertion + void Append(const CaloDigiCollection&); + void Append(const CaloDigiWrapper); + + // accessor + std::unique_ptr GetDigis() const; + + // identify sets of digis with overlapping digitization windows, and + // reduce each such set to a single digi, representing their "sum" + void ResolveCollisions(CaloDigiWrapperCollection&); + + protected: + std::vector _wrappers; + void ResolveCollision(CaloDigiWrapperCollection&, + CaloDigiWrapperCollection&); + + private: + /**/ + }; +} // namespace mu2e + +#endif diff --git a/CaloMC/src/CaloDigiWrapper.cc b/CaloMC/src/CaloDigiWrapper.cc new file mode 100644 index 0000000000..66a8816b6d --- /dev/null +++ b/CaloMC/src/CaloDigiWrapper.cc @@ -0,0 +1,23 @@ +// Ed Callaghan +// Simple wrapper around calorimeter digis to interface into a partitioning scheme +// September 2025 + +#include "Offline/CaloMC/inc/CaloDigiWrapper.hh" + +namespace mu2e{ + CaloDigiWrapper::CaloDigiWrapper(const CaloDigi& digi): + _digi(digi.SiPMID(), digi.t0(), digi.waveform(), digi.peakpos()){ + /**/ + } + + const CaloDigi& CaloDigiWrapper::Digi() const{ + const auto& rv = _digi; + return rv; + } + + const double CaloDigiWrapper::time() const{ + auto t0 = _digi.t0(); + auto rv = static_cast(t0); + return rv; + } +} // namespace mu2e diff --git a/CaloMC/src/CaloDigiWrapperCollection.cc b/CaloMC/src/CaloDigiWrapperCollection.cc new file mode 100644 index 0000000000..0ae0ae803d --- /dev/null +++ b/CaloMC/src/CaloDigiWrapperCollection.cc @@ -0,0 +1,198 @@ +// Ed Callaghan +// Container for CaloDigiWrappers, with functionality to resolve overlapping digitization windows +// September 2025 + +#include "Offline/CaloMC/inc/CaloDigiWrapperCollection.hh" + +namespace mu2e{ + // forward size query to underlying container + size_t CaloDigiWrapperCollection::size() const{ + auto rv = _wrappers.size(); + return rv; + } + + // forward iterator access to underlying wrappers + CDWC_iterator CaloDigiWrapperCollection::begin(){ + auto rv = _wrappers.begin(); + return rv; + } + + CDWC_const_iterator CaloDigiWrapperCollection::begin() const{ + auto rv = _wrappers.begin(); + return rv; + } + + CDWC_iterator CaloDigiWrapperCollection::end(){ + auto rv = _wrappers.end(); + return rv; + } + + CDWC_const_iterator CaloDigiWrapperCollection::end() const{ + auto rv = _wrappers.end(); + return rv; + } + + // forward lookups to underlying container + CaloDigiWrapper& CaloDigiWrapperCollection::operator[](size_t i){ + auto& rv = _wrappers[i]; + return rv; + } + + const CaloDigiWrapper& CaloDigiWrapperCollection::operator[](size_t i) const{ + const auto& rv = _wrappers[i]; + return rv; + } + + CaloDigiWrapper& CaloDigiWrapperCollection::front(){ + auto& rv = _wrappers.front(); + return rv; + } + + const CaloDigiWrapper& CaloDigiWrapperCollection::front() const{ + const auto& rv = _wrappers.front(); + return rv; + } + + CaloDigiWrapper& CaloDigiWrapperCollection::back(){ + auto& rv = _wrappers.back(); + return rv; + } + + const CaloDigiWrapper& CaloDigiWrapperCollection::back() const{ + const auto& rv = _wrappers.back(); + return rv; + } + + // insertion + void CaloDigiWrapperCollection::Append(const CaloDigiCollection& digis){ + for (size_t i = 0 ; i < digis.size() ; i++){ + const auto& digi = digis.at(i); + CaloDigiWrapper wrapper(digi); + _wrappers.emplace_back(digi); + continue; + } + } + + void CaloDigiWrapperCollection::Append(const CaloDigiWrapper wrapper){ + _wrappers.push_back(wrapper); + } + + // accessor + std::unique_ptr CaloDigiWrapperCollection::GetDigis() const{ + auto rv = std::make_unique(); + rv->reserve(_wrappers.size()); + for (const auto& wrapper: _wrappers){ + const auto& digi = wrapper.Digi(); + rv->push_back(digi); + } + + return rv; + } + + // collision resolution + // auxiliary comparison to facilitate time-sorting + bool compare_t0s(const CaloDigiWrapper* lhs, const CaloDigiWrapper* rhs){ + bool rv = (lhs->Digi().t0() < rhs->Digi().t0()); + return rv; + } + + // ejc: this overlaps _greatly_ with CaloDigiWrapperCollection + // TODO this assumes a fixed overlap window, which does not apply for calo + // here we need variable-length chain links --- -.- + void CaloDigiWrapperCollection::ResolveCollisions(CaloDigiWrapperCollection& rv){ + // identify time-overlapped chains: this is a 3 step process + // first, partition wrappers according to SiPMID_t + std::map unsorted_map; + for (const auto& wrapper: (*this)){ + const auto& digi = wrapper.Digi(); + SiPMID_t id = digi.SiPMID(); + unsorted_map[id].Append(wrapper); + } + + // next, (approximately) sort all subsets via time, to avoid + // pathological situations where timing buckets are misconstructed + // we shamefully and begrudgingly do this indirectly via bare pointers + std::map wrappers_map; + for (const auto& pair: unsorted_map){ + const auto& id = pair.first; + auto& wrappers = pair.second; + std::vector sortable(wrappers.size()); + for (size_t i = 0 ; i < wrappers.size() ; i++){ + sortable[i] = const_cast(&wrappers[i]); + } + std::sort(sortable.begin(), sortable.end(), compare_t0s); + CaloDigiWrapperCollection sorted; + for (size_t i = 0 ; i < wrappers.size() ; i++){ + sorted.Append(*sortable[i]); + } + wrappers_map.emplace(id, sorted); + } + + // then, filter each subset into buckets based on overlapping time windows + std::map< SiPMID_t, TimeBasedBuckets > buckets_map; + for (const auto& pair: wrappers_map){ + const auto& id = pair.first; + const auto& wrappers = pair.second; + TimeBasedBuckets buckets; + for (const auto& wrapper: wrappers){ + double window = static_cast(wrapper.Digi().waveform().size()); + buckets.Insert(wrapper, window); + } + buckets_map.emplace(id, buckets); + } + + // finally, recast each bucket as a regular container + // and resolve the set of degenerate digis into one + for (const auto& pair: buckets_map){ + const auto& buckets = pair.second; + for (const auto& bucket: buckets){ + CaloDigiWrapperCollection wrappers; + for (const auto& wrapper: bucket){ + wrappers.Append(wrapper); + } + this->ResolveCollision(wrappers, rv); + } + } + } + + void CaloDigiWrapperCollection::ResolveCollision(CaloDigiWrapperCollection& collided, CaloDigiWrapperCollection& rv){ + // if only one digi present, then nothing to do + if (collided.size() < 2){ + rv.Append(collided.front()); + } + + // multiple digis must be summed into a single waveform + const auto& first = collided.front().Digi(); + const auto& last = collided.back().Digi(); + size_t length = (last.t0() - first.t0()) + last.waveform().size(); + std::vector samples(length, 0); + + // sum each individual waveform into the total + // TODO this does not account for saturation + for (const auto& wrapper: collided){ + const auto& digi = wrapper.Digi(); + const auto& waveform = digi.waveform(); + const size_t shift = digi.t0() - first.t0(); + for (size_t i = 0 ; i < waveform.size() ; i++){ + samples[i + shift] += waveform[i]; + } + } + + // now find the peak position + pos_t peakpos = 0; + sample_t peak = 0; + for (size_t i = 0 ; i < samples.size() ; i++){ + const auto sample = samples[i]; + if (peak < sample){ + peakpos = i; + peak = sample; + } + } + + const auto id = first.SiPMID(); + const auto t0 = first.t0(); + const auto digi = CaloDigi(id, t0, samples, peakpos); + const auto wrapper = CaloDigiWrapper(digi); + rv.Append(wrapper); + } +} diff --git a/TrackerMC/src/StrawDigiBundleCollection.cc b/TrackerMC/src/StrawDigiBundleCollection.cc index 3ebfbb29c8..8f3492c18e 100644 --- a/TrackerMC/src/StrawDigiBundleCollection.cc +++ b/TrackerMC/src/StrawDigiBundleCollection.cc @@ -191,9 +191,9 @@ namespace mu2e{ for (const auto& pair: bundles_map){ const auto& id = pair.first; const auto& bundles = pair.second; - TimeBasedBuckets buckets(window); + TimeBasedBuckets buckets; for (const auto& bundle: bundles){ - buckets.Insert(bundle); + buckets.Insert(bundle, window); } buckets_map.emplace(id, buckets); } From 76173e5750375db0d72a919b28d2661556a086b5 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 28 Mar 2025 21:14:37 -0700 Subject: [PATCH 005/174] removed unused BTrk includes, and added HelixParams.hh to BTrkLegacy, which is used for BTrkData/inc/Doublet.hh --- BTrkData/inc/Doublet.hh | 2 +- BTrkLegacy/HelixParams.hh | 40 ++++++++++++++++++++++++++++ TrkReco/inc/AmbigResolver.hh | 2 +- TrkReco/inc/DoubletAmbigResolver.hh | 4 +-- TrkReco/inc/RobustHelixFinderData.hh | 4 +-- 5 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 BTrkLegacy/HelixParams.hh diff --git a/BTrkData/inc/Doublet.hh b/BTrkData/inc/Doublet.hh index 71dc99ad60..98818043e6 100644 --- a/BTrkData/inc/Doublet.hh +++ b/BTrkData/inc/Doublet.hh @@ -12,7 +12,7 @@ #include "BTrk/KalmanTrack/KalRep.hh" #include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/TrkBase/HelixParams.hh" +#include "Offline/BTrkLegacy/HelixParams.hh" // C++ #include diff --git a/BTrkLegacy/HelixParams.hh b/BTrkLegacy/HelixParams.hh new file mode 100644 index 0000000000..d8f2e62aba --- /dev/null +++ b/BTrkLegacy/HelixParams.hh @@ -0,0 +1,40 @@ +#ifndef TRKEXCHANGEPAR_HH +#define TRKEXCHANGEPAR_HH +#include "BTrk/TrkBase/TrkParams.hh" + +// Class interface // +class HelixParams : public TrkParams { +public: + enum ParIndex {d0Index=0, phi0Index, omegaIndex, z0Index, tanDipIndex, NHLXPRM}; + + HelixParams(const CLHEP::HepVector&, const CLHEP::HepSymMatrix&); + ~HelixParams(); + + double d0() const {return parvec[d0Index];} + double phi0() const {return parvec[phi0Index];} + double omega() const {return parvec[omegaIndex];} + double z0() const {return parvec[z0Index];} + double tanDip() const {return parvec[tanDipIndex];} + + const CLHEP::HepVector& params() const {return parvec;} + CLHEP::HepVector& params() {return parvec;} + const CLHEP::HepSymMatrix& covariance() const {return parcov;} + CLHEP::HepSymMatrix& covariance() {return parcov;} + + void setD0(double in) {parvec[d0Index] = in;} + void setPhi0(double in) {parvec[phi0Index] = in;} + void setOmega(double in) {parvec[omegaIndex] = in;} + void setZ0(double in) {parvec[z0Index] = in;} + void setTanDip(double in) {parvec[tanDipIndex] = in;} + void setError(const CLHEP::HepSymMatrix& in) {parcov = in;} + + void print(std::ostream& o) const; // Print parameters on one line + void printAll(std::ostream& o) const; // Print parameters and error matrix + +private: +}; + +// Output operator, useful for debugging +std::ostream& operator<<(std::ostream& o, const HelixParams& helix); + +#endif diff --git a/TrkReco/inc/AmbigResolver.hh b/TrkReco/inc/AmbigResolver.hh index 0b2a82cab5..3f3f402627 100644 --- a/TrkReco/inc/AmbigResolver.hh +++ b/TrkReco/inc/AmbigResolver.hh @@ -7,7 +7,7 @@ // #ifndef AmbigResolver_HH #define AmbigResolver_HH -#include "BTrk/BaBar/BaBar.hh" +// #include "BTrk/BaBar/BaBar.hh" #include diff --git a/TrkReco/inc/DoubletAmbigResolver.hh b/TrkReco/inc/DoubletAmbigResolver.hh index c30483b64d..066c28cdd4 100644 --- a/TrkReco/inc/DoubletAmbigResolver.hh +++ b/TrkReco/inc/DoubletAmbigResolver.hh @@ -7,8 +7,8 @@ #ifndef DoubletAmbigResolver_HH #define DoubletAmbigResolver_HH -#include "BTrk/BaBar/BaBar.hh" -#include "Offline/TrkReco/inc/AmbigResolver.hh" +// #include "BTrk/BaBar/BaBar.hh" + #include "Offline/TrkReco/inc/AmbigResolver.hh" #ifndef __GCCXML__ #include "fhiclcpp/ParameterSet.h" diff --git a/TrkReco/inc/RobustHelixFinderData.hh b/TrkReco/inc/RobustHelixFinderData.hh index b25077c386..4f0b28e50e 100644 --- a/TrkReco/inc/RobustHelixFinderData.hh +++ b/TrkReco/inc/RobustHelixFinderData.hh @@ -5,8 +5,8 @@ #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" // #include "CalPatRec/inc/CalHelixPoint.hh" -#include "BTrk/TrkBase/TrkErrCode.hh" -#include "BTrk/TrkBase/TrkParticle.hh" +// #include "BTrk/TrkBase/TrkErrCode.hh" +// #include "BTrk/TrkBase/TrkParticle.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" #include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" From 833b1f684be0cf441706519d8c688fd0b68ab953 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 1 Apr 2025 17:04:02 -0700 Subject: [PATCH 006/174] got rid of unnecessary comment in CalPatRec/src/MergeHelixFinder_module.cc, commented out TrkPatRec/src/KalFinalFitDiag_tool.cc and TrkPatRec/src/KalFinalFit_module.cc --- CalPatRec/src/MergeHelixFinder_module.cc | 4 ++-- TrkPatRec/src/KalFinalFitDiag_tool.cc | 3 ++- TrkPatRec/src/KalFinalFit_module.cc | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CalPatRec/src/MergeHelixFinder_module.cc b/CalPatRec/src/MergeHelixFinder_module.cc index 5338f73f13..f93158cb38 100644 --- a/CalPatRec/src/MergeHelixFinder_module.cc +++ b/CalPatRec/src/MergeHelixFinder_module.cc @@ -34,8 +34,8 @@ #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" -#include "Offline/BTrkData/inc/Doublet.hh" -#include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" +// #include "Offline/BTrkData/inc/Doublet.hh" +// #include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" #include "Offline/CalPatRec/inc/ObjectDumpUtils.hh" diff --git a/TrkPatRec/src/KalFinalFitDiag_tool.cc b/TrkPatRec/src/KalFinalFitDiag_tool.cc index e29ddf3658..d4b332e562 100644 --- a/TrkPatRec/src/KalFinalFitDiag_tool.cc +++ b/TrkPatRec/src/KalFinalFitDiag_tool.cc @@ -2,6 +2,7 @@ // diag mode: = 0 - most of the histograms // = 1 - doca histograms /////////////////////////////////////////////////////////////////////////////// +/* #include "TH2.h" #include "TH1.h" @@ -487,4 +488,4 @@ namespace mu2e { DEFINE_ART_CLASS_TOOL(KalFinalFitDiag) } - +*/ diff --git a/TrkPatRec/src/KalFinalFit_module.cc b/TrkPatRec/src/KalFinalFit_module.cc index 8101c9078f..83e4c91fb0 100644 --- a/TrkPatRec/src/KalFinalFit_module.cc +++ b/TrkPatRec/src/KalFinalFit_module.cc @@ -3,7 +3,7 @@ // // Original author D. Brown and G. Tassielli // - +/* // framework #include "art/Framework/Principal/Event.h" #include "fhiclcpp/ParameterSet.h" @@ -718,3 +718,4 @@ namespace mu2e }// mu2e DEFINE_ART_MODULE(mu2e::KalFinalFit) +*/ From f2ef32a3e9b3befbee2e1aecf9b2468a12f112ff Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 6 Apr 2025 14:33:43 -0700 Subject: [PATCH 007/174] removed KalSeedFitDiag_tool, KalSeedFit_module, and KalFit --- TrkPatRec/src/KalSeedFitDiag_tool.cc | 3 ++- TrkPatRec/src/KalSeedFit_module.cc | 5 +++-- TrkReco/CMakeLists.txt | 1 - TrkReco/src/KalFit.cc | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TrkPatRec/src/KalSeedFitDiag_tool.cc b/TrkPatRec/src/KalSeedFitDiag_tool.cc index acac1791fa..a1c77eac92 100644 --- a/TrkPatRec/src/KalSeedFitDiag_tool.cc +++ b/TrkPatRec/src/KalSeedFitDiag_tool.cc @@ -1,5 +1,5 @@ // - +/* #include "Offline/TrkPatRec/inc/KalSeedFit_types.hh" #include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh" #include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" @@ -246,3 +246,4 @@ namespace mu2e { DEFINE_ART_CLASS_TOOL(KalSeedFitDiag) } +*/ diff --git a/TrkPatRec/src/KalSeedFit_module.cc b/TrkPatRec/src/KalSeedFit_module.cc index 31840c4f07..eb69ec6bd1 100644 --- a/TrkPatRec/src/KalSeedFit_module.cc +++ b/TrkPatRec/src/KalSeedFit_module.cc @@ -6,7 +6,7 @@ // // Original author Dave Brown (LBNL) 31 Aug 2016 // - +/* // framework #include "art/Framework/Principal/Event.h" #include "fhiclcpp/ParameterSet.h" @@ -488,7 +488,7 @@ namespace mu2e Hep3Vector tdir; HepPoint tpos; - double doca, /*rdrift, */fltlen; + double doca, *rdrift, fltlen; if (_debug > 0) printf("[%s]: BEGIN\n",oname); @@ -566,3 +566,4 @@ namespace mu2e }// mu2e using mu2e::KalSeedFit; DEFINE_ART_MODULE(KalSeedFit) +*/ diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index fcaebfdf39..3fe22b850e 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -4,7 +4,6 @@ cet_make_library( src/DoubletAmbigResolver.cc src/FixedAmbigResolver.cc src/HitAmbigResolver.cc - src/KalFit.cc src/KalFitData.cc src/PanelAmbigResolver.cc src/PanelAmbigStructs.cc diff --git a/TrkReco/src/KalFit.cc b/TrkReco/src/KalFit.cc index 147d0e7edb..516129c01a 100644 --- a/TrkReco/src/KalFit.cc +++ b/TrkReco/src/KalFit.cc @@ -3,6 +3,7 @@ // Original author: Dave Brown LBNL 2012 // // +/* #include "Offline/TrkReco/inc/KalFit.hh" #include "Offline/TrkReco/inc/PanelAmbigResolver.hh" #include "Offline/TrkReco/inc/HitAmbigResolver.hh" @@ -1192,3 +1193,4 @@ namespace mu2e } } +*/ From 3a8c05ae45dc3c0254dc5fa993927e9c6408fb7d Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 6 Apr 2025 15:31:55 -0700 Subject: [PATCH 008/174] removed doublet.hh and doublet.cc in BTrkData, removed dependancy on doublet.hh in CalTimePeakFinder_module, removed MergeHelixFinder_module, removed DoubletAmbigResolver --- BTrkData/inc/Doublet.hh | 2 ++ BTrkData/src/Doublet.cc | 2 ++ CalPatRec/inc/CalTimePeakFinder_module.hh | 2 -- CalPatRec/src/CalTimePeakFinder_module.cc | 4 ++-- CalPatRec/src/MergeHelixFinder_module.cc | 2 ++ TrkReco/src/DoubletAmbigResolver.cc | 2 ++ 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/BTrkData/inc/Doublet.hh b/BTrkData/inc/Doublet.hh index 98818043e6..ce634133b4 100644 --- a/BTrkData/inc/Doublet.hh +++ b/BTrkData/inc/Doublet.hh @@ -3,6 +3,7 @@ // 2015 - 02 - 17 G. Pezzullo created class for housing the straw hits doublets // /////////////////////////////////////////////////////////////////////////////// +/* #ifndef BTrkData_Doublet_hh #define BTrkData_Doublet_hh @@ -78,3 +79,4 @@ namespace mu2e { } #endif +*/ diff --git a/BTrkData/src/Doublet.cc b/BTrkData/src/Doublet.cc index 6fade3ff93..0e8678216a 100644 --- a/BTrkData/src/Doublet.cc +++ b/BTrkData/src/Doublet.cc @@ -1,4 +1,5 @@ // +/* #include "Offline/BTrkData/inc/Doublet.hh" @@ -91,3 +92,4 @@ namespace mu2e { // } } } +*/ diff --git a/CalPatRec/inc/CalTimePeakFinder_module.hh b/CalPatRec/inc/CalTimePeakFinder_module.hh index df36603daa..534dce2936 100644 --- a/CalPatRec/inc/CalTimePeakFinder_module.hh +++ b/CalPatRec/inc/CalTimePeakFinder_module.hh @@ -26,7 +26,6 @@ namespace art { #include "Offline/RecoDataProducts/inc/KalRepCollection.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/BTrkData/inc/Doublet.hh" // BaBar #include "BTrk/BaBar/BaBar.hh" @@ -171,4 +170,3 @@ namespace mu2e { }; } #endif - diff --git a/CalPatRec/src/CalTimePeakFinder_module.cc b/CalPatRec/src/CalTimePeakFinder_module.cc index c9726515a4..5235689b7e 100644 --- a/CalPatRec/src/CalTimePeakFinder_module.cc +++ b/CalPatRec/src/CalTimePeakFinder_module.cc @@ -30,11 +30,11 @@ #include "Offline/RecoDataProducts/inc/TimeCluster.hh" #include "Offline/Mu2eUtilities/inc/polyAtan2.hh" - +//C++ using CLHEP::HepVector; using CLHEP::HepSymMatrix; using CLHEP::Hep3Vector; - +using namespace std; namespace mu2e { //----------------------------------------------------------------------------- // module constructor, parameter defaults are defiend in CalPatRec/fcl/prolog.fcl diff --git a/CalPatRec/src/MergeHelixFinder_module.cc b/CalPatRec/src/MergeHelixFinder_module.cc index f93158cb38..a75d67399e 100644 --- a/CalPatRec/src/MergeHelixFinder_module.cc +++ b/CalPatRec/src/MergeHelixFinder_module.cc @@ -8,6 +8,7 @@ // Original author P. Murat /////////////////////////////////////////////////////////////////////////////// // framework +/* #include "art/Framework/Principal/Event.h" #include "fhiclcpp/ParameterSet.h" #include "art/Framework/Principal/Handle.h" @@ -365,3 +366,4 @@ namespace mu2e { using mu2e::MergeHelixFinder; DEFINE_ART_MODULE(MergeHelixFinder) +*/ diff --git a/TrkReco/src/DoubletAmbigResolver.cc b/TrkReco/src/DoubletAmbigResolver.cc index a07f7a6fec..d5bb5b75bf 100644 --- a/TrkReco/src/DoubletAmbigResolver.cc +++ b/TrkReco/src/DoubletAmbigResolver.cc @@ -4,6 +4,7 @@ // DoubletAmbigResolver is instantiated from Stntuple/mod/InitTrackBlock.cc // thus all parameters need to have defaults in the source /////////////////////////////////////////////////////////////////////////////// +/* #include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" #include "Offline/BTrkData/inc/TrkStrawHit.hh" #include "BTrk/KalmanTrack/KalRep.hh" @@ -1266,3 +1267,4 @@ namespace mu2e { return perr; } } +*/ From e8318a537a8db0b339b2c0b7d3ac2f235deea91b Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 6 Apr 2025 16:15:16 -0700 Subject: [PATCH 009/174] removed amgib resolvers and KalFitData --- CosmicReco/src/CosmicTrackFinder_module.cc | 2 +- TrkPatRec/inc/KalFinalFit_types.hh | 2 + TrkPatRec/inc/KalSeedFit_types.hh | 2 + TrkReco/CMakeLists.txt | 6 - TrkReco/inc/AmbigResolver.hh | 38 - TrkReco/inc/DoubletAmbigResolver.hh | 120 -- TrkReco/inc/FixedAmbigResolver.hh | 29 - TrkReco/inc/HitAmbigResolver.hh | 48 - TrkReco/inc/KalFit.hh | 163 --- TrkReco/inc/KalFitData.hh | 86 -- TrkReco/inc/PanelAmbigResolver.hh | 74 -- TrkReco/src/AmbigResolver.cc | 71 -- TrkReco/src/DoubletAmbigResolver.cc | 1270 -------------------- TrkReco/src/FixedAmbigResolver.cc | 34 - TrkReco/src/HitAmbigResolver.cc | 87 -- TrkReco/src/KalFit.cc | 1196 ------------------ TrkReco/src/KalFitData.cc | 80 -- TrkReco/src/PanelAmbigResolver.cc | 329 ----- 18 files changed, 5 insertions(+), 3632 deletions(-) delete mode 100644 TrkReco/inc/AmbigResolver.hh delete mode 100644 TrkReco/inc/DoubletAmbigResolver.hh delete mode 100644 TrkReco/inc/FixedAmbigResolver.hh delete mode 100644 TrkReco/inc/HitAmbigResolver.hh delete mode 100644 TrkReco/inc/KalFit.hh delete mode 100644 TrkReco/inc/KalFitData.hh delete mode 100644 TrkReco/inc/PanelAmbigResolver.hh delete mode 100644 TrkReco/src/AmbigResolver.cc delete mode 100644 TrkReco/src/DoubletAmbigResolver.cc delete mode 100644 TrkReco/src/FixedAmbigResolver.cc delete mode 100644 TrkReco/src/HitAmbigResolver.cc delete mode 100644 TrkReco/src/KalFit.cc delete mode 100644 TrkReco/src/KalFitData.cc delete mode 100644 TrkReco/src/PanelAmbigResolver.cc diff --git a/CosmicReco/src/CosmicTrackFinder_module.cc b/CosmicReco/src/CosmicTrackFinder_module.cc index 9efa81710f..ca4fab076b 100644 --- a/CosmicReco/src/CosmicTrackFinder_module.cc +++ b/CosmicReco/src/CosmicTrackFinder_module.cc @@ -36,7 +36,7 @@ #include "Offline/Mu2eUtilities/inc/ParametricFit.hh" //For Drift: -#include "Offline/TrkReco/inc/PanelAmbigResolver.hh" +//#include "Offline/TrkReco/inc/PanelAmbigResolver.hh" #include "Offline/TrkReco/inc/PanelStateIterator.hh" #include "Offline/TrkReco/inc/TrkFaceData.hh" diff --git a/TrkPatRec/inc/KalFinalFit_types.hh b/TrkPatRec/inc/KalFinalFit_types.hh index f5c3cd10f3..ab45f9e424 100644 --- a/TrkPatRec/inc/KalFinalFit_types.hh +++ b/TrkPatRec/inc/KalFinalFit_types.hh @@ -1,3 +1,4 @@ +/* #ifndef TrkPatRec_KalFinalFit_types_hh #define TrkPatRec_KalFinalFit_types_hh @@ -46,3 +47,4 @@ namespace mu2e { } } #endif +*/ diff --git a/TrkPatRec/inc/KalSeedFit_types.hh b/TrkPatRec/inc/KalSeedFit_types.hh index 34eb10cb37..3074f783b7 100644 --- a/TrkPatRec/inc/KalSeedFit_types.hh +++ b/TrkPatRec/inc/KalSeedFit_types.hh @@ -1,3 +1,4 @@ +/* #ifndef TrkPatRec_KalSeedFit_types_hh #define TrkPatRec_KalSeedFit_types_hh @@ -35,3 +36,4 @@ namespace mu2e { } } #endif +*/ diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index 3fe22b850e..640478d822 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -1,11 +1,5 @@ cet_make_library( SOURCE - src/AmbigResolver.cc - src/DoubletAmbigResolver.cc - src/FixedAmbigResolver.cc - src/HitAmbigResolver.cc - src/KalFitData.cc - src/PanelAmbigResolver.cc src/PanelAmbigStructs.cc src/PanelStateIterator.cc src/RobustHelixFinderData.cc diff --git a/TrkReco/inc/AmbigResolver.hh b/TrkReco/inc/AmbigResolver.hh deleted file mode 100644 index 3f3f402627..0000000000 --- a/TrkReco/inc/AmbigResolver.hh +++ /dev/null @@ -1,38 +0,0 @@ -// -// base class to resolve hit ambiguities. This class also interacts with the -// simulated annealing. -// -// Original author: David Brown (LBNL), 2012 -// -// -#ifndef AmbigResolver_HH -#define AmbigResolver_HH -// #include "BTrk/BaBar/BaBar.hh" - -#include - -class KalRep; -class TrkSimpTraj; -namespace mu2e { - class TrkStrawHit; - class AmbigResolver { - public: - explicit AmbigResolver(double tmpErr); - virtual ~AmbigResolver() = 0; - - // resolve a track. Depending on the configuration, this might - // update the hit state and the t0 value. - - virtual bool resolveTrk(KalRep* kfit) const = 0; - - protected: - // reset penalty errors - virtual void initHitErrors(KalRep* kfit) const ; - // find the local trajectory piece computed from the fit excluding a particular set of hits. - // the hits are assumed to be contiguous - const TrkSimpTraj* findTraj(std::vector const& phits, const KalRep* krep) const; - double _tmpErr; // hit error associated with annealing 'temperature' - }; -} - -#endif diff --git a/TrkReco/inc/DoubletAmbigResolver.hh b/TrkReco/inc/DoubletAmbigResolver.hh deleted file mode 100644 index 066c28cdd4..0000000000 --- a/TrkReco/inc/DoubletAmbigResolver.hh +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 2015-04-08 P.Murat: -// ------------------- -// resolve hit ambiguities by panel, assuming a reasonable track fit as input -/////////////////////////////////////////////////////////////////////////////// - -#ifndef DoubletAmbigResolver_HH -#define DoubletAmbigResolver_HH - -// #include "BTrk/BaBar/BaBar.hh" - #include "Offline/TrkReco/inc/AmbigResolver.hh" - -#ifndef __GCCXML__ -#include "fhiclcpp/ParameterSet.h" -#endif/*__GCCXML__*/ -#include -#include -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Vector/Rotation.h" - -class TrkDifTraj; -class KalRep; - -#include "Offline/BTrkData/inc/Doublet.hh" - -namespace mu2e { - - class Straw; - - class DoubletAmbigResolver : public AmbigResolver { - public: - enum trajtype {reftraj=0}; - - struct Data_t { - int index[2]; - int ibest; - int inext; - - double chi2min; - double chi2next; - - const mu2e::Straw* straw [2]; - double rdrift [2]; - double doca [4][2]; - double chi2Slope [4]; // slope contribution to the total chi2 - double chi2Coord [4]; // coordinate contribution to the total chi2 - double chi2 [4]; // total chi2 - double trkslope; - double lineSlopes[4]; - CLHEP::Hep3Vector spos [2]; - CLHEP::Hep3Vector sposr [2]; - CLHEP::Hep3Vector tpos [2]; - CLHEP::Hep3Vector tposr [2]; - }; - - protected: - double _extErr; - int _debugLevel; - - double _mindrift; // minimum drift to assign an ambiguity. Below this, an ambiguity of '0' is defined - double _zeropenalty; // special penalty for drifts below the minimum - bool _penalty; // apply penalty or notA - // exponential + linear fit to ambiguity mis-assignment - double _expnorm; - double _lambda; - double _offset; - double _slope; - // need to define !!!! - double _sigmaSlope; - double _maxDoubletChi2; - double _scaleErrDoublet; - double _minDriftDoublet; - double _deltaDriftDoublet; - int _excludeBothHits; // when calculating residuals to choose the drift signs - double _minChi2Ratio; // if chi2(best)/chi2(next) < _minChi2Ratio, doublet is "well measured" - double _tempScale; // - double _penaltyScale; // - int _useMeanResidual; // as a penalty, if _meanResidual is defined - double _maxMeanResidual; // max mean residual - can't make it very large - double _maxHitChi; - - int _sign[4][2]; - int _iter; // iteration - int _Final; // final iteration - double _meanResidual; // mean residual (est) for active hits on a track - //----------------------------------------------------------------------------- - // constructors and destructor - //----------------------------------------------------------------------------- - public: -#ifndef __GCCXML__ - explicit DoubletAmbigResolver(fhicl::ParameterSet const&, double ExtErr, int Iter, int Final); -#endif/*__GCCXML__*/ - virtual ~DoubletAmbigResolver(); - - int calculateDoubletParameters(const KalRep* KRep, Doublet* HitDoublet, Data_t* R) const ; - void defineHitDriftSign (mu2e::TrkStrawHit* Hit, int I, Data_t* R) const ; - - void findLines (CLHEP::Hep3Vector* Pos, double* R, double* Slopes) const ; - void findDoublets (const KalRep* KRep, vector* ListOfDoublets) const ; - //----------------------------------------------------------------------------- - // three functions below modify KRes - update hit drift directions and assign penalty errors - //----------------------------------------------------------------------------- - void markDoublet (KalRep* KRes, Doublet *HitDoublet, int Index0, int Index1) const; - void markMultiplets (KalRep* Kres, vector* ListOfDoublets) const ; - void resolveSingleHit (KalRep* Kres, mu2e::TrkStrawHit* Hit) const ; - //----------------------------------------------------------------------------- - // overloaded functions of the base class - // resolve a track. Depending on the configuration, this might - // make penalty error virtual ? penalty function depends on the drift radius - //----------------------------------------------------------------------------- - double penaltyError(double rdrift) const; - - // update the hit state and the t0 value. - virtual bool resolveTrk (KalRep* KRes) const; - - virtual void initHitErrors(KalRep* krep) const ; - - }; -} -#endif diff --git a/TrkReco/inc/FixedAmbigResolver.hh b/TrkReco/inc/FixedAmbigResolver.hh deleted file mode 100644 index 71190e0715..0000000000 --- a/TrkReco/inc/FixedAmbigResolver.hh +++ /dev/null @@ -1,29 +0,0 @@ -// -// dummy 'resolver' that leaves every hit ambiguity unchanged -// -// Original author: David Brown (LBNL), 2012 -// -// -#ifndef FixedAmbigResolver_HH -#define FixedAmbigResolver_HH -#include "BTrk/BaBar/BaBar.hh" -#include "Offline/TrkReco/inc/AmbigResolver.hh" -#ifndef __GCCXML__ -#include "fhiclcpp/ParameterSet.h" -#endif/*__GCCXML__*/ - -namespace mu2e { - - class FixedAmbigResolver : public AmbigResolver { - public: - // construct from parameter set -#ifndef __GCCXML__ - explicit FixedAmbigResolver(fhicl::ParameterSet const& pset,double tmpErr); -#endif/*__GCCXML__*/ - virtual ~FixedAmbigResolver(); - virtual bool resolveTrk(KalRep* kfit) const; - private: - bool _neutralize; // if true, set the initial ambiguity to 0 - }; -} -#endif diff --git a/TrkReco/inc/HitAmbigResolver.hh b/TrkReco/inc/HitAmbigResolver.hh deleted file mode 100644 index 154c1787e5..0000000000 --- a/TrkReco/inc/HitAmbigResolver.hh +++ /dev/null @@ -1,48 +0,0 @@ -// -// class to resolve hit ambiguities by a single hit, assuming a reasonable track -// fit as input -// -// Original author: David Brown (LBNL), 2012 -// -// -#ifndef HitAmbigResolver_HH -#define HitAmbigResolver_HH -#include "BTrk/BaBar/BaBar.hh" -#include "Offline/TrkReco/inc/AmbigResolver.hh" -#ifndef __GCCXML__ -#include "fhiclcpp/ParameterSet.h" -#endif/*__GCCXML__*/ -#include -#include - -class TrkDifTraj; -class KalRep; - -namespace mu2e { - - class HitAmbigResolver : public AmbigResolver { - public: - enum trajtype {reftraj=0}; - // construct from parameter set -#ifndef __GCCXML__ - explicit HitAmbigResolver(fhicl::ParameterSet const&, double tmpErr); -#endif/*__GCCXML__*/ - virtual ~HitAmbigResolver(); - // resolve a track. Depending on the configuration, this might - // update the hit state and the t0 value. - virtual bool resolveTrk(KalRep* kfit) const; - private: - // penalty function depends on the drift radius - double penaltyError(double rdrift) const; - double _mindrift; // minimum drift to assign an ambiguity. Below this, an ambiguity of '0' is defined - double _zeropenalty; // special penalty for drifts below the minimum - bool _penalty; // apply penalty or notA - // exponential + linear fit to ambiguity mis-assignment - double _expnorm; - double _lambda; - double _offset; - double _slope; - int _debug; - }; -} -#endif diff --git a/TrkReco/inc/KalFit.hh b/TrkReco/inc/KalFit.hh deleted file mode 100644 index 24207367d8..0000000000 --- a/TrkReco/inc/KalFit.hh +++ /dev/null @@ -1,163 +0,0 @@ -// -// Class to perform BaBar Kalman fit -// Original author: Dave Brown LBNL 2012 -// -// -#ifndef TrkReco_KalFit_HH -#define TrkReco_KalFit_HH - -// framework - -#ifndef __GCCXML__ -#include "fhiclcpp/ParameterSet.h" -#endif/*__GCCXML__*/ - -// data -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -// tracker -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/TrackerGeom/inc/Straw.hh" -// BaBar -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/KalmanTrack/KalContext.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/BField/BField.hh" -// Mu2e objects -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/BTrkData/inc/TrkCaloHit.hh" -#include "Offline/RecoDataProducts/inc/KalSeed.hh" -#include "Offline/TrkReco/inc/AmbigResolver.hh" -#include "Offline/TrkReco/inc/KalFitData.hh" -#include "Offline/TrkReco/inc/TrkTimeCalculator.hh" -#include "Offline/TrackerConditions/inc/StrawResponse.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" -#include "Offline/TrkReco/inc/TrkPrintUtils.hh" - -//CLHEP -#include "CLHEP/Units/PhysicalConstants.h" -// C++ -#include - -namespace mu2e -{ - class Calorimeter; - - class KalFit : public KalContext - { - public: - // define different ambiguity resolution strategies - enum ambigStrategy {fixedambig=0,hitambig=2,panelambig=3,doubletambig=4}; - // different locations to which the track may be extended - enum extent {noextension=-1,target=0,ipa=1,tracker=2,calo=3}; - // parameter set should be passed in on construction -#ifndef __GCCXML__ - explicit KalFit(fhicl::ParameterSet const&); -#endif/*__GCCXML__*/ - - virtual ~KalFit(); - // all functions using the KalFitData 'common block' need to be re-engineered FIXME! - // // create a fit object from a track definition - // create a fit object from a track seed, - void makeTrack(StrawResponse::cptr_t srep, - Mu2eDetector::cptr_t detmodel, - KalFitData&kalData); - // add a set of hits to an existing fit - void addHits(StrawResponse::cptr_t srep, Mu2eDetector::cptr_t detmodel, - KalFitData&kalData, double maxchi); - // return value is the index of the cluster (if added) - int addTrkCaloHit(Mu2eDetector::cptr_t detmodel, KalFitData&kalData); - // add materials to a track - bool unweedHits (KalFitData&kalData, double maxchi); - // KalContext interface - virtual const TrkVolume* trkVolume(trkDirection trkdir) const ; - BField const& bField() const; - void setCalorimeter (const Calorimeter* Cal ) { _calorimeter = Cal; } - void setTracker (const Tracker* Tracker) { _tracker = Tracker; } - void setCaloGeom(); - - void findCaloDiskFromTrack(KalFitData& kalData, int& trkToCaloDiskId, double&trkInCaloFlt); - - TrkErrCode fitIteration (Mu2eDetector::cptr_t detmodel, - KalFitData& kalData,int iter); - bool weedHits (KalFitData& kalData, int iter); - bool updateT0 (KalFitData& kalData, int iter); - bool weedTrkCaloHit(KalFitData& kalData, int iter=-1); - - bool useTrkCaloHit() const { return _useTrkCaloHit;} - void fillTchDiag(KalFitData& kalData); - - bool hit_time (TrkHit*hit, HitT0& hitT0); - HitT0 krep_hitT0(KalRep*krep, const TrkHit*hit); - - TrkPrintUtils* printUtils() { return _printUtils; } - - private: - // iteration-independent configuration parameters - int _debug; // debug level - double _maxhitchi; // maximum hit chi when adding or weeding - double _maxpull; // maximum pull in TrkHit - unsigned _maxweed; - unsigned _maxweedtch; - bool _initt0; // initialize t0? - bool _useTrkCaloHit; //use the TrkCaloHit - float _nCaloExtrapolSteps; - double _caloHitErr; // spatial error to use for TrkCaloHit - std::vector _updatet0; // update t0 ieach iteration? - std::vector _t0tol; // convergence tolerance for t0 - double _t0errfac; // fudge factor for the calculated t0 error - double _mint0doca; // minimum doca for t0 calculation. Note this is a SIGNED QUANTITITY - double _t0nsig; // # of sigma to include when selecting hits for t0 - double _mindocatch, _maxdocatch; //minimum and maximum value of the TrkCaloHit DOCA - double _mindepthtch, _maxdepthtch; //minimum and maximum value of the TrkCaloHit depth within the crystals - double _maxtchdt; //maximum time window allowed to match a CaloCluster with the Track - double _mintchenergy;//minimum energy of the TrkCaloHit to be considered - double _mintchtrkpath;//minimum track path length allowed when doing the track extrapolation to the calorimeter - double _strHitW, _calHitW;//weight used to evaluate the initial track T0 - unsigned _minnstraws; // minimum # staws for fit - double _maxmatfltdiff; // maximum difference in track flightlength to separate to intersections of the same material - // iteration-dependent configuration parameters - std::vector _weedhits; // weed hits? - std::vector _herr; // what external hit error to add (for simulated annealing) - std::vector _ambigstrategy; // which ambiguity resolver to use - std::vector _addmaterial; // look for additional materials along the track - std::vector _ambigresolver; - bool _resolveAfterWeeding; - extent _exup; - extent _exdown; - const mu2e::Tracker* _tracker; // straw tracker geometry - const mu2e::Calorimeter* _calorimeter; - int _annealingStep; - TrkTimeCalculator _ttcalc; - // relay access to BaBar field: this should come from conditions, FIXME!!! - mutable BField* _bfield; - - // parameters needed for evaluating the expected track impact point in the calorimeter - unsigned _nCaloDisks; - std::array _zmaxcalo, _zmincalo, _rmaxcalo, _rmincalo; - - TrkPrintUtils* _printUtils; - - // helper functions - bool fitable(KalSeed const& kseed); - void initT0(KalFitData&kalData); - - void makeTrkStrawHits (StrawResponse::cptr_t srep, - KalFitData&kalData, TrkStrawHitVector& tshv ); - void makeTrkCaloHit (KalFitData&kalData, TrkCaloHit *&tch); - void makeMaterials ( Mu2eDetector::cptr_t detmodel, - TrkStrawHitVector const&, HelixTraj const& htraj, - std::vector& dinter); - unsigned addMaterial (Mu2eDetector::cptr_t detmodel, KalRep* krep); - bool unweedBestHit (KalFitData&kalData, double maxchi); - TrkErrCode fitTrack (Mu2eDetector::cptr_t detmodel, KalFitData&kalData); - void updateHitTimes (KalRep* krep); - double zFlight (KalRep* krep,double pz); - double extendZ (extent ex); - TrkErrCode extendFit (KalRep* krep); - - void findBoundingHits (KalRep* krep, double flt0, - TrkHitVector::reverse_iterator& ilow, - TrkHitVector::iterator& ihigh); - }; -} -#endif diff --git a/TrkReco/inc/KalFitData.hh b/TrkReco/inc/KalFitData.hh deleted file mode 100644 index 1c3eb09eb7..0000000000 --- a/TrkReco/inc/KalFitData.hh +++ /dev/null @@ -1,86 +0,0 @@ -// -// Simple accessor to Kalman fit -// -// -#ifndef KalFitData_HH -#define KalFitData_HH - -#include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "Offline/RecoDataProducts/inc/KalSeed.hh" -#include "Offline/BTrkData/inc/Doublet.hh" - -#include "BTrk/TrkBase/TrkT0.hh" -#include "BTrk/BaBar/BaBar.hh" - -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/TrkBase/HelixTraj.hh" - -namespace art { - class Event; -} - -namespace mu2e { - struct MissingHit_t { - StrawHitIndex index; - double doca; - double dr; - }; - - //----------------------------------------------------------------------------- - // struct defining the Kalman fit inputs and output - // an internal CalPatRec data structure - // KalFitData doesn't own any pointers, '_krep' is handled in the pattern - // recognition modules, so, no need to delete it here - // otherwise, deletion of the list of KalFitData's (a data product) results in a crash - //----------------------------------------------------------------------------- - struct KalFitData { - struct Diag_t { - unsigned diskId; - unsigned added; - double depth; - double dt; - double trkPath; - double energy; - double doca; - }; - - const art::Event* event; - KalRep* krep; // Kalman rep, owned by the collection - const ComboHitCollection* chcol; // - - const StrawHitFlagCollection* shfcol; // - std::string shDigiLabel; // - - TrkFitDirection fdir; - const CaloCluster* caloCluster; // - const CaloClusterCollection* caloClusterCol; // - - const HelixSeed* helixSeed; // - const KalSeed* kalSeed; // - HelixTraj* helixTraj; // initial parameterization of the track - unsigned nweediter; // number of iterations on hit weeding - unsigned nweedtchiter; // number of iterations on TrkCaloHit weeding - std::vector missingHits; - int fitType; // 0:seed 1:final - - Diag_t diag; - //----------------------------------------------------------------------------- - // constructors and destructor - //----------------------------------------------------------------------------- - KalFitData(); - ~KalFitData(); - - void deleteTrack (); - KalRep* stealTrack (); - void init (); - }; - -} - -#endif diff --git a/TrkReco/inc/PanelAmbigResolver.hh b/TrkReco/inc/PanelAmbigResolver.hh deleted file mode 100644 index 86d3ba0acb..0000000000 --- a/TrkReco/inc/PanelAmbigResolver.hh +++ /dev/null @@ -1,74 +0,0 @@ -// -// class to resolve hit ambiguities by panel, assuming a reasonable track -// fit as input -// -// Original author: David Brown (LBNL), 2012 -// -// -#ifndef mu2e_PanelAmbig_PanelAmbigResolver_HH -#define mu2e_PanelAmbig_PanelAmbigResolver_HH -#include "BTrk/BaBar/BaBar.hh" -#include "Offline/TrkReco/inc/AmbigResolver.hh" -#include "Offline/TrkReco/inc/PanelAmbigStructs.hh" -#include "Offline/DataProducts/inc/PanelId.hh" -#ifndef __GCCXML__ -#include "fhiclcpp/ParameterSet.h" -#endif/*__GCCXML__*/ -#include -#include -// Root -#include "Rtypes.h" -#include "TTree.h" - -class KalRep; -class TrkT0; - -namespace mu2e { - namespace PanelAmbig { - class PanelAmbigResolver : public AmbigResolver { - public: - // construct from parameter set -#ifndef __GCCXML__ - explicit PanelAmbigResolver(fhicl::ParameterSet const&, double tmpErr, size_t iter ); -#endif/*__GCCXML__*/ - virtual ~PanelAmbigResolver(); - // resolve a track. Depending on the configuration, this might - // update the hit state and the t0 value. - virtual bool resolveTrk(KalRep* krep) const; - private: - // resolve the ambiguity on a single panel - bool resolvePanel(TrkStrawHitVector& phits, KalRep* krep) const; - // fill information about a given panel's track and hits - bool fillPanelInfo(TrkStrawHitVector const& phits, const KalRep* krep, PanelInfo& pinfo) const; - // compute the panel result for a given ambiguity/activity state and the ionput t0 - void fillResult(PanelInfo const& pinfo,TrkT0 const& t0, PanelResult& result) const; - // parameters - double _minsep; // minimum chisquared separation between best solution and the rest to consider a panel resolved - double _inactivepenalty; // chisquared penalty for an inactive hit - double _nullpenalty; // chisquared penalty for a null ambiguity hit - double _penaltyres; // resolution term to add to hits if ambiguity/activity can't be resolved - double _trkpenaltyres; // resolution term to add to track - double _nullerr2; // additional error (squared) for hits with null ambiguity - bool _addtrkpos; // add constraint associated with the track position to the chisquared - HSV _allowed; // allowed states of a TrkStrawHit - double _maxhitu; // maximum u value allowed for a hit - bool _fixunallowed; // fix the state of any hit whose initial state isn't allowed - unsigned _maxnpanel; // max # of hits to consider for a panel - int _diag; // diagnostic level` - // TTree variables, mutable so they don't change const - mutable TTree *_padiag, *_pudiag; // diagnostic TTree - mutable Int_t _nuhits, _nrhits; // # hits in this panel - mutable Int_t _nactive; // # active hits in this panel - mutable Int_t _nused; // # hits used to compute chisquared - mutable Int_t _nres; // # of results for this panel (combinatorics) - mutable Float_t _tupos; // u track position - mutable Float_t _tuerr; // u track position - mutable TSHUIV _uinfo; // u position of hits in panel - mutable Float_t _mctupos; - mutable PRV _results; - }; - } // PanelAmbig namespace -} // mu2e namespace - -#endif - diff --git a/TrkReco/src/AmbigResolver.cc b/TrkReco/src/AmbigResolver.cc deleted file mode 100644 index ecd3eb69cc..0000000000 --- a/TrkReco/src/AmbigResolver.cc +++ /dev/null @@ -1,71 +0,0 @@ -// -// Base class to resolve hit ambiguities -// -// -#include "Offline/TrkReco/inc/AmbigResolver.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalSite.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/difAlgebra/DifPoint.hh" -#include "BTrk/difAlgebra/DifVector.hh" -#include -#include -#include - -namespace mu2e { - typedef std::vector::const_iterator KSI; - - AmbigResolver::AmbigResolver(double tmpErr) : _tmpErr(tmpErr) {} - - AmbigResolver::~AmbigResolver() {} - - //----------------------------------------------------------------------------- - // in the beginning of iteration set external hit errors to a constant - //----------------------------------------------------------------------------- - void AmbigResolver::initHitErrors(KalRep* krep) const { - // get hits and cast to TrkStrawHits - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - for (auto itsh=tshv.begin();itsh!=tshv.end(); ++itsh){ - (*itsh)->setTemperature(_tmpErr); - } - } - - const TrkSimpTraj* - AmbigResolver::findTraj(std::vector const& phits, const KalRep* krep) const { - const TrkSimpTraj* retval(0); - // if the fit is valid, use the full fit result. - if(krep->fitValid()){ - // find the range of these hits in the KalRep site vector - std::vector const& sites = krep->siteList(); - KSI first = sites.begin(); - while(first != sites.end() && (*first)->globalLength() < phits.front()->fltLen() ) { - ++first; - } - KSI last = first; - while(last != sites.end() && (*last)->globalLength() < phits.back()->fltLen() ){ - ++last; - } - // back off one - if(first != sites.begin())--first; - if(last == sites.end())--last; - // create a trajectory from the fit which excludes this set of hits - // Use of static is memory-efficient but not threadsafe FIXME!!! - static TrkSimpTraj* straj = krep->seed()->clone(); - if(krep->smoothedTraj(first,last,straj)){ - retval = straj; - } - } - // Otherwise, use the reference traj at the center of these hits - if(retval == 0){ - double locdist; - double gdist = 0.5*(phits.front()->fltLen()+phits.back()->fltLen()); - retval = krep->referenceTraj()->localTrajectory(gdist,locdist); - } - return retval; - } - - -} diff --git a/TrkReco/src/DoubletAmbigResolver.cc b/TrkReco/src/DoubletAmbigResolver.cc deleted file mode 100644 index d5bb5b75bf..0000000000 --- a/TrkReco/src/DoubletAmbigResolver.cc +++ /dev/null @@ -1,1270 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// class to resolve hit ambiguities one hit at a time, -// assuming a reasonable track fit as input -// DoubletAmbigResolver is instantiated from Stntuple/mod/InitTrackBlock.cc -// thus all parameters need to have defaults in the source -/////////////////////////////////////////////////////////////////////////////// -/* -#include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalSite.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include -#include -#include - -using CLHEP::Hep3Vector; -using CLHEP::HepRotationZ; - -namespace mu2e { - typedef std::vector::iterator TSHI; - - - //----------------------------------------------------------------------------- - DoubletAmbigResolver::DoubletAmbigResolver(fhicl::ParameterSet const& PSet, - double extErr, - int Iter, - int Final) : - AmbigResolver(extErr), - _debugLevel (PSet.get ("debugLevel" )), - _mindrift (PSet.get("HitMinDrift" )), - _zeropenalty (PSet.get("ZeroDriftPenalty")), - _penalty (PSet.get ("HitAmbigPenalty" )), - //----------------------------------------------------------------------------- - // not sure what the next four numbers are - //----------------------------------------------------------------------------- - _expnorm (PSet.get("HitExpNorm" ,0.03907 )), - _lambda (PSet.get("HitLambda" ,0.1254 )), - _offset (PSet.get("HitOffset" ,0.073 )), - _slope (PSet.get("HitSlope" ,-0.002374)), - //----------------------------------------------------------------------------- - // parameters below are used for decisions on hit drift direction assignment, - // but not for doublet reconstruction. - // as doublet reconstruction is used in several places, need to be able to - // create the ambig resolver w/o specifying any numbers in the talk to's - //----------------------------------------------------------------------------- - _sigmaSlope (PSet.get("sigmaSlope" )), - _maxDoubletChi2 (PSet.get("maxDoubletChi2" )), - _scaleErrDoublet (PSet.get("scaleErrDoublet" )), - _minDriftDoublet (PSet.get("minDriftDoublet" )), - _deltaDriftDoublet(PSet.get("deltaDriftDoublet")), - _excludeBothHits (PSet.get ("excludeBothHits" )), // default:1 - _minChi2Ratio (PSet.get("minChi2Ratio" )), - _tempScale (PSet.get("tempScale" )), - _penaltyScale (PSet.get("penaltyScale" )), - _useMeanResidual (PSet.get("useMeanResidual" )), - _maxMeanResidual (PSet.get("maxMeanResidual" )), - _iter(Iter), - _Final(Final) - { - //----------------------------------------------------------------------------- - // initialize sequence of drift signs: (1,1) (1,-1) (-1,-1) (-1,1) - // 0 and 2: SS doublets, 1 and 3: OS doublets - //----------------------------------------------------------------------------- - double s[4][2] = { 1, 1, 1, -1, -1, -1, -1, 1} ; - for (int i=0; i<4; i++) { - for (int j=0; j<2; j++) { - _sign[i][j] = s[i][j]; - } - } - } - - - //----------------------------------------------------------------------------- - // destructor - //----------------------------------------------------------------------------- - DoubletAmbigResolver::~DoubletAmbigResolver() {} - - //----------------------------------------------------------------------------- - // first step: create list of doublets - //----------------------------------------------------------------------------- - void DoubletAmbigResolver::findDoublets (const KalRep* KRep, vector* DCol) const { - mu2e::TrkStrawHit *hit; - - int station, panel; - int oldStation(-1), oldPanel(-1), idlast(0); - int trkshsize, shId, layer, istraw; - - Hep3Vector wdir; - Hep3Vector pos, posPanel, wpos[10], tmppos; - Hep3Vector tdir, trkpos; - HepPoint tpos; - - std::vector* dcol; - - double flen, ds, doca, rdrift, phiPanel; - double endTrk(0.0);//Krep->endFoundRange(); - - if (_debugLevel > 1){ - printf("[DoubletAmbigResolver::findDoublets]-------------------------------------------------\n"); - printf("[DoubletAmbigResolver::findDoublets] i shId ch panel il iw driftR doca\n"); - printf("[DoubletAmbigResolver::findDoublets]-------------------------------------------------\n"); - } - - dcol = DCol; - dcol->clear(); - - int multipletIndex(0); - //----------------------------------------------------------------------------- - // use all hits, not only active ones - //----------------------------------------------------------------------------- - int i = 0; - TrkStrawHitVector tshv; - convert(KRep->hitVector(),tshv); - for (auto ihit=tshv.begin(); ihit!=tshv.end(); ++ihit) { - // if (hit->isActive() == 0) goto END_OF_LOOP; - Straw const& straw = (*ihit) ->straw(); - wdir = straw.getDirection(); - pos = straw.getMidPoint(); - station = straw.id().getPlane(); - panel = straw.id().getPanel(); - shId = straw.id().asUint16(); - //----------------------------------------------------------------------------- - // track info - //----------------------------------------------------------------------------- - HelixTraj trkHel(KRep->helix(endTrk).params(),KRep->helix(endTrk).covariance()); - flen = trkHel.zFlight(pos.z()); - KRep->traj().getInfo(flen, tpos, tdir); - //----------------------------------------------------------------------------- - // try to extrapolate helix a bit more accurately - //----------------------------------------------------------------------------- - ds = (pos.z()-tpos.z())/tdir.z(); - KRep->traj().getInfo(flen+ds, tpos, tdir); - trkpos.set(tpos.x(), tpos.y(), tpos.z()); - - //calculate distance of closest approach - from midwire to track - HepPoint p1(pos.x(),pos.y(),pos.z()); - HepPoint p2(trkpos.x() ,trkpos.y() ,trkpos.z()); - - TrkLineTraj trstraw(p1, wdir, 0., 0.); - TrkLineTraj trtrk (p2, tdir, 0., 0.); - //----------------------------------------------------------------------------- - // distance of closest approach calculated from the track to the hit, - // track trajectory is the first parameter - //----------------------------------------------------------------------------- - TrkPoca poca (trtrk,0.,trstraw,0.); - doca = poca.doca(); - // get the drift radius - rdrift = (*ihit)->driftRadius(); - - if (_debugLevel > 1) { - layer = straw.id().getLayer(); - istraw = straw.id().getStraw(); - printf("[DoubletAmbigResolver::findDoublets] %2i %5i %3i %4i %3i %3i %8.3f %8.3f\n", - i, shId, station, panel, layer, istraw, rdrift, doca); - } - //----------------------------------------------------------------------------- - // do not use straw hits with small drift radii - //----------------------------------------------------------------------------- - if (station != oldStation) { - //----------------------------------------------------------------------------- - // new chamber : create new doublet candidate - //----------------------------------------------------------------------------- - dcol->push_back(Doublet(multipletIndex, station, panel, wdir, tdir, trkpos, *ihit)); - oldStation = station; - oldPanel = panel; - ++idlast; - ++multipletIndex; - } - else { - if (panel == oldPanel) { - //----------------------------------------------------------------------------- - // same chamber, same panel : add one more hit to the last doublet - //----------------------------------------------------------------------------- - dcol->at(idlast-1).addStrawHit(tdir, trkpos, *ihit); - } - else { - //----------------------------------------------------------------------------- - // same chamber, different panel : new doublet candidate - //----------------------------------------------------------------------------- - dcol->push_back(Doublet(multipletIndex, station, panel, wdir, tdir, trkpos, *ihit)); // - oldStation = station; - oldPanel = panel; - ++idlast; - ++multipletIndex; - } - } - i += 1; - } - //----------------------------------------------------------------------------- - // list of doublets is formed, determine the doublet parameters but not - // assine the hit drift directions - //----------------------------------------------------------------------------- - int ndoublets = dcol->size(); - Data_t r; - - for (int i=0; iat(i); - int nhits = d->fNStrawHits; - if (nhits == 1) { - //----------------------------------------------------------------------------- - // single hit - //----------------------------------------------------------------------------- - - } - else if (nhits == 2) { - //----------------------------------------------------------------------------- - // regular case: a 2-hit doublet - //----------------------------------------------------------------------------- - r.index[0] = 0; - r.index[1] = 1; - calculateDoubletParameters(KRep,d,&r); - } - else { - //----------------------------------------------------------------------------- - // a multiplet - more than 2 hits in a panel - //----------------------------------------------------------------------------- - // vector list; - Doublet bd; - double chi2_d, chi2_best(1.e12); - - for (int j=0; jfNStrawHits; ++j) { - for (int k=j+1; kfNStrawHits; ++k) { - //-------------------------------------------------------------------------- - // find the best combination - //----------------------------------------------------------------------------- - r.index[0] = j; - r.index[1] = k; - calculateDoubletParameters(KRep,d,&r); - - chi2_d = d->chi2Best(); - if (chi2_d < chi2_best) { - chi2_best = chi2_d; - bd = *d; - } - } - } - *d =bd; - } - } - //----------------------------------------------------------------------------- - // list of doublets is formed, the rest of this routine - diagnostics only - //----------------------------------------------------------------------------- - Doublet *doublet; - CLHEP::HepRotationZ rot; - - if (_debugLevel > 1) { - - printf("[DoubletAmbigResolver::findDoublets] _iter:%i: found %i multiplets\n",_iter,ndoublets); - printf("--------------------------------------------------------------"); - printf("------------------------------------------------------------------------\n"); - printf(" i shId pl pn il is x y z sinphi "); - printf("tksphi xtrk ytrk ztrk xr yr zr doca rdr\n"); - printf("--------------------------------------------------------------"); - printf("------------------------------------------------------------------------\n"); - - for (int i=0; iat(i); - trkshsize = doublet->fNStrawHits; - //----------------------------------------------------------------------------- - // assume wires are perpendicular to the radial direction to the panel - // this is already ambiguos - // use atan2 to get the right quadrant - //----------------------------------------------------------------------------- - posPanel = doublet->fHit[0]->straw().getMidPoint(); - phiPanel = atan2(posPanel.y(),posPanel.x()); - rot.set(-phiPanel); - posPanel = rot*posPanel; - - for (int j=0; jfHit[j]; - Straw const& straw = hit->straw(); - shId = straw.id().asUint16(); - //----------------------------------------------------------------------------- - // mid-wire position and the wire direction - //----------------------------------------------------------------------------- - wpos[j] = straw.getMidPoint(); - wdir = doublet->fShDir; - //----------------------------------------------------------------------------- - // track position and direction - //----------------------------------------------------------------------------- - trkpos = doublet->fTrkPos[j]; - tdir = doublet->fTrkDir[j]; - - HepPoint p1(wpos[j].x(),wpos[j].y(),wpos[j].z()); - HepPoint p2(trkpos.x() ,trkpos.y() ,trkpos.z()); - - TrkLineTraj trstraw(p1, wdir, 0., 0.); - TrkLineTraj trtrk (p2, tdir, 0., 0.); - TrkPoca poca (trstraw, 0.,trtrk , 0.); - doca = poca.doca(); - rdrift = hit->driftRadius(); - //----------------------------------------------------------------------------- - // rotate into a coordinate system with X axis pointing towards the panel and - // Y axis pointing in the wire direction - // current channel numbering scheme allows for that - //----------------------------------------------------------------------------- - wpos[j] = rot*wpos[j]; - trkpos = rot*trkpos; - tdir = rot*tdir; - - printf(" %2i %5i %2i %2i %2i %3i %9.3f %9.3f %9.3f %6.3f ", - i, shId, doublet->fStationId, doublet->fPanelId, - straw.id().getLayer(), - straw.id().getStraw(), - straw.getMidPoint().x(), - straw.getMidPoint().y(), - straw.getMidPoint().z(), - wdir.y() - ); - - printf("%6.3f %9.3f %8.3f %9.3f %8.3f %4.1f %9.3f %7.3f %5.3f\n", - tdir.x()/tdir.z(), - trkpos.x(), trkpos.y(), trkpos.z(), - wpos[j].x(), wpos[j].y(), wpos[j].z(), - doca, - rdrift - ); - } - } - } - } - - //--------------------------------------------------------------------------- - // resolve drift ambiguity for a single (non-doublet) hit - //--------------------------------------------------------------------------- - void DoubletAmbigResolver::resolveSingleHit(KalRep* Krep, - mu2e::TrkStrawHit* Hit ) const { - - double doca[2], xbest, xnext, perr; - std::vector hits; - - Straw const& straw = Hit->straw(); - - const Hep3Vector& wdir = straw.getDirection(); - const Hep3Vector& wmid = straw.getMidPoint(); - - if (_useMeanResidual) perr = _meanResidual; - else perr = fabs(Hit->driftRadius()/sqrt(3)); - //----------------------------------------------------------------------------- - // calculate residuals for two hit positions corresponding to two different - // drift signs - //----------------------------------------------------------------------------- - hits.push_back(Hit); - const TrkDifTraj* traj = findTraj(hits,Krep); - - double dmin = Hit->timeDiffDist()-Hit->timeDiffDistErr(); - double dmax = Hit->timeDiffDist()+Hit->timeDiffDistErr(); - TrkLineTraj wtraj(HepPoint(wmid.x(),wmid.y(),wmid.z()),wdir,dmin,dmax); - - TrkPoca poca(*traj,Hit->fltLen(),wtraj,Hit->hitLen()); - if (poca.status().success()) { - //----------------------------------------------------------------------------- - // doca(hit) = doca(wire)-_iamb*radius - //----------------------------------------------------------------------------- - double r = Hit->driftRadius(); - - doca[0] = poca.doca()-r; - doca[1] = poca.doca()+r; - - double err = Hit->temperature()*0.0625; // "external" error - double x0 = sqrt(doca[0]*doca[0]+err*err); - double x1 = sqrt(doca[1]*doca[1]+err*err); - - int ibest, inext; - if (x0 < x1) { - ibest = 0; - inext = 1; - } - else { - ibest = 1; - inext = 0; - } - - double drift_err(0.220); // assume 220 microns - from - - xbest = doca[ibest]/drift_err; - xnext = doca[inext]/drift_err; - //----------------------------------------------------------------------------- - // want the best solution to be consistent with the trajectory, another one - - // to be inconsistent, and the two - significantly different - //----------------------------------------------------------------------------- - if ((fabs(xbest) < 5.) && (fabs(xnext) > 5) && (fabs(xbest/xnext) < 0.25)) { - //----------------------------------------------------------------------------- - // hit is close enough to the trajectory - //----------------------------------------------------------------------------- - if (ibest == 0) Hit->setAmbig( 1); - else Hit->setAmbig(-1); - } - else { - //----------------------------------------------------------------------------- - // can't tell which one is better, just set ambiguity to zero - //----------------------------------------------------------------------------- - if (_Final == 0) { - // Hit->setTemperature(Hit->driftRadius()/Hit->driftVelocity()); - Hit->setPenalty(perr); - Hit->setAmbig(0); - } - else { - //----------------------------------------------------------------------------- - // no point to keep hits with very large residuals - //----------------------------------------------------------------------------- - if (ibest == 0) Hit->setAmbig( 1); - else Hit->setAmbig(-1); - Hit->setPenalty(perr); - } - } - if (_debugLevel > 0) { - CLHEP::Hep3Vector hpos; - Hit->hitPosition(hpos); - printf(" %2i %5i %2i %2i %2i %2i %8.3f %8.3f %9.3f, %2i %2i %8.3f %8.3f\n", - -1, Hit->comboHit().strawId().asUint16(), - straw.id().getPlane(), - straw.id().getPanel(), - straw.id().getLayer(), - straw.id().getStraw(), - hpos.x(), hpos.y(), hpos.z(), ibest, inext, xbest, xnext); - } - } - else { - //----------------------------------------------------------------------------- - // couldn't determine doca - //----------------------------------------------------------------------------- - printf(" ***** DoubletAmbigResolver::resolveSingleHit warning: cant determine POCA\n"); - // Hit->setTemperature(Hit->driftRadius()/Hit->driftVelocity()); - Hit->setPenalty(perr); - Hit->setAmbig(0); - } - - } - - //----------------------------------------------------------------------------- - // 2015-02-25 P.Murat: new resolver - // assume that coordinates are rotated into the coordinate system where Y axis - // is pointed along the wire by a rotation along the Z axis - // sign ordering convention: ++, +-, --, -+ is defined by DoubletAmbigResolver::_sign - //----------------------------------------------------------------------------- - void DoubletAmbigResolver::findLines(Hep3Vector* Pos, double* R, double* Slopes) const { - //----------------------------------------------------------------------------- - double nx[4], ny[4], dx, dy; //, ux, uy; - double alpha, dr, dr2, lx, ly; - // int invert[4]; - - dx = Pos[1].z()-Pos[0].z(); - dy = Pos[1].x()-Pos[0].x(); - dr2 = dx*dx+dy*dy; - dr = sqrt(dr2); - - lx = dx/dr; - ly = dy/dr; - - for (int i=0; i<4; i++) { - alpha = (R[1]*_sign[i][1]-R[0]*_sign[i][0])/dr; - nx[i] = _sign[i][0]*(-ly*alpha+lx*sqrt(1-alpha*alpha)); - ny[i] = _sign[i][0]*( lx*alpha+ly*sqrt(1-alpha*alpha)); - Slopes[i] = ny[i]/nx[i]; - } - } - - - //----------------------------------------------------------------------------- - // assume that the two hits to be used are known,their indices are stored in R - //----------------------------------------------------------------------------- - int DoubletAmbigResolver::calculateDoubletParameters(const KalRep* KRep , - Doublet* HitDoublet, - Data_t* R ) const { - - mu2e::TrkStrawHit *hit [2]; - - Hep3Vector sdir[2], sdirr[2], wpos[10], posPanel; - Hep3Vector tdir[2], tdirr[2]; - - Hep3Vector wdir1, wdir2; - - double phiPanel; - - double trkslope, dxdz[2], xdr[4][2]; - double dsl, xdsl, sig; - - double sflt[2], tflt[2]; - HepPoint spi[2] , tpi[2], hpos[4][2]; - Hep3Vector sdi[2] , tdi[2], u[2]; - TrkPoca poca[2]; - HepRotationZ rot; - //----------------------------------------------------------------------------- - // by construction, both hits are in the same panel, could be in the same or in - // different layers - // dx/dz[i] === dR/dZ of the track in the wire plane of the i-th hit - //----------------------------------------------------------------------------- - for (int i=0; i<2; i++) { - hit [i] = HitDoublet->fHit[R->index[i]]; - R->straw [i] = &hit[i]->straw(); - R->rdrift[i] = hit[i]->driftRadius(); - - R->spos [i] = R->straw[i]->getMidPoint(); - sdir [i] = R->straw[i]->getDirection(); - - phiPanel = std::atan2(R->spos[i].y(),R->spos[i].x()); - rot.set(-phiPanel); - - R->sposr[i] = rot*R->spos[i]; - sdirr [i] = rot*sdir[i]; - - R->tpos [i] = HitDoublet->fTrkPos[R->index[i]]; - tdir [i] = HitDoublet->fTrkDir[R->index[i]]; - - R->tposr[i] = rot*R->tpos[i]; - tdirr[i] = rot*tdir[i]; - dxdz [i] = tdirr[i].x()/tdirr[i].z(); - } - //----------------------------------------------------------------------------- - // 2019-02-03 PM : hope, this is temporary: make sure that the two hits are different! - // today it is not given - //----------------------------------------------------------------------------- - if (hit[0] == hit[1]) { - printf(" ERROR detected in DoubletAmbigResolver::calculateDoubletParameters: doublet with two identical hits. BAIL out\n"); - R->ibest = -1; - return -1; - } - //----------------------------------------------------------------------------- - // choose the best combination of the drift signs - the one corresponding - // to the slope closest to that of the track - // 1. slope chi2 term - // for the track dx/dz use average of the two dx/dz slopes - // calculated in the two layers corresponding to the doublet hits - //----------------------------------------------------------------------------- - trkslope = (dxdz[0]+dxdz[1])/2.; - findLines(R->sposr,R->rdrift,R->lineSlopes); - - for (int is=0; is<4; is++) { - dsl = fabs(trkslope - R->lineSlopes[is]); - xdsl = dsl/_sigmaSlope; - R->chi2Slope[is] = xdsl*xdsl; - } - //----------------------------------------------------------------------------- - // 2. add coordinate term, try to exclude both hits simultaneously - //----------------------------------------------------------------------------- - const TrkSimpTraj *ptraj, *ptraj0; - vector::const_iterator it1, it2; - double s, slen; - HepPoint t1pos; - Hep3Vector t1dir; - //----------------------------------------------------------------------------- - // make sure that nothing happens to the track itself - //----------------------------------------------------------------------------- - s = (hit[0]->fltLen()+hit[1]->fltLen())/2.; - ptraj = KRep->localTrajectory(s,slen); - ptraj0 = ptraj; - - HelixTraj smoothed_traj(*ptraj->parameters()); - - if (_excludeBothHits == 1) { - //------------------------------------------------------------------------------ - // determine the trajectory w/o both hits , then need to calculate residuals - //----------------------------------------------------------------------------- - std::vector::const_iterator itt[2]; - - for (int ih=0; ih<2; ih++) { - for (std::vector::const_iterator it=KRep->siteList().begin(); - it!= KRep->siteList().end(); it++) { - const KalHit* kalhit = (*it)->kalHit(); - if (kalhit && (kalhit->hit() == hit[ih])) { - itt[ih] = it; - break; - } - } - } - - KRep->smoothedTraj(itt[0], itt[1], &smoothed_traj); - - for (int ih=0; ih<2; ih++) { - TrkLineTraj st(HepPoint(R->spos[ih].x(),R->spos[ih].y(),R->spos[ih].z()),sdir[ih],0.,0.); - //----------------------------------------------------------------------------- - // need to check if I'm close in Z to the hit Z - //----------------------------------------------------------------------------- - smoothed_traj.getInfo(hit[ih]->fltLen(),t1pos,t1dir); - - TrkLineTraj tt (t1pos,t1dir,0.); // track, don't need - - poca[ih] = TrkPoca(st,0.,tt,0); - - sflt[ih] = poca[ih].flt1(); - tflt[ih] = poca[ih].flt2(); - - st.getInfo(sflt[ih],spi[ih],sdi[ih]); - tt.getInfo(tflt[ih],tpi[ih],tdi[ih]); - - u[ih] = sdi[ih].cross(tdi[ih]).unit(); // direction towards the center - } - } - //----------------------------------------------------------------------------- - // hopefully, this is a helical parameterization around hits of interest, - // so extrapolation uncertainties are not very large - // track parameterization is defined in the global coordinate system, do not rotate - //----------------------------------------------------------------------------- - for (int ih=0; ih<2; ih++) { - TrkLineTraj st(HepPoint(R->spos[ih].x(),R->spos[ih].y(),R->spos[ih].z()),sdir[ih],0.,0.); - - if (_excludeBothHits == 2) { - //----------------------------------------------------------------------------- - // exclude hits one by one - emulate "unbiased" residuals - //----------------------------------------------------------------------------- - ptraj = ptraj0; - - std::vector::const_iterator itt; - - for (std::vector::const_iterator it=KRep->siteList().begin(); - it!= KRep->siteList().end(); it++) { - const KalHit* kalhit = (*it)->kalHit(); - if (kalhit && (kalhit->hit() == hit[ih])) { - itt = it; - break; - } - } - - bool rc = KRep->smoothedTraj(itt, itt, &smoothed_traj); - - if (rc == true) { - ptraj = &smoothed_traj; - } - else { - //----------------------------------------------------------------------------- - // use the default trajectory parameterization - //----------------------------------------------------------------------------- - printf(" ERROR in DoubletAmbigResolver::markDoublets: couldnt get Trajectory w/o 1hit, use the local one\n"); - } - } - - ptraj->getInfo(hit[ih]->fltLen(),t1pos,t1dir); - - TrkLineTraj tt (t1pos,t1dir,0.); // track, don't need - - poca[ih] = TrkPoca(st,0.,tt,0); - - sflt[ih] = poca[ih].flt1(); - tflt[ih] = poca[ih].flt2(); - - st.getInfo(sflt[ih],spi[ih],sdi[ih]); - tt.getInfo(tflt[ih],tpi[ih],tdi[ih]); - - u[ih] = sdi[ih].cross(tdi[ih]).unit(); // direction towards the center - - for (int is=0; is<4; is++) { - //----------------------------------------------------------------------------- - // chi2 contributions of this hit - // error of the coordinate term is questionable - at initial iterations hits - // with small drift radius have smaller errors - doesn't make sense - //----------------------------------------------------------------------------- - hpos[is][ih] = spi[ih]+u[ih]*R->rdrift[ih]*_sign[is][ih]; - - R->doca[is][ih] = static_cast(hpos[is][ih]-tpi[ih]).dot(u[ih]); - - // sig = sqrt(R->rdrift[ih]*R->rdrift[ih] +0.1*0.1); // 2.5; // 1.; // before 2019-01-20 - sig = hit[ih]->totalErr(); - - xdr[is][ih] = R->doca[is][ih]/sig; - R->chi2Coord[is] = xdr[is][ih]*xdr[is][ih]; - R->chi2 [is] = R->chi2Slope[is]+R->chi2Coord[is]; - } - } - //----------------------------------------------------------------------------- - // determine the best solution - //----------------------------------------------------------------------------- - R->ibest = -1; - R->inext = -1; - R->chi2min = 1.e12; - R->chi2next = 1.e12; - - for (int is=0; is<4; is++) { - if (R->chi2[is] < R->chi2min) { - R->inext = R->ibest; - R->chi2next = R->chi2min; - R->ibest = is; - R->chi2min = R->chi2[is]; - } - else if (R->chi2[is] < R->chi2next) { - R->inext = is; - R->chi2next = R->chi2[is]; - } - } - //----------------------------------------------------------------------------- - // set best solutions - //----------------------------------------------------------------------------- - int os = _sign[R->ibest][0]+_sign[R->ibest][1]; - - HitDoublet->fOs = os; - HitDoublet->fIBest = R->ibest; - HitDoublet->fINext = R->inext; - HitDoublet->fHitIndex[0] = R->index[0]; - HitDoublet->fHitIndex[1] = R->index[1]; - - HitDoublet->fTrkDxDz = trkslope; - for (int is=0; is<4; is++) { - HitDoublet->fDxDz[is] = R->lineSlopes[is]; - HitDoublet->fChi2Slope[is] = R->chi2Slope[is]; - HitDoublet->fChi2Coord[is] = R->chi2Coord[is]; - HitDoublet->fChi2 [is] = R->chi2 [is]; - } - - for (int i=0; i<2; i++) { - HitDoublet->fStrawAmbig[R->index[i]] = _sign[R->ibest][i]; - } - - return 0; - } - - - //----------------------------------------------------------------------------- - // define hit drift sign in case the two best chi2's are close - //----------------------------------------------------------------------------- - void DoubletAmbigResolver::defineHitDriftSign(mu2e::TrkStrawHit* Hit, int I, Data_t* R) const { - double perr; - - //----------------------------------------------------------------------------- - // initialize the penalty error - //----------------------------------------------------------------------------- - if (_useMeanResidual) perr = _meanResidual; - else perr = fabs(R->rdrift[I]); // do we need 1./sqrt(3) here? - - if (_sign[R->ibest][I] == _sign[R->inext][I]) { - //----------------------------------------------------------------------------- - // both the 'best' and 'next' chi2s correspond to the same drift sign of hit 'i' - // check other two chi2's. If both are an order of magnitude worse than the best, - // assume that for this hit the drift direction is defined - //----------------------------------------------------------------------------- - int drift_dir_defined = 1; - for (int j=0; j<4; j++) { - if ((j != R->ibest) && (j != R->inext)) { - if (R->chi2min/R->chi2[j] > 0.2) { - drift_dir_defined = 0; - break; - } - } - } - - if (drift_dir_defined == 1) { - Hit->setAmbig (_sign[R->ibest][I]); - } - else { - //----------------------------------------------------------------------------- - // all 4 chi2s are "of the same order", nothing to fish - //----------------------------------------------------------------------------- - Hit->setAmbig (0 ); - Hit->setPenalty(perr); - } - } - else { - //----------------------------------------------------------------------------- - // the best and the next solutions correspond to different drift directions - // of this hit. Can't choose, assign large error - //----------------------------------------------------------------------------- - Hit->setAmbig (0 ); - Hit->setPenalty(perr); - } - } - - - //-------------------------------------------------------------------------------- - // given a multiplet, resolve ambiguities for a doublet made out of hits - // 'Index0' and 'Index1' - //-------------------------------------------------------------------------------- - void DoubletAmbigResolver::markDoublet(KalRep* KRep , - Doublet* HitDoublet, - int Index0 , - int Index1 ) const { - mu2e::TrkStrawHit *hit [2]; - Hep3Vector wdir; - int os; - // use to pass working data - Data_t r; - //----------------------------------------------------------------------------- - // calculate doublet parameters - //----------------------------------------------------------------------------- - r.index[0] = Index0; - r.index[1] = Index1; - - int rc = calculateDoubletParameters(KRep,HitDoublet,&r); - if (rc < 0) { - //----------------------------------------------------------------------------- - // an error detected, bail out - //----------------------------------------------------------------------------- - HitDoublet->fHit[Index0]->setAmbig(0); - HitDoublet->fHit[Index0]->setPenalty(1.e5); - HitDoublet->fHit[Index1]->setAmbig(0); - HitDoublet->fHit[Index1]->setPenalty(1.e5); - return; - } - //----------------------------------------------------------------------------- - // create an array with the straw hit indices within a multiplet - //----------------------------------------------------------------------------- - wdir = HitDoublet->fShDir; - //----------------------------------------------------------------------------- - // set best solutions - //----------------------------------------------------------------------------- - os = _sign[r.ibest][0]+_sign[r.ibest][1]; - - for (int i=0; i<2; i++) { - hit[i] = HitDoublet->fHit[r.index[i]]; - //----------------------------------------------------------------------------- - // os = 0: an opposite sign doublet - // update the straw hit info inside the doublet, however don't rush - // to resolve the hit sign ambiguities, do it only when completely sure - // this code is executed after the standard HitAmbigResolver, so when not sure, - // do nothing and default to HitAmbigResolver - //----------------------------------------------------------------------------- - if (os == 0) { - if (r.chi2min < _maxDoubletChi2) { - // if (fabs(r.rdrift[0]+r.rdrift[1]) > 0.8) { - //----------------------------------------------------------------------------- - // OS doublet reliably resolved, reduce the error - //----------------------------------------------------------------------------- - if (r.rdrift[i] > _minDriftDoublet) { - //----------------------------------------------------------------------------- - // the hit drift radius is large - reduce the external error (no penalty in this case) - //----------------------------------------------------------------------------- - hit[i]->setAmbig(_sign[r.ibest][i]); - hit[i]->setPenalty(0); - } - else { - //----------------------------------------------------------------------------- - // small drift radius : unless forced, keep the external error large and set - // the ambiguity to zero to use the wire coordinate - //----------------------------------------------------------------------------- - if (_Final == 0) { - hit[i]->setAmbig(0); - if (_useMeanResidual) hit[i]->setPenalty(_meanResidual); - else hit[i]->setPenalty(r.rdrift[i]); - } - else { - hit[i]->setAmbig(_sign[r.ibest][i]); - } - } - // } - } - else { - //----------------------------------------------------------------------------- - // the chi2 is large, consider hits individually: - // however, the chi2 may be large because of one of the hit times being misreconstructed, - // while the other hit drift sign still could be reconstructed - //----------------------------------------------------------------------------- - if (_Final == 0) { - defineHitDriftSign(hit[i],i,&r); - } - else { - //----------------------------------------------------------------------------- - // making final decision - //----------------------------------------------------------------------------- - double xr = r.doca[r.ibest][i]/hit[i]->totalErr(); - if (fabs(xr) > 5.) { - //----------------------------------------------------------------------------- - // hit is very far (more than by 5 "sigma"), reject it - //----------------------------------------------------------------------------- - hit[i]->setActivity(false); - } - else { - //----------------------------------------------------------------------------- - // make the best choice possible, external error should be zero at this point - //----------------------------------------------------------------------------- - hit[i]->setPenalty(0); - hit[i]->setAmbig (_sign[r.ibest][i]); - } - } - } - } - else { - //----------------------------------------------------------------------------- - // SS doublet - //----------------------------------------------------------------------------- - if (fabs(r.rdrift[0]-r.rdrift[1]) < _deltaDriftDoublet) { - //----------------------------------------------------------------------------- - // the hardest case - close drift radii - //----------------------------------------------------------------------------- - if (r.chi2min < _maxDoubletChi2) { - if (r.chi2min/r.chi2next < _minChi2Ratio) { // 0.3 - //----------------------------------------------------------------------------- - // however, the best chi2 is good enough to be reliable under any circumstances - //----------------------------------------------------------------------------- - hit[i]->setPenalty(0); - hit[i]->setAmbig (_sign[r.ibest][i]); - } - else { - //----------------------------------------------------------------------------- - // the best chi2 is good, but the next one is also close - try to postpone - // the decision point - //----------------------------------------------------------------------------- - if (_Final == 0) { - defineHitDriftSign(hit[i],i,&r); - } - else { - //----------------------------------------------------------------------------- - // ... but finally decide - //----------------------------------------------------------------------------- - hit[i]->setPenalty(0); - hit[i]->setAmbig (_sign[r.ibest][i]); - } - } - } - else { - //----------------------------------------------------------------------------- - // SS doublet with close radii; - // chi2 doesn't allow to identify the best solution unambiguously, - // postpone decision for as long as possible - //----------------------------------------------------------------------------- - if (_Final == 0) { - //----------------------------------------------------------------------------- - // don't have to make a decision, scale of uncertainty is defined by the radius - //----------------------------------------------------------------------------- - if (_useMeanResidual) hit[i]->setPenalty(_meanResidual); - else hit[i]->setPenalty(fabs(r.rdrift[i])); - hit[i]->setAmbig(0); - } - else { - //----------------------------------------------------------------------------- - // need to make final decision: consider 400 um a limit - //----------------------------------------------------------------------------- - if (fabs(r.doca[r.ibest][i]) < 0.4) { - hit[i]->setAmbig (_sign[r.ibest][i]); - hit[i]->setPenalty(0); - } - else { - hit[i]->setAmbig(0); - if (_useMeanResidual) hit[i]->setPenalty(_meanResidual); - else hit[i]->setPenalty(fabs(r.rdrift[i])/sqrt(3.)); - } - } - } - } - else { - //----------------------------------------------------------------------------- - // SS doublet, the two radii are different - //----------------------------------------------------------------------------- - if (r.chi2min < _maxDoubletChi2) { - //----------------------------------------------------------------------------- - // the best chi2 is good, the doublet drift signs are determined reliably - //----------------------------------------------------------------------------- - if (r.chi2min/r.chi2next < _minChi2Ratio) { - if (r.rdrift[i] > _minDriftDoublet) { - hit[i]->setPenalty(0); - hit[i]->setAmbig (_sign[r.ibest][i]); - } - else { - //----------------------------------------------------------------------------- - // small radius (rdrift[i] < _minDriftDoublet) - use the wire position - // 2015-04-15 P.Murat: for well-resolved doublets it may be possible to decide - // in all cases - need to check - //----------------------------------------------------------------------------- - if (_useMeanResidual) hit[i]->setPenalty(_meanResidual); - else hit[i]->setPenalty(AmbigResolver::_tmpErr/2/sqrt(3)); - hit[i]->setAmbig (_sign[r.ibest][i]); - } - } - else { - //----------------------------------------------------------------------------- - // the best and the next chi2's are close - //----------------------------------------------------------------------------- - if (_Final == 0) { - //----------------------------------------------------------------------------- - // postpone the decision for as long as possible - //----------------------------------------------------------------------------- - defineHitDriftSign(hit[i],i,&r); - } - else { - //----------------------------------------------------------------------------- - // final decision - //----------------------------------------------------------------------------- - hit[i]->setPenalty(0); - hit[i]->setAmbig (_sign[r.ibest][i]); - } - } - } - else { - //----------------------------------------------------------------------------- - // the best doublet chi2 is large - cant believe anything, need to treat hits as - // separate ones - this is to be implemented yet - // a good example - one of the hits - on Dave's no-gaussial tail - //----------------------------------------------------------------------------- - if (_Final == 0) { - defineHitDriftSign(hit[i],i,&r); - } - else { - //----------------------------------------------------------------------------- - // _Final = 1: make final decision - forget about 'ibest' - doublet is not good, - // look at all residuals for this hit - //----------------------------------------------------------------------------- - int best_dd = -1; - double max_res = 1.e6; - - for (int dd=0; dd<4; dd++) { - if (fabs(r.doca[dd][i]) < max_res) { - max_res = fabs(r.doca[dd][i]); - best_dd = dd; - } - } - - double herr = hit[i]->totalErr(); - if (max_res/herr < 4) { - hit[i]->setPenalty(0); - hit[i]->setAmbig (_sign[best_dd][i]); - } - else { - if (_useMeanResidual) hit[i]->setPenalty(_meanResidual); - else hit[i]->setPenalty(fabs(r.rdrift[i])); - - hit[i]->setAmbig(0); - // hit residual is large - try to disable? - hit[i]->setActivity(false); - } - } - } - } - } - } - - if (_debugLevel > 0) { - for (int i=0; i<2; i++) { - printf(" %2i %5i %2i %2i %2i %2i %8.3f %8.3f %9.3f %6.3f", - i, r.straw[i]->id().asUint16(), - HitDoublet->fStationId, HitDoublet->fPanelId, - r.straw[i]->id().getLayer(), - r.straw[i]->id().getStraw(), - r.spos[i].x(), r.spos[i].y(), r.spos[i].z(), - wdir.y() - ); - printf(" %6.3f %8.3f %8.3f %9.3f %8.3f %9.3f %8.3f %6.3f", - HitDoublet->fTrkDxDz, - r.tpos[i].x(),r.tpos[i].y(),r.tpos[i].z(), - r.sposr[i].x(),r.tposr[i].x(),r.doca[r.ibest][i],r.rdrift[i] - ); - printf(" %2i %7.3f %8.3f %8.2e %7.3f %8.3f %8.2e %7.3f %8.3f %8.2e %7.3f %8.3f %8.2e\n", - _sign[r.ibest][i], - r.lineSlopes[0], r.doca[0][i], r.chi2[0], - r.lineSlopes[1], r.doca[1][i], r.chi2[1], - r.lineSlopes[2], r.doca[2][i], r.chi2[2], - r.lineSlopes[3], r.doca[3][i], r.chi2[3] - ); - } - } - } - - - //--------------------------------------------------------------------------- - // loop over the doublets found and mark their ambiguities - //--------------------------------------------------------------------------- - void DoubletAmbigResolver::markMultiplets (KalRep* Krep, std::vector* dcol ) const { - - mu2e::TrkStrawHit *hit, *hitj, *hitk, *hmax; - mu2e::Straw straw; - Doublet *doublet; - int ndoublets, ndhits; - - ndoublets = dcol->size(); - - if (_debugLevel > 0) { - printf("[DoubletAmbigResolver::markMultiplets] BEGIN _iter:%i\n",_iter); - printf("------------------------------------------------------"); - printf("----------------------------------------------------------------------------------------"); - printf("------------------------------------------------------------------------------------------\n"); - printf(" i shId pl pn il is x y z "); - printf(" w_ny tdxdz xtrk ytrk ztrk xr xtrkr doca rdr am "); - printf(" s++ doca++ chi2++ s+- doca+- chi2+- s-- doca-- chi2-- s-+ doca-+ chi2-+\n"); - printf("------------------------------------------------------"); - printf("----------------------------------------------------------------------------------------"); - printf("------------------------------------------------------------------------------------------\n"); - } - - for (int i=0; iat(i); - ndhits = doublet->fNStrawHits; - - if (ndhits == 1) { - //----------------------------------------------------------------------------- - // a single hit in the plane - keep its external error large, unless the drift sign - // can be determined reliably - //----------------------------------------------------------------------------- - hit = doublet->fHit[0]; - - resolveSingleHit(Krep,hit); - } - else if (ndhits == 2) { - //----------------------------------------------------------------------------- - // 2 hits in a panel - attempt to determine the drift signs - //----------------------------------------------------------------------------- - markDoublet(Krep,doublet,0,1); - } - else { - //----------------------------------------------------------------------------- - // more than 2 hits in a panel - //----------------------------------------------------------------------------- - int jbest(-1), kbest(-1) ; // imax; // tmpLayerId, layer0, layer1, - int nd; // tmpId(-1), id0(-1), id1(-1) - double rdrift, chi2_d, chi2_best (1.e12); - Doublet bd, ad, *d; - vector list; - - for (int j=0; jfHit[jbest]; - hitk = doublet->fHit[kbest]; - //----------------------------------------------------------------------------- - // out of the two hits making the best doublet, select the one with the larger - // radius - //----------------------------------------------------------------------------- - if (hitj->driftRadius() > hitk->driftRadius()) hmax = hitj; - else hmax = hitk; - - // loop over hits, assign drift signs - for (int ih=0; ihfHit[ih]; - - if (ih == jbest) { - hit->setAmbig(_sign[bd.fIBest][0]); - } - else if (ih == kbest) { - hit->setAmbig(_sign[bd.fIBest][1]); - } - else { - //----------------------------------------------------------------------------- - // look for the doublet containing 'hit' and 'hmax' - //----------------------------------------------------------------------------- - nd = list.size(); - for (int i=0; ifHit[d->fHitIndex[0]]) { - if (hmax == d->fHit[d->fHitIndex[1]]) { - doublet->fStrawAmbig[ih] = _sign[d->fIBest][0]; - break; - } - } - else if (hit == d->fHit[d->fHitIndex[1]]) { - if (hmax == d->fHit[d->fHitIndex[0]]) { - doublet->fStrawAmbig[ih] = _sign[d->fIBest][1]; - break; - } - } - } - //----------------------------------------------------------------------------- - // if the hit radius is greated than some minimal value, set the drift sign - //----------------------------------------------------------------------------- - rdrift = hit->driftRadius(); - - if ( fabs(rdrift) > _minDriftDoublet){ - hit->setAmbig(doublet->fStrawAmbig[ih]); - } - else { - if (_Final == 0) { - hit->setAmbig(0); - if (_useMeanResidual) hit->setPenalty(_meanResidual); - else hit->setPenalty(fabs(rdrift)); - } - else { - //----------------------------------------------------------------------------- - // final decision - //----------------------------------------------------------------------------- - hit->setAmbig(doublet->fStrawAmbig[ih]); - } - } - } - } - } - } - } - } - - //----------------------------------------------------------------------------- - // in the beginning of iteration set external hit errors to a constant - //----------------------------------------------------------------------------- - // void AmbigResolver::initHitErrors(KalRep* krep) const { - // // get hits and cast to TrkStrawHits - // TrkStrawHitVector tshv; - // convert(krep->hitVector(),tshv); - // for (auto itsh=tshv.begin();itsh!=tshv.end(); ++itsh){ - // (*itsh)->setTemperature(_tmpErr); - // } - // } - - //----------------------------------------------------------------------------- - // in the beginning of iteration set external hit errors to a constant - // also calculate mean residual over the trajectory - //----------------------------------------------------------------------------- - void DoubletAmbigResolver::initHitErrors(KalRep* krep) const { - double res, sigres, sr2(0); - int na(0); - - // get hits and cast to TrkStrawHits - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - // mark uninitialized; - - double penalty = _tmpErr*0.0625*_penaltyScale; - - for (auto itsh=tshv.begin();itsh!=tshv.end(); ++itsh) { - (*itsh)->setPenalty (penalty); - (*itsh)->setTemperature(_tmpErr*_tempScale); - if ((*itsh)->isActive()) { - bool hasres = (*itsh)->resid(res, sigres, true); - if (hasres) { - sr2 += res*res; - na += 1; - } - } - } - //----------------------------------------------------------------------------- - // 10 is a random number with the meaning of "more than one hit" - //----------------------------------------------------------------------------- - DoubletAmbigResolver* dar = (DoubletAmbigResolver*) this; - - if (na > 10) dar->_meanResidual = min(sqrt(sr2/na),_maxMeanResidual); - else dar->_meanResidual = _maxMeanResidual; // mm - } - - //----------------------------------------------------------------------------- - // build list of doublets and resolve the drift signs - //----------------------------------------------------------------------------- - bool DoubletAmbigResolver::resolveTrk(KalRep* KRep) const { - - // initialize external hit errors - initHitErrors(KRep); - vector listOfDoublets; - findDoublets (KRep,&listOfDoublets); - - if (listOfDoublets.size() > 0) markMultiplets(KRep, &listOfDoublets); - - return false; // assume no change FIXME!!! - } - - //----------------------------------------------------------------------------- - double DoubletAmbigResolver::penaltyError(double rdrift) const { - static double sqrt2 = sqrt(2.0); - - // model is of an exponential plus a linear. - double frac = _expnorm*exp(-rdrift/_lambda)/_lambda + _offset + _slope*rdrift; - //----------------------------------------------------------------------------- - // the penalty term for a discrete ambiguity error depends only on the - // mis-assignment probability and the drift distance - //----------------------------------------------------------------------------- - double perr = sqrt2*rdrift*sqrt(frac); - return perr; - } -} -*/ diff --git a/TrkReco/src/FixedAmbigResolver.cc b/TrkReco/src/FixedAmbigResolver.cc deleted file mode 100644 index ce89fd7a13..0000000000 --- a/TrkReco/src/FixedAmbigResolver.cc +++ /dev/null @@ -1,34 +0,0 @@ -// -// class to resolve hit ambiguities one hit at a time, assuming a reasonable track -// fit as input -// -// -#include "Offline/TrkReco/inc/FixedAmbigResolver.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - -namespace mu2e { - - FixedAmbigResolver::FixedAmbigResolver(fhicl::ParameterSet const& pset , double tmpErr) : - AmbigResolver(tmpErr), - _neutralize(pset.get("Neutralize",true)) - {} - - FixedAmbigResolver::~FixedAmbigResolver() {} - - bool - FixedAmbigResolver::resolveTrk(KalRep* krep) const { - - // init hit errors - initHitErrors(krep); - - // loop over all the hits - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - for (auto itsh=tshv.begin();itsh!=tshv.end(); ++itsh){ - // set external error and don't allow the hit to auto-update its ambiguity - if(_neutralize) (*itsh)->setAmbig(0); - } - return true; - } -} diff --git a/TrkReco/src/HitAmbigResolver.cc b/TrkReco/src/HitAmbigResolver.cc deleted file mode 100644 index 700f45355b..0000000000 --- a/TrkReco/src/HitAmbigResolver.cc +++ /dev/null @@ -1,87 +0,0 @@ -// -// class to resolve hit ambiguities one hit at a time, assuming a reasonable track -// fit as input -// -// -#include "Offline/TrkReco/inc/HitAmbigResolver.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalSite.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include -#include -#include -#include - -namespace mu2e { - typedef std::vector::iterator TSHI; - - HitAmbigResolver::HitAmbigResolver(fhicl::ParameterSet const& pset, double tmpErr) : - AmbigResolver(tmpErr), - _mindrift(pset.get("HitMinDrift",0.1)), - _zeropenalty(pset.get("ZeroDriftPenalty",0.05)), - _penalty(pset.get("HitAmbigPenalty",false)), - _expnorm(pset.get("HitExpNorm",0.03907)), - _lambda(pset.get("HitLambda",0.1254)), - _offset(pset.get("HitOffset",0.073)), - _slope(pset.get("HitSlope",-0.002374)), - _debug(pset.get("debugLevel",0)) - {} - - HitAmbigResolver::~HitAmbigResolver() {} - - bool - HitAmbigResolver::resolveTrk(KalRep* krep) const { - bool retval(false); // assume no change - initHitErrors(krep); - - // loop over all the hits - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - for (auto itsh=tshv.begin();itsh!=tshv.end(); ++itsh){ - // get the drift radius - double rdrift = (*itsh)->driftRadius(); - if(rdrift <= _mindrift){ - (*itsh)->setAmbig(0); - (*itsh)->setPenalty(_zeropenalty); - } else { - // find the best trajectory we can local to these hits, but excluding their information ( if possible). - std::vector hits; - hits.push_back(*itsh); - const TrkDifTraj* traj = findTraj(hits,krep); - // compute POCA to this traj - TrkPoca poca(*traj,(*itsh)->fltLen(),*(*itsh)->hitTraj(),(*itsh)->hitLen()); - if(poca.status().success()){ - // set the ambiguity if allowed, based on the sign of DOCA - int newamb = poca.doca() > 0 ? 1 : -1; - if(_debug > 1) - std::cout << "hit " << (*itsh)->index() << " active " << (*itsh)->isActive() << " old ambig " <<(*itsh)->ambig() << " new ambig " << newamb << std::endl; - - retval |= newamb == (*itsh)->ambig(); - (*itsh)->setAmbig(newamb); - // based on the drift distance, set the penalty error based on the a-priori function. - if(_penalty){ - double perr = penaltyError((*itsh)->driftRadius()); - retval |= (*itsh)->penaltyErr() == perr; - (*itsh)->setPenalty(perr); - } - } else { - if(_debug > 0)std::cout << "POCA failure hit " << (*itsh)->index() << " being disabled" << std::endl; - (*itsh)->setActivity(false); - } - } - } - return retval; - } - - double - HitAmbigResolver::penaltyError(double rdrift) const { - // model is of an exponential plus a linear. - double frac = _expnorm*exp(-rdrift/_lambda)/_lambda + _offset + _slope*rdrift; - // the penalty term for a discrete ambiguity error depends only on the mis-assignment probability and the drift distance - static double sqrt2 = sqrt(2.0); - double perr = sqrt2*rdrift*sqrt(frac); - return perr; - } -} diff --git a/TrkReco/src/KalFit.cc b/TrkReco/src/KalFit.cc deleted file mode 100644 index 516129c01a..0000000000 --- a/TrkReco/src/KalFit.cc +++ /dev/null @@ -1,1196 +0,0 @@ -// -// Class to perform BaBar Kalman fit -// Original author: Dave Brown LBNL 2012 -// -// -/* -#include "Offline/TrkReco/inc/KalFit.hh" -#include "Offline/TrkReco/inc/PanelAmbigResolver.hh" -#include "Offline/TrkReco/inc/HitAmbigResolver.hh" -#include "Offline/TrkReco/inc/FixedAmbigResolver.hh" -#include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" -#include "Offline/TrkReco/inc/TrkUtilities.hh" -#include "Offline/Mu2eBTrk/inc/BaBarMu2eField.hh" -//geometry -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/StoppingTargetGeom/inc/StoppingTarget.hh" -#include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -// conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" -// data -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -// tracker -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/TrackerGeom/inc/Straw.hh" -// BaBar -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/KalmanTrack/KalBend.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalMaterial.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/BaBar/ErrLog.hh" -#include "BTrk/BField/BFieldFixed.hh" -#include "BTrk/DetectorModel/DetIntersection.hh" -#include "BTrk/DetectorModel/DetMaterial.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -// boost -#include -#include -#include -#include -#include -#include -//CLHEP -#include "CLHEP/Vector/ThreeVector.h" -// C++ -#include -#include -#include -#include -#include - -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; -using CLHEP::HepSymMatrix; - -namespace mu2e -{ - // comparison functor for ordering hits. This should operate on TrkHit, FIXME! - struct fcomp { - bool operator()(TrkHit* x, TrkHit* y) { - return x->fltLen() < y->fltLen(); - } - }; - - // struct for finding materials - struct StrawFlight { - StrawId _id; // straw being tested - double _flt; // flight where trajectory comes near this straw - // construct from pair - StrawFlight(StrawId strawid, double flt) : _id(strawid), _flt(flt) {} - }; - - // comparison operators understand that the same straw could be hit twice, so the flight lengths need - // to be similar befoew we consider these 'the same' - struct StrawFlightComp { - double _maxdiff; // maximum flight difference; below this, consider 2 intersections 'the same' - StrawFlightComp(double maxdiff) : _maxdiff(maxdiff) {} - bool operator () (StrawFlight const& a, StrawFlight const& b) const { return a._id < b._id || - ( a._id == b._id && a._flt < b._flt && fabs(a._flt-b._flt)>=_maxdiff);} - }; - - // construct from a parameter set - KalFit::KalFit(fhicl::ParameterSet const& pset) : - // KalFit parameters - _debug(pset.get("debugLevel",0)), - _maxhitchi(pset.get("maxhitchi",3.5)), - _maxpull(pset.get("maxPull",5)), - _maxweed(pset.get("maxweed",10)), - _maxweedtch(pset.get("maxweedtch",1)), - // t0 parameters - _useTrkCaloHit(pset.get("useTrkCaloHit")), - _nCaloExtrapolSteps(pset.get("nCaloExtrapolSteps", 100)), - _caloHitErr(pset.get("caloHitError")), - _updatet0(pset.get>("updateT0")), - _t0tol(pset.get< vector >("t0Tolerance")), - _t0errfac(pset.get("t0ErrorFactor",1.2)), - _t0nsig(pset.get("t0window",2.5)), - _mindocatch(pset.get("mindocatch",-50.)), - _maxdocatch(pset.get("maxdocatch", 50.)), - _mindepthtch(pset.get("mindepthtch",-50.)), - _maxdepthtch(pset.get("maxdepthtch",250.)), - _maxtchdt(pset.get("maxtchdt", 5.)),//ns - _mintchenergy(pset.get("mintchEnergy", 10.)),//MeV - _mintchtrkpath(pset.get("mintchTrkPath", 1.)),//mm - _strHitW(pset.get("strawHitT0Weight")), - _calHitW(pset.get("caloHitT0Weight")), - // - _minnstraws(pset.get("minnstraws",15)), - _maxmatfltdiff(pset.get("MaximumMaterialFlightDifference",1000.0)), // mm separation in flightlength - _weedhits(pset.get >("weedhits")), - _herr(pset.get< vector >("hiterr")), - _ambigstrategy(pset.get< vector >("ambiguityStrategy")), - _addmaterial(pset.get >("AddMaterial")), - _resolveAfterWeeding(pset.get("ResolveAfterWeeding",false)), - _exup((extent)pset.get("UpstreamExtent",noextension)), - _exdown((extent)pset.get("DownstreamExtent",noextension)), - _ttcalc (pset.get("T0Calculator",fhicl::ParameterSet())), - _bfield(0) - { - // set KalContext parameters - _disttol = pset.get("IterationTolerance",0.1); - _intertol = pset.get("IntersectionTolerance",100.0); - _maxiter = pset.get("MaxIterations",10); - _maxinter = pset.get("MaxIntersections",0); - _matcorr = pset.get("materialCorrection",true); - _fieldcorr = pset.get("fieldCorrection",false); - _smearfactor = pset.get("SeedSmear",1.0e6); - _sitethresh = pset.get("SiteMomThreshold",0.2); - _momthresh = pset.get("MomThreshold",10.0); - _mingap = pset.get("mingap",1.0); - _minfltlen = pset.get("MinFltLen",0.1); - _minmom = pset.get("MinMom",10.0); - _fltepsilon = pset.get("FltEpsilon",0.001); - _divergeflt = pset.get("DivergeFlt",1.0e3); - _mindot = pset.get("MinDot",0.0); - _maxmomdiff = pset.get("MaxMomDiff",0.5); - _momfac = pset.get("MomFactor",0.0); - _maxpardif[0] = _maxpardif[1] = pset.get("MaxParameterDifference",1.0); - - _mindof = pset.get("MinNDOF",10); - - _printUtils = new TrkPrintUtils(pset.get("printUtils",fhicl::ParameterSet())); - - // this config belongs in the BField integrator, FIXME!!! - _bintconfig._maxRange = pset.get("BFieldIntMaxRange",1.0e5); // 100 m - _bintconfig._intTolerance = pset.get("BFieldIntTol",0.01); // 10 KeV - _bintconfig._intPathMin = pset.get("BFieldIntMin",20.0); // 20 mm - _bintconfig._divTolerance = pset.get("BFieldIntDivTol",0.05); // 50 KeV - _bintconfig._divPathMin = pset.get("BFieldIntDivMin",50.0); // 50 mm - _bintconfig._divStepCeiling = pset.get("BFieldIntDivMax",500.0); // 500 mm - // field integral errors. This is commented out as it hasn't been shown to improve the fit - // double perr = pset.get("BendCorrErrFrac",0.0); // fractional accuracy of trajectory - // double berr = pset.get("BFieldMapErr",0.0); // mapping and interpolation error - // KalBend::setErrors(perr,berr); - // make sure we have at least one entry for additional errors - if(_herr.size() <= 0) throw cet::exception("RECO")<<"mu2e::KalFit: no hit errors specified" << endl; - if(_herr.size() != _ambigstrategy.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution hiterr" << endl; - if(_herr.size() != _t0tol.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution t0" << endl; - if(_herr.size() != _weedhits.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution WeedHits" << endl; - if(_herr.size() != _addmaterial.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution AddMaterial" << endl; - // Search for explicit resolver parameter sets. These may not be used - fhicl::ParameterSet const& fixedPset = pset.get("FixedAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& hitPset = pset.get("HitAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& panelPset = pset.get("PanelAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& pocaPset = pset.get("POCAAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& doubletPset = pset.get("DoubletAmbigResolver",fhicl::ParameterSet()); - // construct the explicit ambiguity resolvers, 1 instance per iteration - size_t niter = _ambigstrategy.size(); - for(size_t iter=0; iter ch; - - _nCaloDisks = ch->nDisks(); - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - for (unsigned i=0; i<_nCaloDisks; ++i){ - CLHEP::Hep3Vector pos(ch->disk(i).geomInfo().frontFaceCenter()); - pos = ch->geomUtil().mu2eToTracker(pos); - - _zmincalo[i] = (pos.z()); - _zmaxcalo[i] = (pos.z()+crystalLength); - _rmincalo[i] = (ch->disk(i).geomInfo().innerEnvelopeR()); - _rmaxcalo[i] = (ch->disk(i).geomInfo().outerEnvelopeR()); - } - } - - - //----------------------------------------------------------------------------- - // create the track (KalRep) from a track seed - //----------------------------------------------------------------------------- - void KalFit::makeTrack(StrawResponse::cptr_t srep, - Mu2eDetector::cptr_t detmodel, - KalFitData& kalData){ - - // test if fitable - if(fitable(*kalData.kalSeed)){ - // find the segment at the 0 flight - double flt0 = kalData.kalSeed->flt0(); - auto kseg = kalData.kalSeed->nearestSegmentFlt(flt0); - if(kseg->fmin() > kseg->localFlt(flt0) || - kseg->fmax() < kseg->localFlt(flt0) ){ - std::cout << "FitType: "<< kalData.fitType<<", number 0f segments = "<segments().size() - <<", Helix segment range doesn't cover flt0 = " << flt0 << std::endl; - } - // create a trajectory from the seed. This shoudl be a general utility function that - // can work with multi-segment seeds FIXME! - // create CLHEP objects from seed native members. This will - // go away when we switch to SMatrix FIXME!!! - HepVector pvec(5,0); - HepSymMatrix pcov(5,0); - kseg->helix().hepVector(pvec); - kseg->covar().symMatrix(pcov); - // Create the traj from these - HelixTraj htraj(pvec,pcov); - kalData.helixTraj = &htraj; - // create the hits - TrkStrawHitVector tshv; - makeTrkStrawHits(srep,kalData, tshv); - - // Find the wall and gas material description objects for these hits - std::vector detinter; - if(_matcorr)makeMaterials(detmodel, tshv,*kalData.helixTraj,detinter); - // Create the BaBar hit list, and fill it with these hits. The BaBar list takes ownership - // We should use the TrkHit vector everywhere, FIXME! - std::vector thv(0); - for(auto ihit = tshv.begin(); ihit != tshv.end(); ++ihit){ - thv.push_back(*ihit); - if (_debug>2) { (*ihit)->print(std::cout); } - } - if (_useTrkCaloHit){ //use the TrkCaloHit to initialize the t0? - //create the TrkCaloHit - TrkCaloHit* tch(0); - makeTrkCaloHit(kalData, tch); - if (tch != 0) thv.push_back(tch); - } - - TrkT0 t0(kalData.kalSeed->t0()); - // create Kalman rep - kalData.krep = new KalRep(htraj, thv, detinter, *this, TrkParticle(TrkParticle::type(kalData.kalSeed->particle())), t0, flt0); - assert(kalData.krep != 0); - - if (_debug > 0) { - char msg[100]; - sprintf(msg,"makeTrack_001 annealing step: %2i",_annealingStep); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - - // initialize history list - kalData.krep->addHistory(TrkErrCode(),"KalFit creation"); - // now fit - TrkErrCode fitstat = fitTrack(detmodel,kalData); - kalData.krep->addHistory(fitstat,"KalFit fit"); - // extend the fit - if(fitstat.success()){ - fitstat = extendFit(kalData.krep); - kalData.krep->addHistory(fitstat,"KalFit extension"); - } - } - } - - void KalFit::addHits(StrawResponse::cptr_t srep, Mu2eDetector::cptr_t detmodel, - KalFitData&kalData, double maxchi) { - //2017-05-02: Gianipez. In this function inten - // there must be a valid Kalman fit to add hits to - KalRep* krep = kalData.krep; - - if(kalData.krep != 0 && kalData.missingHits.size() > 0 && krep->fitStatus().success()){ - TrkHitVector::iterator ihigh; - TrkHitVector::reverse_iterator ilow; - // use the reference trajectory, as that's what all the existing hits do - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - for(unsigned iind=0;iindat(istraw)); - const Straw& straw = _tracker->getStraw(strawhit.strawId()); - // estimate initial flightlength - double hflt(0.0); - TrkHelixUtils::findZFltlen(*reftraj,straw.getMidPoint().z(),hflt); - // find the bounding sites near this hit, and extrapolate to get the hit t0 - findBoundingHits(krep,hflt,ilow,ihigh); - const TrkHit* nearhit; - if(ihigh != krep->hitVector().end()) - nearhit = *ihigh; - else - nearhit = *ilow; - - //can I just do krep_hitt0()???; this whole block (next 5 lines of code) will disappear! - HitT0 hitt0 = krep_hitT0(krep, nearhit);//nearhit->hitT0(); - double mom = krep->momentum(nearhit->fltLen()).mag(); - double beta = krep->particleType().beta(mom); - double tflt = (hflt-nearhit->fltLen())/(beta*CLHEP::c_light); - // update the time in the HitT0 object - hitt0._t0 += tflt; - // create the hit object. Assume we're at the last iteration over added error - TrkStrawHit* trkhit = new TrkStrawHit(srep,strawhit,*_tracker,istraw,hitt0,hflt, - _maxpull,_strHitW ); - assert(trkhit != 0); - trkhit->setTemperature(_herr.back()); // give this hit the final annealing temperature - trkhit->setFlag(TrkHit::addedHit); - // guess the ambiguity form the sign of the doca - int iambig; - if (kalData.missingHits[iind].doca > 0) iambig = 1; - else iambig = -1; - // can set ambiguity only for deactivated hit - trkhit->setActivity(false); - trkhit->setAmbig(iambig); - // must be initialy active for KalRep to process correctly - trkhit->setActivity(true); - // set the hit ambiguity. This is a preliminary value before using the official ambig resolver - TrkPoca poca(krep->traj(),hflt,*trkhit->hitTraj(),0.0); - int newamb = poca.doca() > 0 ? 1 : -1; - trkhit->setAmbig(newamb); - // add the hit to the track - krep->addHit(trkhit); - // check the raw residual: This call works because the HOT isn't yet processed as part of the fit. - double chi = fabs(trkhit->residual()/trkhit->hitRms()); - //if it's outside limits, deactivate the HOT - if(chi > maxchi || (!trkhit->isPhysical(maxchi))) - trkhit->setActivity(false); - // find the DetElem associated this straw - const DetStrawElem* strawelem = detmodel->strawElem(trkhit->straw()); - // see if this KalRep already has a KalMaterial with this element: if not, add it - bool hasmat(false); - std::vector kmats; - krep->findMaterialSites(strawelem,kmats); - // if this is a reflecting track the same material can appear multiple times: check the flight lengths - if(kmats.size() > 0){ - for(auto kmat: kmats) { - if( fabs( kmat->globalLength() - trkhit->fltLen()) < _maxmatfltdiff){ - hasmat = true; - break; - } - } - } - if(!hasmat){ - // create intersection object for this element; it includes all materials - DetIntersection strawinter(strawelem, krep->referenceTraj(),trkhit->fltLen()); - strawinter.thit = trkhit; - // compute initial intersection: this gets updated each fit iteration - strawelem->reIntersect(krep->referenceTraj(),strawinter); - krep->addInter(strawinter); - } - } - // refit the last iteration of the track - TrkErrCode fitstat = fitIteration(detmodel,kalData,_herr.size()-1); - krep->addHistory(fitstat,"AddHits"); - } - } - // - TrkErrCode KalFit::fitTrack(Mu2eDetector::cptr_t detmodel, KalFitData&kalData) { - // loop over external hit errors, ambiguity assignment, t0 toleratnce - TrkErrCode fitstat; - for(size_t iherr=0;iherr < _herr.size(); ++iherr) { - fitstat = fitIteration(detmodel,kalData,iherr); - if(_debug > 0) { - cout << "Iteration " << iherr - << " NDOF = " << kalData.krep->nDof() - << " Fit Status = " << fitstat << endl; - - char msg[200]; - sprintf(msg,"KalFit::fitTrack Iteration = %2li success = %i",iherr,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - if(!fitstat.success())break; - } - return fitstat; - } - - //----------------------------------------------------------------------------- - //----------------------------------------------------------------------------- - TrkErrCode KalFit::fitIteration(Mu2eDetector::cptr_t detmodel, - KalFitData&kalData, int iter) { - - if (iter == -1) iter = _herr.size()-1; - _annealingStep = iter;//used in the printHits routine - - // update the external hit errors. This isn't strictly necessary on the 1st iteration. - TrkHitVector* thv = &(kalData.krep->hitVector()); - for (auto itsh=thv->begin();itsh!=thv->end(); ++itsh){ - (*itsh)->setTemperature(_herr[iter]); - } - - // update t0, and propagate it to the hits - double oldt0 = kalData.krep->t0()._t0; - unsigned niter(0); - bool changed(true); - TrkErrCode retval = TrkErrCode::succeed; - - KalRep* krep = kalData.krep; - bool flagMaterialAdded(false); - - while(retval.success() && changed && ++niter < maxIterations()){ - //----------------------------------------------------------------------------- - // convention: resolve drift signs before the fit with respect to the trajectory - // determined at the previous iteration - //----------------------------------------------------------------------------- - changed = _ambigresolver[iter]->resolveTrk(krep); - // force a refit - krep->resetFit(); - retval = krep->fit(); - if(! retval.success())break; - - //2019-04-26: Giani&Dave; we want to do the weeding before the call to ::updateT0 - // drop outliers - if(_weedhits[iter]){ - kalData.nweediter = 0; - changed |= weedHits(kalData,iter); - changed |= unweedBestHit(kalData,_maxhitchi); - } - // updates - if(_updatet0[iter]){ - updateT0(kalData, iter); - changed |= fabs(krep->t0()._t0-oldt0) > _t0tol[iter]; - } - // find missing materials - unsigned nmat(0); - if(_addmaterial[iter]){ - nmat = addMaterial(detmodel,krep); - changed |= nmat>0; - if (!flagMaterialAdded) flagMaterialAdded=true; - } - - if(_debug > 1) std::cout << "Inner iteration " << niter << " changed = " - << changed << " t0 old " << oldt0 << " new " << krep->t0()._t0 - << " nmat = " << nmat << endl; - oldt0 = krep->t0()._t0; - } - if(_debug > 1) - std::cout << "Outer iteration " << iter << " stopped after " - << niter << " iterations" << std::endl; - // make sure the fit is current - if(!krep->fitCurrent()) - retval = krep->fit(); - return retval; - } - - bool - KalFit::fitable(KalSeed const& kseed){ - return kseed.segments().size() > 0 && kseed.hits().size() >= _minnstraws; - } - - void - KalFit::makeTrkStrawHits(StrawResponse::cptr_t srep, - KalFitData& kalData, TrkStrawHitVector& tshv ) { - - std::vectorconst hseeds = kalData.kalSeed->hits(); - HelixTraj const htraj = *kalData.helixTraj; - // compute particle velocity to - for(auto ths : hseeds ){ - // create a TrkStrawHit from this seed. - size_t index = ths.index(); - const ComboHit& strawhit(kalData.chcol->at(index)); - TrkStrawHit* trkhit = new TrkStrawHit(srep,strawhit,*_tracker,ths.index(),ths.t0(),ths.trkLen(), - _maxpull,_strHitW); - assert(trkhit != 0); - // set the initial ambiguity - trkhit->setAmbig(ths.ambig()); - // refine the flightlength, as otherwise hits in the same plane are at exactly the same flt, which can cause problems - TrkErrCode pstat = trkhit->updatePoca(&htraj); - if(pstat.failure()){ - trkhit->setActivity(false); - } - tshv.push_back(trkhit); - } - // sort the hits by flightlength - std::sort(tshv.begin(),tshv.end(),fcomp()); - } - - void - KalFit::makeTrkCaloHit (KalFitData& kalData, TrkCaloHit *&tch){ - art::Ptr const& calo = kalData.kalSeed->caloCluster(); - if (calo.isNonnull()){ - mu2e::GeomHandle ch; - Hep3Vector cog = ch->geomUtil().mu2eToTracker(ch->geomUtil().diskFFToMu2e( calo->diskID(), calo->cog3Vector())); - if(_debug > 0){ - std::cout << "Cluster COG (disk) " << calo->cog3Vector() << std::endl - << "Cluster COG (Mu2e) " << ch->geomUtil().diskFFToMu2e( calo->diskID(), calo->cog3Vector()) << std::endl - <<" Cluster COG (Det ) " << cog << std::endl; - } - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - // estimate fltlen from pitch; take the last segment - HelixVal const& hval = kalData.kalSeed->segments().back().helix(); - double mom = kalData.kalSeed->segments().back().mom(); - TrkParticle tpart(TrkParticle::type(kalData.kalSeed->particle())); - double beta = tpart.beta(mom); - double td = hval.tanDip(); - double sd = td/sqrt(1.0+td*td); - double fltlen = (cog.z()- hval.z0() + 0.5*crystalLength)/sd;// - kalData.kalSeed->flt0(); - // t0 represents the time the particle reached the sensor; estimate that - HitT0 ht0 = kalData.kalSeed->t0(); // start with the track t0 - double flt0 = kalData.kalSeed->flt0(); - double tflt = (fltlen -flt0)/(beta*CLHEP::c_light); - ht0._t0 += tflt; - ht0._t0err = _ttcalc.caloClusterTimeErr(); - Hep3Vector clusterAxis = Hep3Vector(0, 0, 1);//FIXME! should come from crystal - tch = new TrkCaloHit(*kalData.kalSeed->caloCluster().get(), cog, crystalLength, clusterAxis, ht0, fltlen, _calHitW, _caloHitErr, _ttcalc.caloClusterTimeErr(), _ttcalc.trkToCaloTimeOffset()); - } - } - - - void - KalFit::makeMaterials( Mu2eDetector::cptr_t detmodel, - TrkStrawHitVector const& tshv, HelixTraj const& htraj, - std::vector& detinter) { - // loop over strawhits and extract the straws - for (auto trkhit : tshv) { - // find the DetElem associated this straw - const DetStrawElem* strawelem = detmodel->strawElem(trkhit->straw()); - // create intersection object for this element; it includes all materials - DetIntersection strawinter; - strawinter.delem = strawelem; - strawinter.pathlen = trkhit->fltLen(); - strawinter.thit = trkhit; - // compute initial intersection: this gets updated each fit iteration - strawelem->reIntersect(&htraj,strawinter); - detinter.push_back(strawinter); - } - } - - unsigned KalFit::addMaterial(Mu2eDetector::cptr_t detmodel, KalRep* krep) { - unsigned retval(0); - // Tracker geometry - const Tracker& tracker = *_tracker; - // general properties; these should be computed once/job and stored FIXME! - double strawradius = tracker.strawOuterRadius(); - auto const& frontplane = tracker.planes().front(); - auto const& firstpanel = frontplane.getPanel(0); - auto const& innerstraw = firstpanel.getStraw(0); - auto const& outerstraw = firstpanel.getStraw(StrawId::_nstraws-1); - // compute limits: add some buffer for the finite size of the straw - auto DStoP = firstpanel.dsToPanel(); - auto innerstraw_origin = DStoP*innerstraw.origin(); - auto outerstraw_origin = DStoP*outerstraw.origin(); - double ymin = innerstraw_origin.y() - strawradius; - double ymax = outerstraw_origin.y() + strawradius; - double umax = innerstraw.halfLength() + strawradius; - // use the outermost straw end to set the max hit radius - double rmax = outerstraw.wireEnd(StrawEnd::cal).mag() + strawradius; - double spitch = (StrawId::_nstraws-1)/(ymax-ymin); - // storage of potential straws - StrawFlightComp strawcomp(_maxmatfltdiff); - std::set matstraws(strawcomp); - // loop - unsigned nadded(0); - for(auto const& plane : tracker.planes()){ - if(_tracker->planeExists(plane.id())) { - // get an approximate z position for this plane from the average position of the 1st and last straws - auto s0 = plane.origin(); - // find the track position at this z using the reference trajectory - double flt = krep->referenceTraj()->zFlight(s0.z()); - HepPoint pos = krep->referenceTraj()->position(flt); - Hep3Vector posv(pos.x(),pos.y(),pos.z()); - // loop over panels - for(auto panel_p : plane.panels()){ - auto const& panel = *panel_p; - // convert track position into panel coordinates - auto DStoP = panel.dsToPanel(); - auto pposv = DStoP*posv; - // see if this point is roughly in the active region of this panel. Use the z possition as a buffer, to - // account for the test being performed at the plane center. Note the radius cut is made in the Mu2e coordinate system - // this is not a bug! - double pbuff = fabs(pposv.z()); - if(pposv.y() > ymin - pbuff && pposv.y() < ymax + pbuff && fabs(pposv.x()) < umax && posv.perp() < rmax + pbuff) { - if(_debug>2)std::cout << "position " << pposv << " in rough acceptance " << std::endl; - // translate the y position into a rough straw number - int istraw = (int)rint( (pposv.y()-ymin)*spitch); - // take a few straws around this. This value should be configurable FIXME! - for(int is = max(0,istraw-3); is3)std::cout << "Adding Straw " << is << " in panel " << panel.id() << std::endl; - matstraws.insert(StrawFlight(panel.getStraw(is).id(),flt)); - ++nadded; - } - } // acceptance - } // panels - } // plane exists - } // planes - // Now test if the Kalman rep hits these straws - if(_debug>2)std::cout << "Found " << matstraws.size() << " unique possible straws " << " out of " << nadded << std::endl; - unsigned nfound(0); - for(auto const& strawflt : matstraws){ - const DetStrawElem* strawelem = detmodel->strawElem(strawflt._id); - DetIntersection strawinter; - strawinter.delem = strawelem; - strawinter.pathlen = strawflt._flt; - if(strawelem->reIntersect(krep->referenceTraj(),strawinter)){ - // If the rep already has a material site for this element, skip it - std::vector kmats; - krep->findMaterialSites(strawelem,kmats); - if(_debug>2)std::cout << "found intersection with straw " << strawelem->straw()->id() << " with " - << kmats.size() << " materials " << std::endl; - // test material isn't on the track - bool hasmat(false); - for(auto kmat : kmats ){ - const DetStrawElem* kelem = dynamic_cast(kmat->detIntersection().delem); - if(kelem != 0){ - StrawFlight ksflt(kelem->straw()->id(),kmat->globalLength()); - if(_debug>2)std::cout << " comparing flights " << kmat->globalLength() << " and " << strawflt._flt << std::endl; - if(!strawcomp.operator()(strawflt,ksflt)){ - if(_debug>2)std::cout << "operator returned false!!" << std::endl; - // this straw is already on the track: stop - hasmat = true; - nfound++; - break; - } - } - } - if(kmats.size() == 0 || !hasmat) { - if(_debug>2)std::cout << "Adding material element" << std::endl; - // this straw doesn't have an entry in the Kalman fit: add it` - DetIntersection detinter(strawelem, krep->referenceTraj(),strawflt._flt); - krep->addInter(detinter); - ++retval; - } - } - } - if(_debug>1)std::cout << "Added " << retval << " new material sites; found " << nfound << " intersections out of " << krep->nActive() << " active hits " << std::endl; - return retval; - } - - bool - KalFit::weedHits(KalFitData& kalData, int iter) { - // Loop over HoTs and find HoT with largest contribution to chi2. If this value - // is greater than some cut value, deactivate that HoT and reFit - KalRep* krep = kalData.krep; - bool retval(false); - double worst = -1.; - // TrkHit* worsthit = 0; - TrkStrawHit *worsthit = 0; - TrkHitVector *thv = &(krep->hitVector()); - - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - // TrkHit* hit = *ihit; - TrkStrawHit*hit = dynamic_cast(*ihit); - if (hit == 0) continue; - if (hit->isActive()) { - double resid, residErr; - if(hit->resid(resid, residErr, true)){ - double value = fabs(resid/residErr); - if (value > _maxhitchi && value > worst) { - worst = value; - worsthit = hit; - } - } - } - } - - if (iter == -1) iter = _ambigresolver.size()-1; - - if(0 != worsthit){ - retval = true; - worsthit->setActivity(false); - worsthit->setFlag(TrkHit::weededHit); - if (_resolveAfterWeeding) { - //----------------------------------------------------------------------------- - // _resolveAfterWeeding=0 makes changes in the logic fully reversible - //----------------------------------------------------------------------------- - _ambigresolver[iter]->resolveTrk(krep); - } - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitWeed"); - - if (_debug > 0) { - char msg[200]; - sprintf(msg,"KalFit::weedHits Iteration = %2i success = %i",iter,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - - // Recursively iterate - kalData.nweediter++; - if (fitstat.success() && kalData.nweediter < _maxweed) { - retval |= weedHits(kalData,iter); - } - } - return retval; - } - - bool - KalFit::unweedHits(KalFitData& kalData, double maxchi) { - bool retval = unweedBestHit(kalData, maxchi); - // if any hits were added, re-analyze ambiguity - if (retval && _resolveAfterWeeding) { - KalRep* krep = kalData.krep; - // 2015-04-12 P.Murat: '_resolveAfterWeeding' is here to make my changes fully reversible - // I think, resolving ambiguities before each fit, makes a lot of sense - // - // Moved to after iteration: PanelAmbig resolver can change the state of hit resulting in infinte - // loop if the resolver is called each iteration - int last = _herr.size()-1; - _ambigresolver[last]->resolveTrk(krep); - if(!krep->fitCurrent()){ - // if this changed the track state, refit it - krep->resetFit(); - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitUnWeedResolver"); - - if (_debug > 0) { - char msg[200]; - sprintf(msg,"KalFit::unweedHits Iteration = %2i success = %i",last,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - } - } - return retval; - } - - bool - KalFit::unweedBestHit(KalFitData& kalData, double maxchi) { - // Loop over inactive HoTs and find the one with the smallest contribution to chi2. If this value - // is less than some cut value, reactivate that HoT and reFit - KalRep* krep = kalData.krep; - bool retval(false); - double best = 1.e12; - // no need to cast - TrkHit* besthit = 0; - const TrkHitVector* thv = &(krep->hitVector()); - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkHit* hit = *ihit; - if (!hit->isActive()) { - double resid, residErr; - if(hit->resid(resid, residErr, true)){ - double chival = fabs(resid/residErr); - // test both for a good chisquared and for the drift radius to be physical - if (chival < maxchi && hit->isPhysical(maxchi) && chival < best) { - best = chival; - besthit = hit; - } - } - } - } - if(0 != besthit){ - retval = true; - besthit->setActivity(true); - besthit->setFlag(TrkHit::unweededHit); - int oldndof = krep->nDof(); - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitUnWeed"); - if (fitstat.success() && besthit->isActive() && krep->nDof() > oldndof) { - // Recursively iterate - retval |= unweedBestHit(kalData, maxchi); - } - } - return retval; - } - - //-------------------------------------------------------------------------------- - // This function uses the KalRep for searching for the calorimeter disk where - // the track is supposed to impact - //-------------------------------------------------------------------------------- - void - KalFit::findCaloDiskFromTrack(KalFitData& kalData, int& trkToCaloDiskId, double& caloFlt){ - KalRep*krep = kalData.krep; - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - float zExtrapolStep = (_zmaxcalo[0] - _zmincalo[0])/(float)_nCaloExtrapolSteps; - - //initialize the output values - trkToCaloDiskId = -1; - caloFlt = 0; - - float fltIn(0), fltOut(0); - for (unsigned i=0; i<_nCaloDisks; ++i){ - for (unsigned j=0; j<_nCaloExtrapolSteps; ++j){ - double flt(0); - double zCaloExtrap = _zmincalo[i] + j*zExtrapolStep; - TrkHelixUtils::findZFltlen(*reftraj, zCaloExtrap, flt); - HepPoint pos = krep->referenceTraj()->position(flt); - float radius = sqrt(pos.x()*pos.x() + pos.y()*pos.y()); - if ( (radius >= _rmincalo[i]) && (radius <= _rmaxcalo[i])){ - if (trkToCaloDiskId<0) { - trkToCaloDiskId = i; - fltIn = flt; - }else { - fltOut = flt; - } - } - }//end loop over the z-steps - if (trkToCaloDiskId>=0) break; - }//end loop over tghe disks - if (trkToCaloDiskId >= 0) caloFlt = fltOut - fltIn; - } - - - //-------------------------------------------------------------------------------- - // This function loops over the CaloClusterCollection to search for a Cluster - // compatible with the Track. If the Cluster energy was below the threshold, - // no Cluster was added in the TimeClusterFinder module - //-------------------------------------------------------------------------------- - int - KalFit::addTrkCaloHit( Mu2eDetector::cptr_t detmodel, KalFitData& kalData) { - int retval(-1); - //extrapolate the track to the calorimeter region - //to understand on which disk the track is supposed to impact - int trkToCaloDiskId(-1); - double trkInCaloFlt(0); - findCaloDiskFromTrack(kalData, trkToCaloDiskId, trkInCaloFlt); - if (trkToCaloDiskId >= 0 && //the Track doesn't intercept the calorimeter - fabs(trkInCaloFlt) > _mintchtrkpath) { //FIX ME! should we check the second disk in case the track-path in the first is too small? - KalRep* krep = kalData.krep; - double minFOM(1e10); - const CaloCluster*cl(0); - std::unique_ptr tchFinal; - mu2e::GeomHandle ch; - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - - unsigned nClusters = kalData.caloClusterCol->size(); - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - double flt0 = krep->flt0(); - double tflt(0), flt(0); - if (trkToCaloDiskId>=0){ - //evaluate the flight length at the z of the calorimeter cluster + half crystallength - TrkHelixUtils::findZFltlen(*reftraj, (_zmincalo[trkToCaloDiskId]+0.5*crystalLength),flt); - //evaluate the transittime using the full trajectory - tflt = krep->t0()._t0 + krep->transitTime(flt0, flt); - } - - for (unsigned icc=0; iccat(icc); - if (cl->diskID() != trkToCaloDiskId || - cl->energyDep() < _mintchenergy) continue; - // double hflt(0.0); - Hep3Vector cog = ch->geomUtil().mu2eToTracker(ch->geomUtil().diskFFToMu2e( cl->diskID(), cl->cog3Vector())); - double dt = cl->time() + _ttcalc.trkToCaloTimeOffset() - tflt; - - //check the compatibility of the track and time within a given time window - if (fabs(dt) > _maxtchdt) continue; - - HitT0 ht0; - ht0._t0 = tflt; - // initial error can't be better than the input error - ht0._t0err = _ttcalc.caloClusterTimeErr(); - - Hep3Vector clusterAxis = Hep3Vector(0, 0, 1);//FIXME! should come from crystal - // construct a temporary TrkCaloHit. This is just to be able to call POCA - TrkLineTraj hitTraj(HepPoint(cog.x(), cog.y(), cog.z()), - clusterAxis, 0.0, crystalLength); - //evaluate the doca - TrkPoca poca(krep->traj(),flt,hitTraj,0.5*crystalLength); - double doca = poca.doca(); - double depth = poca.flt2(); - if( doca > _mindocatch && doca < _maxdocatch && - depth > _mindepthtch && depth < _maxdepthtch && - fabs(doca) < minFOM) { - tchFinal.reset(new TrkCaloHit(*cl, cog, crystalLength, clusterAxis, - ht0, poca.flt1(), - _calHitW, _caloHitErr, - _ttcalc.caloClusterTimeErr(), _ttcalc.trkToCaloTimeOffset())); - minFOM = doca; // this should be some combination of energy, DOCA, etc FIXME! - retval = icc; - } - } - - if (tchFinal != 0) { - - //add the TrkCaloHit - krep->addHit(tchFinal.release()); - - TrkErrCode fitstat = fitIteration(detmodel,kalData,_herr.size()-1); - krep->addHistory(fitstat,"AddHits"); - } - } - - return retval; - - } - - void - KalFit::fillTchDiag(KalFitData& kalData){ - KalRep* krep = kalData.krep; - TrkHitVector *thv = &(krep->hitVector()); - - mu2e::GeomHandle ch; - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - double flt0 = krep->flt0(); - - //evaluate the track-path length in the calorimeter - int trkToCaloDiskId(-1); - double trkInCaloFlt(0); - findCaloDiskFromTrack(kalData, trkToCaloDiskId, trkInCaloFlt); - - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkCaloHit*hit = dynamic_cast(*ihit); - if (hit == 0) continue; - if (hit->isActive()) { - //evaluate the flight length at the z of the calorimeter cluster + half crystallength - unsigned diskId = hit->caloCluster().diskID(); - double flt(0); - TrkHelixUtils::findZFltlen(*reftraj, (_zmincalo[diskId]+0.5*crystalLength),flt); - //evaluate the transittime using the full trajectory - double tflt = krep->t0()._t0 + krep->transitTime(flt0, flt); - double dt = hit->caloCluster().time() + _ttcalc.trkToCaloTimeOffset() - tflt; - - kalData.diag.diskId = diskId; - kalData.diag.depth = hit->hitLen(); - kalData.diag.dt = dt; - kalData.diag.trkPath = trkToCaloDiskId == (int)diskId ? trkInCaloFlt : -9999; - kalData.diag.energy = hit->caloCluster().energyDep(); - kalData.diag.doca = hit->poca().doca(); - } - } - } - - bool - KalFit::weedTrkCaloHit(KalFitData& kalData, int iter) { - // check if the TrkCaloHit residuals is within a given limit - KalRep* krep = kalData.krep; - bool retval(false); - // double worst = -1.; - TrkCaloHit *worsthit = 0; - TrkHitVector *thv = &(krep->hitVector()); - - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkCaloHit*hit = dynamic_cast(*ihit); - if (hit == 0) continue; - if (hit->isActive()) { - //evaluate the doca - double doca = hit->poca().doca(); - //evaluate the crystal depth - double depth = hit->hitLen(); - if( (doca < _mindocatch ) || (doca > _maxdocatch) || - (depth < _mindepthtch) || (depth > _maxdepthtch)) { - worsthit = hit; - break; - } - } - } - - if (iter == -1) iter = _ambigresolver.size()-1; - - if(0 != worsthit){ - retval = true; - worsthit->setActivity(false); - worsthit->setFlag(TrkHit::weededHit); - if (_resolveAfterWeeding) { - //----------------------------------------------------------------------------- - // _resolveAfterWeeding=0 makes changes in the logic fully reversible - //----------------------------------------------------------------------------- - _ambigresolver[iter]->resolveTrk(krep); - } - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitWeed"); - - if (_debug > 0) { - char msg[200]; - sprintf(msg,"KalFit::weedTrkCaloHit Iteration = %2i success = %i",iter,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - - } - - kalData.nweedtchiter++; - return retval; - } - - BField const& - KalFit::bField() const { - if(_bfield == 0){ - if(_fieldcorr){ - // create a wrapper around the mu2e field - _bfield = new BaBarMu2eField(); - } else { - // create a fixed field using the field at the tracker origin - GeomHandle bfmgr; - GeomHandle det; - // change coordinates to mu2e - CLHEP::Hep3Vector vpoint(0,0,0); - CLHEP::Hep3Vector vpoint_mu2e = det->toMu2e(vpoint); - CLHEP::Hep3Vector field = bfmgr->getBField(vpoint_mu2e); - _bfield=new BFieldFixed(CLHEP::Hep3Vector(0.0,0.0,field.z())); - assert(_bfield != 0); - } - } - return *_bfield; - } - - const TrkVolume* - KalFit::trkVolume(trkDirection trkdir) const { - //FIXME!!!! - return 0; - } - - - bool - KalFit::updateT0(KalFitData& kalData, int iter){ - KalRep* krep = kalData.krep; - using namespace boost::accumulators; - TrkHitVector *thv = &(krep->hitVector()); - bool retval(false); - // need to have a valid fit - if(krep->fitValid()){ - // find the global fltlen associated with z=0. - double flt0(0.0); - bool converged = TrkHelixUtils::findZFltlen(krep->traj(),0.0,flt0); - if(converged){ - std::vector hitt0, hitt0err; // store t0, to allow outlyer removal - size_t nhits = krep->hitVector().size(); - hitt0.reserve(nhits); - hitt0err.reserve(nhits); - - if (iter == -1) iter = _herr.size()-1; - accumulator_set,double > wmean; - - // loop over the hits and accumulate t0 - for(auto ihit=thv->begin(); ihit != thv->end(); ihit++){ - TrkHit* hit = *ihit; - bool trkShAmbigOK(true); - if (_ambigstrategy[iter] != 0) { - TrkStrawHit* trkSh = dynamic_cast(*ihit); - if (trkSh !=0){ - if (trkSh->ambig() == 0) - trkShAmbigOK = false; - } - } - if(hit->isActive() && trkShAmbigOK) { - HitT0 st0; - // if (hit->signalPropagationTime(st0 )){ - if (hit_time(hit, st0)){//2019-04-22: this function will become TrkHit::time(HitT0& hitT0) in the fututre development. FIXME! - // subtracting hitT0 makes this WRT the previous track t0 - double dtHitToTrack = st0._t0 - krep_hitT0(krep, hit)._t0;//FIXME! KalRep should own this function - wmean(dtHitToTrack, weight=1.0/(st0._t0err*st0._t0err)); - - } - } - } - - TrkT0 t0; // null t0; this will be the change in t0 from this update - unsigned nused = extract_result(wmean); - t0._t0 = extract_result(wmean); - t0._t0err = sqrt(extract_result(wmean)/nused); - - // put in t0 from the track. - t0._t0 += krep->t0()._t0; - krep->setT0(t0,flt0); - updateHitTimes(krep); - retval = true; - - } - } - return retval; - } - - void KalFit::updateHitTimes(KalRep* krep) { - // compute the time the track came closest to the sensor for each hit, starting from t0 and working out. - // this function allows for momentum change along the track. - // find the bounding hits on either side of this - TrkHitVector *thv = &(krep->hitVector()); - std::sort(thv->begin(),thv->end(),fcomp()); - TrkHitVector::iterator ihigh; - TrkHitVector::reverse_iterator ilow; - findBoundingHits(krep, krep->flt0(),ilow,ihigh); - // reset all the hit times - double flt0 = krep->flt0(); - HitT0 hitt0 = krep->t0(); - //GIANIPEZ 2019-04-26: update the following loops in the bottom using the function kres_hitt0//FIXME! - for(TrkHitVector::iterator ihit= ihigh;ihit != thv->end(); ++ihit){ - TrkHit* hit = *ihit; - double flt1 = hit->fltLen(); - // particle transit time to this hit from the reference - double tflt = krep->transitTime(flt0, flt1); - // update the time in the TrkT0 object - hitt0._t0 += tflt; - (*ihit)->setHitT0(hitt0); - // update the reference flightlength - flt0 = flt1; - } - // now the same, moving backwards. - flt0 = krep->flt0(); - hitt0 = krep->t0(); - for(TrkHitVector::reverse_iterator ihit= ilow;ihit != thv->rend(); ++ihit){ - TrkHit* hit = *ihit; - double flt1 = hit->fltLen(); - double tflt = krep->transitTime(flt0, flt1); - hitt0._t0 += tflt; - (*ihit)->setHitT0(hitt0); - flt0 = flt1; - } - } - - void KalFit::findBoundingHits(KalRep* krep,double flt0, - TrkHitVector::reverse_iterator& ilow, - TrkHitVector::iterator& ihigh) { - TrkHitVector* hits = &(krep->hitVector()); - ilow = hits->rbegin(); - ihigh = hits->begin(); - while(ilow != hits->rend() && (*ilow)->fltLen() > flt0 )++ilow; - while(ihigh != hits->end() && (*ihigh)->fltLen() < flt0 )++ihigh; - } - - // attempt to extend the fit to the specified location - TrkErrCode KalFit::extendFit(KalRep* krep) { - TrkErrCode retval; - // find the downstream and upstream Z positions to extend to - if(_exdown != noextension){ - double downz = extendZ(_exdown); - // convert to flightlength using the fit trajectory - double downflt = krep->pieceTraj().zFlight(downz); - // actually extend the track - retval = krep->extendThrough(downflt); - } - // same for upstream extension - if(retval.success() && _exup != noextension){ - double upz = extendZ(_exup); - double upflt = krep->pieceTraj().zFlight(upz); - retval = krep->extendThrough(upflt); - } - return retval; - } - - double KalFit::extendZ(extent ex) { - double retval(0.0); - if(ex == target){ - GeomHandle target; - GeomHandle det; - retval = det->toDetector(target->centerInMu2e()).z() - 0.5*target->cylinderLength(); - } else if(ex == ipa) { - // the following is wrong FIXME!! - GeomHandle target; - GeomHandle det; - retval = det->toDetector(target->centerInMu2e()).z() + 0.5*target->cylinderLength(); - } else if(ex == tracker) { - retval = 0.0; - } else if(ex == calo) { - GeomHandle cg; - return cg->caloInfo().getDouble("envelopeZ1"); - } - return retval; - } - - HitT0 KalFit::krep_hitT0(KalRep*krep, const TrkHit*hit){ - HitT0 t0; - double flt0 = krep->flt0(); - double flt1 = hit->fltLen(); - // particle transit time to this hit from the reference - double tflt = krep->transitTime(flt0, flt1); - t0._t0 = krep->t0()._t0 + tflt; - t0._t0err = krep->t0()._t0err;//the error contribution from the *tflt* term is neglected. In the last fit iteration we might be considering adding a contribution from *tlft* - return t0; - } - - - //-------------------------------------------------------------------------------- - // - //-------------------------------------------------------------------------------- - bool KalFit::hit_time(TrkHit*hit, HitT0& hitT0){ - TrkT0 st0; - if (hit->signalPropagationTime(st0)){ - hitT0._t0 = hit->time() - st0._t0; - hitT0._t0err = st0._t0err; - return true; - }else { - return false; - } - } - - } -*/ diff --git a/TrkReco/src/KalFitData.cc b/TrkReco/src/KalFitData.cc deleted file mode 100644 index d1d1e20d98..0000000000 --- a/TrkReco/src/KalFitData.cc +++ /dev/null @@ -1,80 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Struct to hold BaBar Kalman fit -// -// -// the following has to come before other BaBar includes -/////////////////////////////////////////////////////////////////////////////// - -#include "BTrk/BaBar/BbrCollectionUtils.hh" -#include "Offline/TrkReco/inc/KalFitData.hh" - -namespace mu2e { - - //----------------------------------------------------------------------------- - KalFitData::KalFitData() { - helixTraj = NULL; - // tpart = TrkParticle::e_minus; // 11 - fdir = TrkFitDirection::downstream; // = 0 - chcol = 0; - // shpos = 0; - shfcol = 0; - krep = 0; - kalSeed = 0; - helixSeed = 0; - // fit = TrkErrCode::fail; - // nt0iter = 0; - nweediter = 0; - nweedtchiter = 0; - // nunweediter = 0; - - // hitIndices = new vector; - } - - //----------------------------------------------------------------------------- - KalFitData::~KalFitData() { - // if (helixTraj) { delete helixTraj; helixTraj = 0;} - // if (caloCluster) { delete caloCluster; caloCluster = 0;} - // if (helixSeed) { delete helixSeed; helixSeed = 0;} - // if (kalSeed) { delete kalSeed; kalSeed = 0;} - // if (shcol) { delete shcol; shcol = 0;} - // if (shfcol) { delete shfcol; shfcol = 0;} - // if (event) { delete event; event = 0;} - // if (krep) { delete krep; krep = 0;} - - // delete hitIndices; - } - - //----------------------------------------------------------------------------- - void KalFitData::deleteTrack() { - if(krep != NULL) { - delete krep; - krep = NULL; - } - } - - //----------------------------------------------------------------------------- - void KalFitData::init() { - deleteTrack(); - missingHits.clear(); - nweediter = 0; - nweedtchiter = 0; - helixTraj = NULL; - - diag.diskId = 0; - diag.added = 0; - diag.depth = -9999; - diag.dt = -9999; - diag.trkPath = -9999; - diag.energy = -9999; - diag.doca = -9999; - } - - //----------------------------------------------------------------------------- - KalRep* KalFitData::stealTrack() { - KalRep* retval = krep; - krep = 0; - return retval; - } - -} - diff --git a/TrkReco/src/PanelAmbigResolver.cc b/TrkReco/src/PanelAmbigResolver.cc deleted file mode 100644 index 57ed220c53..0000000000 --- a/TrkReco/src/PanelAmbigResolver.cc +++ /dev/null @@ -1,329 +0,0 @@ -// class to resolve hit ambiguities by panel, assuming a reasonable track -// fit as input -// -// -#include "Offline/TrkReco/inc/PanelAmbigResolver.hh" -#include "Offline/TrkReco/inc/PanelStateIterator.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/TrkBase/TrkT0.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalSite.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/difAlgebra/DifPoint.hh" -#include "BTrk/difAlgebra/DifVector.hh" -#include -#include -#include -#include -// art -#include "art_root_io/TFileService.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -using CLHEP::Hep3Vector; -using CLHEP::HepSymMatrix; -using CLHEP::HepVector; -namespace mu2e { - namespace PanelAmbig { - // functor for sorting by panel. Note that PanelId uniquely defines a panel - struct panelcomp { - bool operator()(TrkStrawHit* x, TrkStrawHit* y) { return x->straw().id().getPanelId() < y->straw().id().getPanelId(); } - }; - - // functor to sort panel results by chisquared - struct resultcomp { - bool operator()(PanelResult const& a, PanelResult const& b) { return a._chisq < b._chisq; } - }; - - typedef TrkStrawHitVector::iterator TSHI; - typedef TrkStrawHitVector::const_iterator TSHCI; - - - PanelAmbigResolver::PanelAmbigResolver(fhicl::ParameterSet const& pset, double tmpErr, size_t iter): - AmbigResolver(tmpErr), - _minsep(pset.get("minChisqSep",4.0)), - _inactivepenalty(pset.get("inactivePenalty",16.0)), - _nullpenalty(pset.get("NullHitPenalty",0.0)), - _penaltyres(pset.get("PenaltyResolution",0.25)), - _trkpenaltyres(pset.get("TrackPenaltyResolution",0.5)), - _addtrkpos(pset.get("AddTrackPositionConstraint",true)), - _maxhitu(pset.get("MaximumHitU",8.0)), - _fixunallowed(pset.get("FixUnallowedHitStates",true)), - _maxnpanel(pset.get("MaxHitsPerPanel",8)), - _diag(pset.get("DiagLevel",0)) - { - double nullerr = pset.get("ExtraNullAmbigError",0.0); - _nullerr2 = nullerr*nullerr; - std::vector allowed = pset.get< std::vector >("AllowedHitStates"); - for(std::vector::iterator ial = allowed.begin();ial != allowed.end();++ial){ - if(*ial >= HitState::negambig && *ial <= HitState::inactive){ - _allowed.push_back(HitState(static_cast(*ial))); - } else - throw cet::exception("RECO")<<"mu2e::PanelAmbigResolver: illegal state" << std::endl; - } - // if requested, setup diagnostics - if(_diag > 0){ - art::ServiceHandle tfs; - char title[40]; - snprintf(title,40,"padiag_%lu",iter); - _padiag=tfs->make(title,"Panel Ambiguity Resolution Diagnostics"); - _padiag->Branch("nhits",&_nrhits,"nhits/I"); - _padiag->Branch("nactive",&_nactive,"nactive/I"); - _padiag->Branch("nres",&_nres,"nres/I"); - _padiag->Branch("results",&_results); - - snprintf(title,40,"pudiag_%lu",iter); - _pudiag=tfs->make(title,"Panel U position Diagnostics"); - _pudiag->Branch("nhits",&_nuhits,"nhits/I"); - _pudiag->Branch("tupos",&_tupos,"tupos/F"); - _pudiag->Branch("tuerr",&_tuerr,"tuerr/F"); - _pudiag->Branch("uinfo",&_uinfo); - } - } - - PanelAmbigResolver::~PanelAmbigResolver() {} - - bool PanelAmbigResolver::resolveTrk(KalRep* krep) const { - bool retval(false); // assume nothing changes - // initialize penalty errors - initHitErrors(krep); - // sort by panel - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - std::sort(tshv.begin(),tshv.end(),panelcomp()); - // collect hits in the same panel - auto ihit=tshv.begin(); - while(ihit!=tshv.end()){ - PanelId pid = (*ihit)->straw().id().getPanelId(); - (*ihit)->setTemperature(AmbigResolver::_tmpErr); - TrkStrawHitVector phits; - auto jhit=ihit; - while(jhit != tshv.end() && (*jhit)->straw().id().getPanelId() == pid){ - phits.push_back(*jhit++); - } - // resolve the panel hits - retval |= resolvePanel(phits,krep); - ihit = jhit; - } - return retval; - } - - bool PanelAmbigResolver::resolvePanel(TrkStrawHitVector& phits,KalRep* krep) const { - bool retval(false); // assume nothing changes - // sort hits for this panel - std::sort(phits.begin(),phits.end(),hitsort()); - // fill panel information - PanelInfo pinfo; - if(fillPanelInfo(phits,krep,pinfo)){ - // loop over all ambiguity/activity states for this panel - PanelStateIterator psi(pinfo._uinfo,_allowed); - PRV results; - do { - // for each state, fill the result of the 1-dimensional optimization - PanelResult result(psi.current()); - fillResult(pinfo,krep->t0(),result); - if(result._status == 0)results.push_back(result); - } while(psi.increment()); - if(results.size() > 0){ - // sort the results to have lowest chisquard first - std::sort(results.begin(),results.end(),resultcomp()); - // for now, set the hit state according to the best result. In future, maybe we want to treat - // cases with different ambiguities differently from inactive hits - retval |= setHitStates(results[0]._state,phits); - // if the chisq difference between patterns is negligible, inflate the errors of the - // hit which changes - size_t nhits = results[0]._state.size(); - size_t ires(1); - while (ires < results.size() && results[ires]._chisq - results[0]._chisq < _minsep){ - for(size_t ihit=0;ihitsetPenalty(_penaltyres); - } - } - ++ires; - } - } - if( _diag > 1 ) { - _nuhits = _nrhits = pinfo._uinfo.size(); - _nactive = 0; - for(auto const& ishi : pinfo._uinfo) { - if(ishi._active)++_nactive; - } - _nres = results.size(); - _results = results; - _padiag->Fill(); - // - _tupos = pinfo._tupos; - _tuerr = pinfo._tuerr; - _uinfo = pinfo._uinfo; - _pudiag->Fill(); - } - } else - std::cout << "PanelAmbigResolver: Panel with " << phits.size() << " hits has no usable info" << std::endl; - - return retval; - } - - bool PanelAmbigResolver::fillPanelInfo(TrkStrawHitVector const& phits, const KalRep* krep, PanelInfo& pinfo) const { - bool retval(false); - // find the best trajectory we can local to these hits, but excluding their information ( if possible). - const TrkSimpTraj* straj = findTraj(phits,krep); - if(straj != 0){ - // find a reference point on this traj using POCA to the first good hit - double gdist; - Hep3Vector wdir; - HepPoint wpos; - for(const TrkStrawHit* refhit : phits) { - TrkPoca tpoca(*straj,refhit->fltLen(),*refhit->hitTraj(),refhit->hitLen()); - if(tpoca.status().success() ) { //&& abs(tpoca.doca()) < _maxhitu){ - retval = true; - gdist = tpoca.flt1(); - wdir = refhit->hitTraj()->direction(tpoca.flt2()); - wpos = refhit->hitTraj()->position(tpoca.flt2()); - break; - } - } - if(retval){ - // find the trajectory position and direction information at this distance - DifPoint tpos; - DifVector tdir; - straj->getDFInfo2(gdist, tpos, tdir); - // straw information; cast to dif even though the derivatives are 0 - Hep3Vector wposv(wpos.x(),wpos.y(),wpos.z()); - DifVector delta = DifVector(wposv) - tpos; - // compute the U direction (along the measurement, perp to the track and wire - // The sign is chosen to give positive and negative ambiguity per BaBar convention - DifVector dudir = cross(DifVector(wdir),tdir).normalize(); - Hep3Vector udir(dudir.x.number(),dudir.y.number(),dudir.z.number()); - // compute the track constraint on u, and it's error. The dif algebra part propagates the error - DifNumber trku = dudir.dot(delta); - pinfo._udir = udir; - Hep3Vector tposv(tpos.x.number(),tpos.y.number(),tpos.z.number()); - pinfo._tupos = udir.dot(tposv); - pinfo._tuerr = trku.error(); - // degrade the track information - pinfo._tuwt = 1.0/(pinfo._tuerr*pinfo._tuerr + _trkpenaltyres*_trkpenaltyres); - // now, project the hits onto u, WRT the projected track position. - for(auto ihit = phits.begin();ihit != phits.end();++ihit){ - TSHUInfo uinfo(*ihit,udir,tpos.hepPoint()); - // mask off hits with wire u values outside the limits, and (optionally) those whose - // initial state isn't allowed - if(fabs(uinfo._upos) > _maxhitu) - uinfo._use = TSHUInfo::unused; - if(_fixunallowed){ - auto ifnd = std::find(_allowed.begin(),_allowed.end(),uinfo._hstate); - if(ifnd == _allowed.end()) - uinfo._use = TSHUInfo::fixed; - } - // limit the # of hits considered - if(pinfo._nfree >= _maxnpanel){ - std::cout << "PanelAmbigResolver: Maximum number of hits/panel exceeded: truncating" << std::endl; - uinfo._use = TSHUInfo::unused; - } - if(uinfo._use == TSHUInfo::free)++pinfo._nfree; - if(uinfo._use != TSHUInfo::unused)++pinfo._nused; - pinfo._uinfo.push_back(uinfo); - } - } - } else { - throw cet::exception("RECO")<<"mu2e::PanelAmbigResolver: no trajectory" << std::endl; - } - return retval; - } - - void PanelAmbigResolver::fillResult(PanelInfo const& pinfo,TrkT0 const& t0, PanelResult& result) const { - // initialize the sums - double wsum(0.0); - double uwsum(0.0); - double vwsum(0.0); - double uuwsum(0.0); - double vvwsum(0.0); - double uvwsum(0.0); - double chi2penalty(0.0); - // loop over the straw hit info and accumulate the sums used to compute chisquared - size_t ntsh = pinfo._uinfo.size(); - // consistency check - if(ntsh != result._state.size()) - throw cet::exception("RECO")<<"mu2e::PanelAmbigResolver: inconsistent hits" << std::endl; - for(size_t itsh=0;itsh 0){ - // propogate t0 uncertainty. This is a constraint centered at the - // current value of t0, unit derivative - double t0wt = 1.0/(t0._t0err*t0._t0err); - vvwsum += t0wt; // t0 has unit derrivative - // optionally add track position constraint if there are multiple hits. It is like a hit, but with r=v=0 - // NB, since the track position is defined to be 0, it adds only to the weight - if(_addtrkpos || pinfo._nused == 1)wsum += pinfo._tuwt; - // now compute the scalar, vector, and tensor terms for the 2nd-order chisquared expansion - double alpha = uuwsum; - HepVector beta(2); - beta(1) = uwsum; - beta(2) = uvwsum; - HepSymMatrix gamma(2); - gamma.fast(1,1) = wsum; - gamma.fast(2,2) = vvwsum; - gamma.fast(1,2) = vwsum; - // invert and solve - gamma.invert(result._status); - if(result._status == 0){ - result._dcov = gamma; - result._delta = gamma * beta; - result._chisq = alpha - gamma.similarity(beta) + chi2penalty; - // debug printout -#ifdef DEBUG - double g11 = gamma.fast(1,1); - double g22 = gamma.fast(2,2); - double g12 = gamma.fast(1,2); - double g21 = gamma.fast(2,1); - double b1 = beta(1); - double b2 = beta(2); - double d1 = result._delta(1); - double d2 = result._delta(2); - double sim = gamma.similarity(beta); - double test = alpha - sim; - double test2 = alpha -2*dot(beta,result._delta) + gamma.similarity(result._delta); -#endif - // add a penalty term (if any) for this particular pattern. Still to be written, FIXME!!! - // addPatternPenalty(); - } - } else { - // if there are no active hits, flag the status - result._status = -100; - } - } - - } // PanelAmbig namespace - } // mu2e namespace From 0ce903c01cc77c4aa6d104178c419625e7d2dd40 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 8 Apr 2025 22:11:50 -0700 Subject: [PATCH 010/174] Removed unused imports and TrkDef --- TrkReco/CMakeLists.txt | 1 - TrkReco/inc/PanelAmbigStructs.hh | 2 +- TrkReco/inc/RobustHelixFinderData.hh | 3 -- TrkReco/inc/RobustHelixFit.hh | 1 - TrkReco/inc/TrkDef.hh | 53 ---------------------------- TrkReco/inc/TrkTimeCalculator.hh | 1 - TrkReco/src/PanelAmbigStructs.cc | 1 - TrkReco/src/RobustHelixFinderData.cc | 1 - TrkReco/src/TrkDef.cc | 36 ------------------- 9 files changed, 1 insertion(+), 98 deletions(-) delete mode 100644 TrkReco/inc/TrkDef.hh delete mode 100644 TrkReco/src/TrkDef.cc diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index 640478d822..790abbe414 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -4,7 +4,6 @@ cet_make_library( src/PanelStateIterator.cc src/RobustHelixFinderData.cc src/RobustHelixFit.cc - src/TrkDef.cc src/TrkPrintUtils.cc src/TrkTimeCalculator.cc src/TrkUtilities.cc diff --git a/TrkReco/inc/PanelAmbigStructs.hh b/TrkReco/inc/PanelAmbigStructs.hh index ddb039f173..720a83a163 100644 --- a/TrkReco/inc/PanelAmbigStructs.hh +++ b/TrkReco/inc/PanelAmbigStructs.hh @@ -10,8 +10,8 @@ #include "CLHEP/Vector/ThreeVector.h" #include "CLHEP/Matrix/SymMatrix.h" #include "CLHEP/Matrix/Vector.h" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" #include "Rtypes.h" +#include "Offline/BTrkData/inc/TrkStrawHit.hh" #include #include #include diff --git a/TrkReco/inc/RobustHelixFinderData.hh b/TrkReco/inc/RobustHelixFinderData.hh index 4f0b28e50e..7282038036 100644 --- a/TrkReco/inc/RobustHelixFinderData.hh +++ b/TrkReco/inc/RobustHelixFinderData.hh @@ -3,10 +3,7 @@ #define RobustHelixFinderData_HH #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" -// #include "CalPatRec/inc/CalHelixPoint.hh" -// #include "BTrk/TrkBase/TrkErrCode.hh" -// #include "BTrk/TrkBase/TrkParticle.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" #include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" diff --git a/TrkReco/inc/RobustHelixFit.hh b/TrkReco/inc/RobustHelixFit.hh index e94ccb9fcc..421e5fc1b8 100644 --- a/TrkReco/inc/RobustHelixFit.hh +++ b/TrkReco/inc/RobustHelixFit.hh @@ -10,7 +10,6 @@ #include "Offline/DataProducts/inc/Helicity.hh" #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "BTrk/TrkBase/TrkErrCode.hh" #include "TH1F.h" #include "Math/VectorUtil.h" #include "Math/Vector2D.h" diff --git a/TrkReco/inc/TrkDef.hh b/TrkReco/inc/TrkDef.hh deleted file mode 100644 index 4bc9629b24..0000000000 --- a/TrkReco/inc/TrkDef.hh +++ /dev/null @@ -1,53 +0,0 @@ -// -// Define a track; this provides the transfer between pat. rec. and fitting -// -// Original author David Brown, LBNL -// -#ifndef TrkDef_HH -#define TrkDef_HH -// Mu2e -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/TimeCluster.hh" -// BTrk includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/TrkBase/TrkT0.hh" -// CLHEP -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Matrix/SymMatrix.h" - -class TrkDifPieceTraj; - -namespace mu2e -{ - - class TrkDef { - public: - TrkDef(TimeCluster const& tcluster, HelixTraj const& helix, - TrkParticle const& tpart, TrkFitDirection const& fdir); - TrkDef(const TrkDef&); - TrkDef& operator = (const TrkDef&); - ~TrkDef(); - // append a straw hit to this track definition - void appendHit(size_t index) { _timeCluster._strawHitIdxs.push_back(index); } - // accessors - std::vector const& strawHitIndices() const { return _timeCluster._strawHitIdxs;} - HelixTraj const& helix() const { return _h0; } - TrkT0 const& t0() const { return _timeCluster._t0; } - TrkParticle const& particle() const { return _tpart; } - TrkFitDirection const& fitdir() const { return _fdir; } - //non-const accessors to allow updates - std::vector& strawHitIndices() { return _timeCluster._strawHitIdxs;} - HelixTraj& helix() { return _h0; } - TrkT0& t0() { return _timeCluster._t0; } - private: - TimeCluster _timeCluster; // t0 and hit indices - HelixTraj _h0; // helix estimate, valid in the region around z=0 - TrkParticle _tpart; // particle type. Note this defines both the charge and the mass - TrkFitDirection _fdir; // fit direction - }; -} - -#endif diff --git a/TrkReco/inc/TrkTimeCalculator.hh b/TrkReco/inc/TrkTimeCalculator.hh index 2e1ba2ebaf..12ef8a651d 100644 --- a/TrkReco/inc/TrkTimeCalculator.hh +++ b/TrkReco/inc/TrkTimeCalculator.hh @@ -16,7 +16,6 @@ #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" #include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "BTrk/TrkBase/TrkErrCode.hh" namespace mu2e diff --git a/TrkReco/src/PanelAmbigStructs.cc b/TrkReco/src/PanelAmbigStructs.cc index 018562e969..968c21ffbd 100644 --- a/TrkReco/src/PanelAmbigStructs.cc +++ b/TrkReco/src/PanelAmbigStructs.cc @@ -5,7 +5,6 @@ // Original author David Brown, LBNL // #include "Offline/TrkReco/inc/PanelAmbigStructs.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" #include "cetlib_except/coded_exception.h" #include #include diff --git a/TrkReco/src/RobustHelixFinderData.cc b/TrkReco/src/RobustHelixFinderData.cc index fae9800d5a..9fedaa10b8 100644 --- a/TrkReco/src/RobustHelixFinderData.cc +++ b/TrkReco/src/RobustHelixFinderData.cc @@ -2,7 +2,6 @@ #include "Offline/RecoDataProducts/inc/TimeCluster.hh" #include "Offline/TrkReco/inc/RobustHelixFinderData.hh" -#include "BTrk/TrkBase/HelixTraj.hh" using CLHEP::HepVector; using CLHEP::HepSymMatrix; diff --git a/TrkReco/src/TrkDef.cc b/TrkReco/src/TrkDef.cc deleted file mode 100644 index 20cdb2fc9d..0000000000 --- a/TrkReco/src/TrkDef.cc +++ /dev/null @@ -1,36 +0,0 @@ -// -// Track definition object -// -// Original author David Brown, LBNL -// -#include "BTrk/BaBar/BaBar.hh" -#include "Offline/TrkReco/inc/TrkDef.hh" -using CLHEP::Hep3Vector; -using CLHEP::HepSymMatrix; -using CLHEP::HepVector; -namespace mu2e -{ - TrkDef::TrkDef(TimeCluster const& tclust, const HelixTraj& helix, - TrkParticle const& tpart, TrkFitDirection const& fdir) : - _timeCluster(tclust),_h0(helix),_tpart(tpart),_fdir(fdir) - {} - - TrkDef::TrkDef(const TrkDef& other ) : - _timeCluster(other._timeCluster), - _h0(other._h0), _tpart(other._tpart), - _fdir(other._fdir) - {} - - TrkDef& - TrkDef::operator = (const TrkDef& other) { - if(this != &other){ - _timeCluster = other._timeCluster; - _h0 = other._h0; - _tpart = other._tpart; - _fdir = other._fdir; - } - return *this; - } - - TrkDef::~TrkDef(){} -} From d9f32af9418370bbdae240c25574291b2c5908b6 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 15 Apr 2025 23:00:23 -0700 Subject: [PATCH 011/174] got rid of some not needed includes, got rid of unused functions in TrkUtilities and BTrk includse in Trkutilities --- CosmicReco/src/CosmicTrackFinder_module.cc | 2 - TrkReco/inc/TrkUtilities.hh | 4 +- TrkReco/src/MergeHelices_module.cc | 1 - TrkReco/src/TrkRecoMcUtils_tool.cc | 901 +++++++++++++++++++++ TrkReco/src/TrkUtilities.cc | 33 +- 5 files changed, 913 insertions(+), 28 deletions(-) diff --git a/CosmicReco/src/CosmicTrackFinder_module.cc b/CosmicReco/src/CosmicTrackFinder_module.cc index ca4fab076b..dc277f7b22 100644 --- a/CosmicReco/src/CosmicTrackFinder_module.cc +++ b/CosmicReco/src/CosmicTrackFinder_module.cc @@ -36,8 +36,6 @@ #include "Offline/Mu2eUtilities/inc/ParametricFit.hh" //For Drift: -//#include "Offline/TrkReco/inc/PanelAmbigResolver.hh" -#include "Offline/TrkReco/inc/PanelStateIterator.hh" #include "Offline/TrkReco/inc/TrkFaceData.hh" // Mu2e BaBar diff --git a/TrkReco/inc/TrkUtilities.hh b/TrkReco/inc/TrkUtilities.hh index c00edd71e5..d04e47d5ad 100644 --- a/TrkReco/inc/TrkUtilities.hh +++ b/TrkReco/inc/TrkUtilities.hh @@ -7,8 +7,6 @@ #define TrkReco_TrkUtilities_HH #include "CLHEP/Vector/ThreeVector.h" #include "CLHEP/Matrix/Vector.h" -#include "BTrk/TrkBase/TrkT0.hh" -#include "BTrk/BField/BField.hh" #include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" #include @@ -35,7 +33,7 @@ namespace mu2e { // create a robust helix from raw particle informaiton. This is useful for MC comparison void RobustHelixFromMom(CLHEP::Hep3Vector const& pos, CLHEP::Hep3Vector const& mom, double charge, double Bz, RobustHelix& helix); // create a KalSegment (helix segment) from a HelixTraj - void fillSegment(HelixTraj const& htraj, double locflt, double globflt, TrkT0 t0, double mass, int charge, BField const& bfield, KalSegment& kseg); + //void fillSegment(HelixTraj const& htraj, double locflt, double globflt, TrkT0 t0, double mass, int charge, BField const& bfield, KalSegment& kseg); // create HitSeeds from the TrkStrawHits in a KalRep void fillStrawHitSeeds(const KalRep* krep, ComboHitCollection const& chits, std::vector& hitseeds); void fillCaloHitSeed(const TrkCaloHit* chit, CLHEP::Hep3Vector const& tmom, TrkCaloHitSeed& caloseed); diff --git a/TrkReco/src/MergeHelices_module.cc b/TrkReco/src/MergeHelices_module.cc index ee5e69cbd1..e0de3bd860 100644 --- a/TrkReco/src/MergeHelices_module.cc +++ b/TrkReco/src/MergeHelices_module.cc @@ -14,7 +14,6 @@ #include "Offline/RecoDataProducts/inc/HelixSeed.hh" #include "Offline/RecoDataProducts/inc/TimeCluster.hh" // utilities -#include "Offline/TrkReco/inc/TrkUtilities.hh" #include "Offline/Mu2eUtilities/inc/LsqSums2.hh" #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" // C++ diff --git a/TrkReco/src/TrkRecoMcUtils_tool.cc b/TrkReco/src/TrkRecoMcUtils_tool.cc index f40e30a598..565155a064 100644 --- a/TrkReco/src/TrkRecoMcUtils_tool.cc +++ b/TrkReco/src/TrkRecoMcUtils_tool.cc @@ -1,6 +1,906 @@ /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// +/* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* + * /* #include "art/Framework/Principal/Event.h" #include "fhiclcpp/ParameterSet.h" #include "art/Utilities/ToolMacros.h" @@ -259,3 +1159,4 @@ namespace mu2e { DEFINE_ART_CLASS_TOOL(TrkRecoMcUtils) } +*/ diff --git a/TrkReco/src/TrkUtilities.cc b/TrkReco/src/TrkUtilities.cc index d1e6b0b95d..da234d3111 100644 --- a/TrkReco/src/TrkUtilities.cc +++ b/TrkReco/src/TrkUtilities.cc @@ -14,18 +14,6 @@ #include "Offline/RecoDataProducts/inc/TrkStrawHitSeed.hh" #include "Offline/RecoDataProducts/inc/TrkCaloHitSeed.hh" #include "Offline/RecoDataProducts/inc/ComboHit.hh" -// BTrk -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalMaterial.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/TrkDifPieceTraj.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/BTrkData/inc/TrkCaloHit.hh" -#include "Offline/Mu2eBTrk/inc/DetStrawElem.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" // KinKal #include "KinKal/Trajectory/CentralHelix.hh" // CLHEP @@ -40,7 +28,7 @@ using CLHEP::HepSymMatrix; using CLHEP::HepVector; namespace mu2e { namespace TrkUtilities { - +/* bool RobustHelix2Traj (RobustHelix const& helix, HepVector& hpvec, float amsign) { bool retval(false); // compare the input with this configuration's helicity: these must be the same @@ -69,7 +57,7 @@ namespace mu2e { } return retval; } - + */ void RobustHelixFromMom(Hep3Vector const& pos, Hep3Vector const& mom, double charge, double Bz, RobustHelix& helix){ double momToRad = 1000.0/(charge*Bz*CLHEP::c_light); // compute some simple useful parameters @@ -88,7 +76,7 @@ namespace mu2e { Angles::deltaPhi(phi); helix._fz0 = phi; } - + /* // legacy function void fillSegment(HelixTraj const& htraj, double locflt, double globflt, TrkT0 t0, double mass, int charge, BField const& bfield, KalSegment& kseg) { // compute the kinematics; this is external to htraj @@ -188,7 +176,7 @@ namespace mu2e { } // DNB: the timeOffset() should NOT be added to time(), it is a double correction. // I'm leaving for now as the production was run with this error FIXME! - +*/ // compute the overlap between 2 clusters double overlap(SHIV const& shiv1, SHIV const& shiv2) { double over(0.0); @@ -204,7 +192,7 @@ namespace mu2e { } return over/norm; } - + double overlap(TimeCluster const& tc1, TimeCluster const& tc2) { double hover = overlap(tc1._strawHitIdxs,tc2._strawHitIdxs); double norm = std::min(tc1.hits().size(),tc2.hits().size()); @@ -217,7 +205,7 @@ namespace mu2e { } return over/norm; } - + /* double overlap(KalSeed const& ks1, KalSeed const& ks2) { // translate hit info into a simple index array. Only count active hits SHIV shiv1, shiv2; @@ -314,9 +302,9 @@ namespace mu2e { } } /* if (ihit->nStrawHits()>=2) { - ++ndactive; - } - */ + // ++ndactive; + // } + // std::cout << "AE: ihit->nStrawHits() = " << ihit->nStrawHits() << std::endl; const auto& jhit = ihit+1; const auto& hhit = ihit-1; @@ -360,10 +348,11 @@ namespace mu2e { } } return tch; - } + }*/ double energy(double mass, double momentum) { return sqrt(momentum*momentum + mass*mass); } double beta(double mass, double momentum) { return fabs(momentum)/energy(mass,momentum); } double betagamma(double mass, double momentum) { return fabs(momentum)/mass; } double gamma(double mass, double momentum) { return energy(mass,momentum)/mass; } } // TrkUtilities }// mu2e + From c591472f196b8e5d0bd53c17d405d314146e3c30 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 15 Apr 2025 23:09:34 -0700 Subject: [PATCH 012/174] deleted TrkPrintUtils. Removed unused BTrk import in TrkTimeCalculator --- CalPatRec/src/HlPrint_ComboHit.cc | 1 - TrkReco/CMakeLists.txt | 1 - TrkReco/inc/TrkPrintUtils.hh | 42 ----- TrkReco/src/TrkPrintUtils.cc | 272 ------------------------------ TrkReco/src/TrkTimeCalculator.cc | 1 - 5 files changed, 317 deletions(-) delete mode 100644 TrkReco/inc/TrkPrintUtils.hh delete mode 100644 TrkReco/src/TrkPrintUtils.cc diff --git a/CalPatRec/src/HlPrint_ComboHit.cc b/CalPatRec/src/HlPrint_ComboHit.cc index 4207ab00e6..ffe7f0631d 100644 --- a/CalPatRec/src/HlPrint_ComboHit.cc +++ b/CalPatRec/src/HlPrint_ComboHit.cc @@ -12,7 +12,6 @@ #include "Offline/MCDataProducts/inc/StrawDigiMC.hh" #include "Offline/MCDataProducts/inc/StrawGasStep.hh" -#include "Offline/TrkReco/inc/TrkPrintUtils.hh" using namespace std; diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index 790abbe414..1041ce987d 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -4,7 +4,6 @@ cet_make_library( src/PanelStateIterator.cc src/RobustHelixFinderData.cc src/RobustHelixFit.cc - src/TrkPrintUtils.cc src/TrkTimeCalculator.cc src/TrkUtilities.cc LIBRARIES PUBLIC diff --git a/TrkReco/inc/TrkPrintUtils.hh b/TrkReco/inc/TrkPrintUtils.hh deleted file mode 100644 index 1e833b22d3..0000000000 --- a/TrkReco/inc/TrkPrintUtils.hh +++ /dev/null @@ -1,42 +0,0 @@ -// -// Collection of tools useful for dealing with various tracking functions -// -#ifndef TrkReco_TrkPrintUtils_HH -#define TrkReco_TrkPrintUtils_HH - -#include "fhiclcpp/ParameterSet.h" - -#include "BTrk/KalmanTrack/KalRep.hh" -// #include "Mu2eUtilities/inc/McUtilsToolBase.hh" - -#include - -namespace art { - class Event; -} - -namespace mu2e { - - class McUtilsToolBase; - - class TrkPrintUtils { - protected: - int _mcTruth; - std::unique_ptr _mcUtils; - std::string _strawHitCollTag; - - public: - TrkPrintUtils(const fhicl::ParameterSet& PSet); - ~TrkPrintUtils(); - //----------------------------------------------------------------------------- - // Option = "" : print banner + track parameters (but not hits) - // includes "banner" : print banner - // includes "data" : print track parameters - // includes "hits : print hits - // if Message is not empty, it is also printed - //----------------------------------------------------------------------------- - void printTrack(const art::Event* event, const KalRep* Krep, const char* Option = "", const char* Message = ""); - }; -} - -#endif diff --git a/TrkReco/src/TrkPrintUtils.cc b/TrkReco/src/TrkPrintUtils.cc deleted file mode 100644 index 1ef4928358..0000000000 --- a/TrkReco/src/TrkPrintUtils.cc +++ /dev/null @@ -1,272 +0,0 @@ -// - - -#include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh" -#include "Offline/TrkReco/inc/TrkPrintUtils.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" - -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/BTrkData/inc/TrkCaloHit.hh" - -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -//CLHEP - -#include "CLHEP/Vector/ThreeVector.h" - -//art -#include "art/Utilities/ToolMacros.h" -#include "art/Utilities/make_tool.h" - -#include -#include - -namespace mu2e { - - //----------------------------------------------------------------------------- - TrkPrintUtils::TrkPrintUtils(const fhicl::ParameterSet& PSet) { - _mcTruth = PSet.get("mcTruth"); - _strawHitCollTag = PSet.get("strawHitCollTag"); - - if (_mcTruth != 0) { - fhicl::ParameterSet ps = PSet.get("mcUtils"); - _mcUtils = art::make_tool (ps); - } - else { - _mcUtils = std::make_unique(); - } - } - - //----------------------------------------------------------------------------- - TrkPrintUtils::~TrkPrintUtils() { - } - - //----------------------------------------------------------------------------- - // '*' in front of the hit drift radius: the hit drift sign is not defined - // and the drift ambiguity has been set to 0 - // '?': the drift sign determined by the resolver is different from the MC truth - // Option = "" : print banner + track parameters (but not hits) - // includes "banner" : print banner - // includes "data" : print track parameters - // includes "hits : print hits - //----------------------------------------------------------------------------- - void TrkPrintUtils::printTrack(const art::Event* AnEvent, const KalRep* Trk, const char* Option, const char* Message) { - - const long unsigned int kNotFound = std::string::npos; - - if (Trk == NULL) return; - - std::string opt(Option); - - if (Message[0] != 0) printf("[TrkPrintUtils::printTrack] BEGIN called from %s \n",Message); - - int nhits = Trk->hitVector().size(); - - if ((opt == "") || (opt.find("banner") != kNotFound)) { - printf("-----------------------------------------------------------------------------------------"); - printf("-----------------------------------------------------------------\n"); - printf(" TrkID Address N NA P pT momerr costh T0 T0Err Omega"); - printf(" D0 Z0 Phi0 TanDip Chi2 MeanRes FCons\n"); - printf("-----------------------------------------------------------------------------------------"); - printf("-----------------------------------------------------------------\n"); - } - - if ((opt == "") || (opt.find("data") != kNotFound)) { - CLHEP::Hep3Vector trk_mom; - - double h1_fltlen = Trk->firstHit()->kalHit()->hit()->fltLen() - 10; - trk_mom = Trk->momentum(h1_fltlen); - double mom = trk_mom.mag(); - double pt = trk_mom.perp(); - - BbrVectorErr merr = Trk->momentumErr(h1_fltlen); - CLHEP::Hep3Vector momdir = trk_mom.unit(); - - CLHEP::HepVector momvec(3); - for (int i=0; i<3; i++) momvec[i] = momdir[i]; - - double momerr = sqrt(merr.covMatrix().similarity(momvec)); - - double costh = trk_mom.cosTheta(); - double chi2 = Trk->chisq(); - int nhits = Trk->hitVector().size(); - int nactive = Trk->nActive(); - double t0 = Trk->t0().t0(); - double t0err = Trk->t0().t0Err(); - //----------------------------------------------------------------------------- - // in all cases define momentum at lowest Z - ideally, at the tracker front plane - //----------------------------------------------------------------------------- - double s1 = Trk->firstHit()->kalHit()->hit()->fltLen(); - double s2 = Trk->lastHit ()->kalHit()->hit()->fltLen(); - double s = std::min(s1,s2); - - double d0 = Trk->helix(s).d0(); - double z0 = Trk->helix(s).z0(); - double phi0 = Trk->helix(s).phi0(); - double omega = Trk->helix(s).omega(); - double tandip = Trk->helix(s).tanDip(); - - double fit_consistency = Trk->chisqConsistency().consistency(); - int q = Trk->charge(); - - double sr2 (0); - - for (int i=0; i (Trk->hitVector().at(i)); - if ((hit == nullptr) || (! hit->isActive())) continue; - //------------------------------------------------------------------------------ - // this is an active track straw hit - //----------------------------------------------------------------------------- - double res, sigres; - bool hasres = hit->resid(res, sigres, true); - if (hasres) { - sr2 += res*res; - } - } - - double mean_res = sqrt(sr2/nactive); - - printf("%5i %16p %3i %3i %8.3f %7.3f %8.4f %8.4f %7.3f %7.4f", - -1, - static_cast(Trk), - nhits, - nactive, - q*mom,pt,momerr,costh,t0,t0err - ); - - printf(" %8.5f %8.3f %8.3f %8.4f %7.4f",omega,d0,z0,phi0,tandip - ); - printf(" %8.3f %7.4f %10.3e\n",chi2,mean_res,fit_consistency); - } - - if (opt.find("hits") == kNotFound) return; - //----------------------------------------------------------------------------- - // print detailed information about the track hits - //----------------------------------------------------------------------------- - printf("----------------------------------------------------------------------"); - printf("----------------------------------------------------------------"); - printf("------------------------------------------------------------------------\n"); - printf(" ih SId Flag A len x y z HitT "); - printf(" Pl Pn L W T0 Xs Ys Zs resid sigres"); - printf(" Rdrift mcdoca totErr rdrErr t0Err penErr extErr vinst simID\n"); - printf("----------------------------------------------------------------------"); - printf("----------------------------------------------------------------"); - printf("------------------------------------------------------------------------\n"); - - TrkStrawHit *hit; - CLHEP::Hep3Vector pos; - const ComboHit *sh; - const Straw *straw; - int ihit; - double len; - HepPoint plen; - - - auto shcH = AnEvent->getValidHandle(_strawHitCollTag); - const ComboHitCollection* shcol = shcH.product(); - - ihit = 0; - for (int it=0; it (Trk->hitVector().at(it)); - if (hit != 0) { - //------------------------------------------------------------------------------ - // this is a track hit - //----------------------------------------------------------------------------- - sh = &hit->comboHit(); // in reality, 'sh' is a single straw hit - straw = &hit->straw(); - //----------------------------------------------------------------------------- - // as the straw hit doesn't store its index in a collection, determine it - // assuming that the straw hit collection in a vector - //----------------------------------------------------------------------------- - int loc = sh-&shcol->at(0); - - hit->hitPosition(pos); - - len = hit->fltLen(); - plen = Trk->position(len); - - int sim_id = _mcUtils->strawHitSimId(AnEvent,loc); - double mcdoca = _mcUtils->mcDoca (AnEvent,hit); // loc,straw); - - ihit += 1; - printf("%4i %5i 0x%08x %1i %9.3f %8.3f %8.3f %9.3f %8.3f", - ihit, - straw->id().asUint16(), - hit->hitFlag(), - hit->isActive(), - len, - plen.x(),plen.y(),plen.z(), - sh->time() - ); - - printf(" %2i %2i %1i %2i", - straw->id().getPlane(), - straw->id().getPanel(), - straw->id().getLayer(), - straw->id().getStraw() - ); - - printf(" %8.3f",hit->hitT0().t0()); - - double res, sigres; - bool hasres = hit->resid(res, sigres, true); - - if (hasres) { - printf(" %8.3f %8.3f %9.3f %7.3f %7.3f", - pos.x(), - pos.y(), - pos.z(), - res, - sigres - ); - } - else { - printf(" %8.3f %8.3f %9.3f %7s %7s", - pos.x(), - pos.y(), - pos.z(), - " - ", - " - " - ); - } - - if (hit->ambig() == 0) printf(" * %6.3f",hit->driftRadius()); - else if (hit->ambig()*mcdoca > 0) printf(" %6.3f",hit->driftRadius()*hit->ambig()); - else printf(" ? %6.3f",hit->driftRadius()*hit->ambig()); - - float extErr(-1.); - if (hit->isActive()) extErr = hit->temperature()*0.0625; // external error, assume same for all hits - - printf(" %7.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.4f %10i\n", - mcdoca, - hit->totalErr(), - hit->driftRadiusErr(), - hit->t0Err(), - hit->penaltyErr(), - extErr, - hit->driftVelocity(), - sim_id - ); - } - else { - TrkCaloHit const* chit = dynamic_cast (Trk->hitVector().at(it)); - if (chit != 0) { - //----------------------------------------------------------------------------- - // calorimeter hit - //----------------------------------------------------------------------------- - double res, sigres; - bool hasres = chit->resid(res, sigres, true); - printf("TrkCaloHit, time = %10.3f hitT0 = %10.3g +/- %10.3f", - chit->time(), chit->hitT0().t0(),chit->hitT0().t0Err()); - - if (hasres) printf(" resid = %10.3f +- %10.3f\n",res,sigres); - else printf(" no residual, hit error = %10.3f\n",chit->hitErr()); - } - } - } - } - -} diff --git a/TrkReco/src/TrkTimeCalculator.cc b/TrkReco/src/TrkTimeCalculator.cc index 077d848053..98e1201d4b 100644 --- a/TrkReco/src/TrkTimeCalculator.cc +++ b/TrkReco/src/TrkTimeCalculator.cc @@ -1,4 +1,3 @@ -#include "BTrk/BaBar/BaBar.hh" #include "Offline/TrkReco/inc/TrkTimeCalculator.hh" #include "CLHEP/Units/PhysicalConstants.h" #include "Offline/GeometryService/inc/GeomHandle.hh" From 82aafe78a3ac2c85ed139c2f800ae1f671cb9a27 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 19 Apr 2025 21:16:36 -0700 Subject: [PATCH 013/174] deleted PanelStateIterator and PanelAmbigStructs --- TrkReco/CMakeLists.txt | 16 ++-- TrkReco/inc/PanelStateIterator.hh | 40 ---------- TrkReco/src/PanelAmbigStructs.cc | 127 ------------------------------ TrkReco/src/PanelStateIterator.cc | 76 ------------------ TrkReco/src/classes.h | 2 +- TrkReco/src/classes_def.xml | 26 ------ 6 files changed, 9 insertions(+), 278 deletions(-) delete mode 100644 TrkReco/inc/PanelStateIterator.hh delete mode 100644 TrkReco/src/PanelAmbigStructs.cc delete mode 100644 TrkReco/src/PanelStateIterator.cc delete mode 100644 TrkReco/src/classes_def.xml diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index 1041ce987d..130923865b 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -1,7 +1,7 @@ cet_make_library( SOURCE - src/PanelAmbigStructs.cc - src/PanelStateIterator.cc +# src/PanelAmbigStructs.cc +# src/PanelStateIterator.cc src/RobustHelixFinderData.cc src/RobustHelixFit.cc src/TrkTimeCalculator.cc @@ -91,12 +91,12 @@ cet_build_plugin(TrkRecoMcUtils art::tool Offline::TrackerGeom ) -art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults - CLASSES_DEF_XML ${CMAKE_CURRENT_SOURCE_DIR}/src/classes_def.xml - CLASSES_H ${CMAKE_CURRENT_SOURCE_DIR}/src/classes.h - DICTIONARY_LIBRARIES - Offline::TrkReco -) +#art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults +# CLASSES_DEF_XML ${CMAKE_CURRENT_SOURCE_DIR}/src/classes_def.xml +# CLASSES_H ${CMAKE_CURRENT_SOURCE_DIR}/src/classes.h +# DICTIONARY_LIBRARIES +# Offline::TrkReco +#) install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/TrkReco/inc/PanelStateIterator.hh b/TrkReco/inc/PanelStateIterator.hh deleted file mode 100644 index 8c94637a13..0000000000 --- a/TrkReco/inc/PanelStateIterator.hh +++ /dev/null @@ -1,40 +0,0 @@ -// -// class to define a set of allowed panel states and allow iterating through them -// This also interacts with the hits themselves -// Dave Brown -#ifndef mu2e_PanelAmbig_PanelStateIterator_HH -#define mu2e_PanelAmbig_PanelStateIterator_HH -#include "Offline/TrkReco/inc/PanelAmbigStructs.hh" - -namespace mu2e { - namespace PanelAmbig { - - class PanelStateIterator { - public: - PanelStateIterator() = default; - // construct from a vector of TrkStrawHits and the list of allowed hit states. - PanelStateIterator(TSHUIV const& uinfo, HSV const& allowed); - // copy constructor - PanelStateIterator(PanelStateIterator const& other) = default; - PanelStateIterator& operator =(PanelStateIterator const& other) = default; - // current state - PanelState current() { return *_current; } - // total # of states - size_t nStates() const { return _allowedPS.size(); } - // operate on the current state - bool increment() { ++_current; return _current != _allowedPS.end(); } - void reset() { _current = _allowedPS.begin(); } - private: - // helper functions; - bool increment(HSV& hsv); - bool increment(HitState& hs); - void reset(HitState& hs); - PSV::iterator _current; // current panel state - TSHUIV _uinfo; // information about the panel hits - PSV _allowedPS; // all allowed states for this panel - HSV _allowedHS; // allowed hit states - }; - - } // PanelAmbig namespace -} // mu2e namespace -#endif diff --git a/TrkReco/src/PanelAmbigStructs.cc b/TrkReco/src/PanelAmbigStructs.cc deleted file mode 100644 index 968c21ffbd..0000000000 --- a/TrkReco/src/PanelAmbigStructs.cc +++ /dev/null @@ -1,127 +0,0 @@ -// -// Object to allow exhaustively iterating over state permutations of a set of TrkStrawHits -// -// -// Original author David Brown, LBNL -// -#include "Offline/TrkReco/inc/PanelAmbigStructs.hh" -#include "cetlib_except/coded_exception.h" -#include -#include - -namespace mu2e -{ - namespace PanelAmbig { - - HitState::HitState(int ambig, bool active) { - if(!active) - _state = inactive; - else { - if(ambig > 0) - _state = posambig; - else if(ambig < 0) - _state = negambig; - else - _state = noambig; - } - } - - HitState::HitState(const TrkStrawHit* tsh) { - if(tsh->isActive()){ - if(tsh->ambig() < 0) - _state = negambig; - else if(tsh->ambig() > 0) - _state = posambig; - else - _state = noambig; - } else - _state = inactive; - } - - bool HitState::setHitState(TrkStrawHit* tsh) const { - bool oldactive = tsh->isActive(); - int oldambig = tsh->ambig(); - if(tsh != 0){ - switch (_state) { - default: - break; - case noambig: - tsh->setActivity(true); - tsh->setAmbig(0); - break; - case negambig: - tsh->setActivity(true); - tsh->setAmbig(-1); - break; - case posambig: - tsh->setActivity(true); - tsh->setAmbig(1); - break; - case inactive: - tsh->setActivity(false); - break; - } - } - return !(oldactive == tsh->isActive() && oldambig == tsh->ambig()); - } - - PanelResult::PanelResult(PanelState const& state) : _state(state), - _chisq(-1.0), _status(-1), _hpat(null), _statechange(0) { - // classify the state. If any hits are opposite, it's opposite. Otherwise if at least 2 - // are on the same side, they are same. Otherwise it is null - for(size_t ihit=0;ihit<_state.size();++ihit){ - for(size_t jhit=ihit+1;jhit<_state.size();++jhit){ - int hprod = static_cast(_state[ihit]._state) * - static_cast(_state[jhit]._state); - if(hprod < 0){ - _hpat = opposite; - break; - } else if(hprod > 0) - _hpat = same; - } - if(_hpat == opposite)break;// double break - } - } - - TSHUInfo::TSHUInfo(const TrkStrawHit* tsh,CLHEP::Hep3Vector const& udir, HepPoint const& uorigin) : _use(free), _hstate(tsh) { - // find wire position at POCA - HepPoint wpos = tsh->hitTraj()->position(tsh->hitLen()); - CLHEP::Hep3Vector wposv(wpos.x(),wpos.y(),wpos.z()); - // translate WRT origin and project - CLHEP::Hep3Vector dstraw = wpos-uorigin; - _upos = udir.dot(dstraw); - _wcpos = udir.dot(wposv); - // note that the t0 component of the error scales coherently between the hits, so here we use only the intrinsic error - _uerr = tsh->hitErr(); - _uwt = 1.0/(_uerr*_uerr); - _dr = tsh->driftRadius(); - _dv = tsh->driftVelocity(); - _ambig = tsh->ambig(); - _active = tsh->isActive(); - _index = tsh->index(); - } - - unsigned ipow(unsigned base, unsigned exp) { - unsigned result = 1; - while (exp) - { - if (exp & 1) - result *= base; - exp >>= 1; - base *= base; - } - return result; - } - - bool setHitStates(PanelState const& pstate, TrkStrawHitVector& hits) { - bool retval(false); // assume nothing changes - if(pstate.size() != hits.size()) - throw cet::exception("RECO")<<"mu2e::PanelAmbigResolver: state size doesn't match" << std::endl; - for(size_t ihit=0;ihit - -namespace mu2e { - namespace PanelAmbig { - - PanelStateIterator::PanelStateIterator(TSHUIV const& uinfo, HSV const& allowed) : _uinfo(uinfo), _allowedHS(allowed) { - // reserve enough space - _allowedPS.reserve(ipow(_allowedHS.size(),_uinfo.size())); - // setup an initial panel state. The order follows the uinfo - PanelState pstate; - pstate.reserve(_uinfo.size()); - for(auto tshui : _uinfo) { - if(tshui._use == TSHUInfo::free) - // free hits are initialized to the first allowed state - pstate.push_back(_allowedHS.front()); - else - // fixed or unused hits are kept at the initial state - pstate.push_back(tshui._hstate); - } - // this is the 1st panel state - _allowedPS.push_back(pstate); - // iterate over all possible states and record them - while(increment(pstate)) { - _allowedPS.push_back(pstate); - } - // set current to the 1st allowed state - reset(); - } - - bool PanelStateIterator::increment(PanelState& pstate) { - bool retval(false); // default is failure - size_t ihit=0; - do { - if(_uinfo[ihit]._use == TSHUInfo::free){ - HitState& hs = pstate[ihit]; - if(increment(hs)){ - retval = true; - break; - } else { - // we're at the end of allowed states for this hit; reset it and try incrementing the next - reset(hs); - ++ihit; - } - } else - ++ihit; // skip hits not free to change - } while(ihit < pstate.size()); - return retval; - } - - bool PanelStateIterator::increment(HitState& hs) { - bool retval(false); - // find iterator to this state in the allowed states - HSV::const_iterator ihs = std::find(_allowedHS.begin(), _allowedHS.end(),hs); - // try incrementing: if successful, update the hit state, and we're done - if(ihs != _allowedHS.end()) ++ihs; - if(ihs != _allowedHS.end()){ - // success: update state - hs = *ihs; - retval = true; - } - return retval; - } - - void PanelStateIterator::reset(HitState& hs) { - hs = _allowedHS[0]; - } - - } // PanelAmbig namespace -} // mu2e namespace - diff --git a/TrkReco/src/classes.h b/TrkReco/src/classes.h index 3027a3896c..9cd10d8771 100644 --- a/TrkReco/src/classes.h +++ b/TrkReco/src/classes.h @@ -6,4 +6,4 @@ #include "BTrk/KalmanTrack/KalRep.hh" #include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/TrkReco/inc/PanelAmbigStructs.hh" +//#include "Offline/TrkReco/inc/PanelAmbigStructs.hh" diff --git a/TrkReco/src/classes_def.xml b/TrkReco/src/classes_def.xml deleted file mode 100644 index 4c855a755f..0000000000 --- a/TrkReco/src/classes_def.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - From 484ad8f04eb2b2c7791f93747c2f59155df49bb0 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 22 Apr 2025 21:39:10 -0700 Subject: [PATCH 014/174] got rid of all BTrk references in TrkPatRec and TrkReco --- TrkPatRec/CMakeLists.txt | 110 +- TrkPatRec/inc/KalFinalFit_types.hh | 50 - TrkPatRec/inc/TrkHitFilter.hh | 1 - TrkPatRec/src/KalFinalFitDiag_tool.cc | 491 -------- TrkPatRec/src/KalFinalFit_module.cc | 721 ------------ TrkPatRec/src/KalSeedFitDiag_tool.cc | 249 ---- TrkPatRec/src/KalSeedFit_module.cc | 569 --------- TrkPatRec/src/RobustHelixFinderDiag_tool.cc | 3 - TrkPatRec/src/RobustHelixFinder_module.cc | 1 - TrkReco/inc/PanelAmbigStructs.hh | 113 -- TrkReco/src/TrkRecoMcUtils_tool.cc | 1162 ------------------- 11 files changed, 55 insertions(+), 3415 deletions(-) delete mode 100644 TrkPatRec/inc/KalFinalFit_types.hh delete mode 100644 TrkPatRec/src/KalFinalFitDiag_tool.cc delete mode 100644 TrkPatRec/src/KalFinalFit_module.cc delete mode 100644 TrkPatRec/src/KalSeedFitDiag_tool.cc delete mode 100644 TrkPatRec/src/KalSeedFit_module.cc delete mode 100644 TrkReco/inc/PanelAmbigStructs.hh delete mode 100644 TrkReco/src/TrkRecoMcUtils_tool.cc diff --git a/TrkPatRec/CMakeLists.txt b/TrkPatRec/CMakeLists.txt index b69049e2ba..5bd366383e 100644 --- a/TrkPatRec/CMakeLists.txt +++ b/TrkPatRec/CMakeLists.txt @@ -1,6 +1,6 @@ cet_make_library(INTERFACE INSTALLED_PATH_BASE Offline SOURCE - inc/KalFinalFit_types.hh + #inc/KalFinalFit_types.hh inc/KalSeedFit_types.hh inc/RobustHelixFinder_types.hh inc/RobustMultiHelixFinder_types.hh @@ -10,42 +10,42 @@ cet_make_library(INTERFACE INSTALLED_PATH_BASE Offline ) -cet_build_plugin(KalFinalFit art::module - REG_SOURCE src/KalFinalFit_module.cc - LIBRARIES REG - Offline::TrkPatRec - - Offline::BTrkData - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeneralUtilities - Offline::GeometryService - Offline::Mu2eUtilities - Offline::ProditionsService - Offline::RecoDataProducts - Offline::TrackerConditions - Offline::TrackerGeom - Offline::TrkReco -) +#cet_build_plugin(KalFinalFit art::module +# REG_SOURCE src/KalFinalFit_module.cc +# LIBRARIES REG +# Offline::TrkPatRec +# +# Offline::BTrkData +# Offline::CalorimeterGeom +# Offline::DataProducts +# Offline::GeneralUtilities +# Offline::GeometryService +# Offline::Mu2eUtilities +# Offline::ProditionsService +# Offline::RecoDataProducts +# Offline::TrackerConditions +# Offline::TrackerGeom +# Offline::TrkReco +#) -cet_build_plugin(KalSeedFit art::module - REG_SOURCE src/KalSeedFit_module.cc - LIBRARIES REG - Offline::TrkPatRec +#cet_build_plugin(KalSeedFit art::module +# REG_SOURCE src/KalSeedFit_module.cc +# LIBRARIES REG +# Offline::TrkPatRec - Offline::BFieldGeom - Offline::BTrkData - Offline::ConditionsService - Offline::DataProducts - Offline::GeneralUtilities - Offline::GeometryService - Offline::Mu2eUtilities - Offline::ProditionsService - Offline::RecoDataProducts - Offline::TrackerConditions - Offline::TrackerGeom - Offline::TrkReco -) +# Offline::BFieldGeom +# Offline::BTrkData +# Offline::ConditionsService +# Offline::DataProducts +# Offline::GeneralUtilities +# Offline::GeometryService +# Offline::Mu2eUtilities +# Offline::ProditionsService +# Offline::RecoDataProducts +# Offline::TrackerConditions +# Offline::TrackerGeom +# Offline::TrkReco +#) cet_build_plugin(RobustHelixFinder art::module REG_SOURCE src/RobustHelixFinder_module.cc @@ -103,27 +103,27 @@ cet_build_plugin(TimeClusterFinder art::module Offline::TrkReco ) -cet_build_plugin(KalFinalFitDiag art::tool - REG_SOURCE src/KalFinalFitDiag_tool.cc - LIBRARIES REG - Offline::TrkPatRec - - Offline::BTrkData - Offline::CalorimeterGeom - Offline::Mu2eUtilities - Offline::TrackerGeom - Offline::TrkReco -) +#cet_build_plugin(KalFinalFitDiag art::tool +# REG_SOURCE src/KalFinalFitDiag_tool.cc +# LIBRARIES REG +# Offline::TrkPatRec +# +# Offline::BTrkData +# Offline::CalorimeterGeom +# Offline::Mu2eUtilities +# Offline::TrackerGeom +# Offline::TrkReco +#) -cet_build_plugin(KalSeedFitDiag art::tool - REG_SOURCE src/KalSeedFitDiag_tool.cc - LIBRARIES REG - Offline::TrkPatRec - - Offline::BTrkData - Offline::Mu2eUtilities - Offline::TrkReco -) +#cet_build_plugin(KalSeedFitDiag art::tool +# REG_SOURCE src/KalSeedFitDiag_tool.cc +# LIBRARIES REG +# Offline::TrkPatRec +# +# Offline::BTrkData +# Offline::Mu2eUtilities +# Offline::TrkReco +#) cet_build_plugin(RobustHelixFinderDiag art::tool REG_SOURCE src/RobustHelixFinderDiag_tool.cc diff --git a/TrkPatRec/inc/KalFinalFit_types.hh b/TrkPatRec/inc/KalFinalFit_types.hh deleted file mode 100644 index ab45f9e424..0000000000 --- a/TrkPatRec/inc/KalFinalFit_types.hh +++ /dev/null @@ -1,50 +0,0 @@ -/* -#ifndef TrkPatRec_KalFinalFit_types_hh -#define TrkPatRec_KalFinalFit_types_hh - -#include "TObject.h" -#include "TH1.h" - -#include -#include "Offline/BTrkData/inc/Doublet.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalSeed.hh" - -namespace art { - class Event; -} - -namespace mu2e { - - class KalFitData; - class Tracker; - class Calorimeter; - class DoubletAmbigResolver; - - namespace KalFinalFitTypes { - - struct Data_t { - const art::Event* event; - const Tracker* tracker; - const Calorimeter* calorimeter; - fhicl::ParameterSet* timeOffsets; - - KalFitData* result; - KalRepCollection* tracks; - KalSeedCollection* kscol; - std::vector* listOfDoublets; - DoubletAmbigResolver* dar; - int eventNumber; - - unsigned tchDiskId; - unsigned tchAdded; - double tchDepth; - double tchDOCA; - double tchDt; - double tchTrkPath; - double tchEnergy; - }; - } -} -#endif -*/ diff --git a/TrkPatRec/inc/TrkHitFilter.hh b/TrkPatRec/inc/TrkHitFilter.hh index 6e6b924b70..3f4236a648 100644 --- a/TrkPatRec/inc/TrkHitFilter.hh +++ b/TrkPatRec/inc/TrkHitFilter.hh @@ -5,7 +5,6 @@ // struct for outlier search tuple #ifndef TrkHitFilter_hh #define TrkHitFilter_hh -#include "BTrk/BaBar/BaBar.hh" #include "CLHEP/Vector/ThreeVector.h" #include "Rtypes.h" diff --git a/TrkPatRec/src/KalFinalFitDiag_tool.cc b/TrkPatRec/src/KalFinalFitDiag_tool.cc deleted file mode 100644 index d4b332e562..0000000000 --- a/TrkPatRec/src/KalFinalFitDiag_tool.cc +++ /dev/null @@ -1,491 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// diag mode: = 0 - most of the histograms -// = 1 - doca histograms -/////////////////////////////////////////////////////////////////////////////// -/* -#include "TH2.h" -#include "TH1.h" - -#include "fhiclcpp/ParameterSet.h" - -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Matrix/SymMatrix.h" -#include "CLHEP/Vector/ThreeVector.h" - -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/KalmanTrack/KalRep.hh" - -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - -#include "Offline/BTrkData/inc/Doublet.hh" -#include "BTrk/KalmanTrack/KalHit.hh" - -#include "Offline/TrkPatRec/inc/KalFinalFit_types.hh" -#include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh" -#include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" -#include "Offline/TrkReco/inc/KalFitData.hh" -#include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" - -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" - -#include "art/Utilities/ToolMacros.h" -#include "art/Utilities/make_tool.h" -#include "art/Framework/Principal/Event.h" - -using CLHEP::HepVector; -using CLHEP::HepSymMatrix; - -namespace mu2e { - using namespace KalFinalFitTypes; - - class KalFinalFitDiag : public mu2e::ModuleHistToolBase { - public: - enum { - kNEventHistSets = 10, - kNTrackHistSets = 20, - kNDoubletHistSets = 10, - kNHitHistSets = 10 - }; - - struct EventHist_t { - TH1F* ntracks; - }; - - struct TrackHist_t { - TH1F* nhits ; - TH1F* chi2dof; - TH1F* p ; - TH1F* tchDiskId[2]; - TH1F* tchAdded ; - TH1F* tchDepth [2]; - TH1F* tchDoca [2]; - TH1F* tchDt [2]; - TH1F* trkPath [2]; - TH1F* tchEnergy[2]; - TH1F* tchEp [2]; - }; - - struct DoubletHist_t { - TH1F* dSlope; - TH1F* chi2bc; // coordinate part of the best chi2 - TH1F* chi2bs; // angular part of the best chi2 - TH1F* chi2b ; // best chi2 - TH1F* chi2r ; // chi2_best/chi2_next - }; - - struct HitData_t { - float doca; - float mcdoca; - float rdrift; - float dtCls; - }; - - struct HitHist_t { - TH1F* doca; - TH1F* xdoca; // doca/hit_error - TH2F* doca_vs_mcdoca; - TH2F* rdrift_vs_mcdoca; - TH1F* dtCls; - }; - - struct Hist_t { - EventHist_t* _event [kNEventHistSets ]; - TrackHist_t* _track [kNTrackHistSets ]; - DoubletHist_t* _doublet[kNDoubletHistSets]; - HitHist_t* _hit [kNHitHistSets ]; - }; - - protected: - int _mcTruth; - std::unique_ptr _mcUtils; - std::string _shDigiLabel; - Hist_t _hist; // owned - Data_t* _data; - - public: - - KalFinalFitDiag(const fhicl::ParameterSet& PSet); - ~KalFinalFitDiag(); - - private: - - int bookEventHistograms (EventHist_t* Hist, art::TFileDirectory* Dir); - int bookTrackHistograms (TrackHist_t* Hist, art::TFileDirectory* Dir); - int bookDoubletHistograms(DoubletHist_t* Hist, art::TFileDirectory* Dir); - int bookHitHistograms (HitHist_t* Hist, art::TFileDirectory* Dir); - - int fillEventHistograms (EventHist_t* Hist, Data_t* Data); - int fillDoubletHistograms(DoubletHist_t* Hist, Doublet* D); - int fillHitHistograms (HitHist_t* Hist, HitData_t* Data); - int fillTrackHistograms (TrackHist_t* Hist, Data_t* Data, const KalRep*krep); - - virtual int bookHistograms(art::ServiceHandle& Tfs) override ; - virtual int fillHistograms(void* Data, int Mode = -1) override ; - }; - - KalFinalFitDiag::KalFinalFitDiag(const fhicl::ParameterSet& PSet) { - _mcTruth = PSet.get ("mcTruth"); - - if (_mcTruth != 0) _mcUtils = art::make_tool(PSet.get("mcUtils")); - else _mcUtils = std::make_unique(); - } - - //----------------------------------------------------------------------------- - KalFinalFitDiag::~KalFinalFitDiag() { - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::bookEventHistograms(EventHist_t* Hist, art::TFileDirectory* Dir) { - Hist->ntracks = Dir->make("ntracks", "number of track candidates: all events", 21, -0.5, 20.5); - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::bookDoubletHistograms(DoubletHist_t* Hist, art::TFileDirectory* Dir) { - Hist->dSlope = Dir->make("dslope", "Delta Slope" , 200, -1, 1); - Hist->chi2b = Dir->make("chi2b" , "chi2(best)" , 200, 0, 200); - Hist->chi2bc = Dir->make("chi2bc", "chi2_coord(best)" , 200, 0, 200); - Hist->chi2bs = Dir->make("chi2bs", "chi2_slope(best)" , 200, 0, 200); - Hist->chi2r = Dir->make("chi2r" , "chi2R (best/next) OS", 200, 0, 1); - - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::bookTrackHistograms(TrackHist_t* Hist, art::TFileDirectory* Dir) { - Hist->nhits = Dir->make("nhits", "N(track hits)" , 101, -0.5, 100.5); - Hist->chi2dof = Dir->make("chi2d", "track chi2/dof" , 100, 0. , 10.); - Hist->p = Dir->make("p" , "track momentum" , 400, 0. , 200.); - //histogromas for the TrackCaloHit - Hist->tchAdded = Dir->make("tchAdded " , "trackCaloHit: added in the end: added-later" , 2, 0. , 2.); - - Hist->tchDiskId[0] = Dir->make("tchDiskId0" , "trackCaloHit: diskId; diskId" , 3, 0. , 3.); - Hist->tchDepth [0] = Dir->make("tchDepth0 " , "trackCaloHit: hit-length" , 500, 0. , 500.); - Hist->tchDoca [0] = Dir->make("tchDoca0 " , "trackCaloHit: DOCA; DOCA [mm]" , 400, -200. , 200.); - Hist->tchDt [0] = Dir->make("tchDt0 " , "trackCaloHit: dt @ calo; dt [0] = t_{calo} - t_{trk} [ns]" , 400, -10. , 10.); - Hist->trkPath [0] = Dir->make("trkPath0 " , "trackCaloHit: track path length; trk-calo path [mm]" , 500, 0. , 500.); - Hist->tchEnergy[0] = Dir->make("tchEnergy0" , "trackCaloHit: energy; E [MeV]" , 240, 0. , 120.); - Hist->tchEp [0] = Dir->make("tchEp0" , "trackCaloHit: E/p; E/p" , 240, 0. , 1.2); - - Hist->tchDiskId[1] = Dir->make("tchDiskId1" , "trackCaloHit added lastly: diskId; diskId" , 3, 0. , 3.); - Hist->tchDepth [1] = Dir->make("tchDepth1 " , "trackCaloHit added lastly: hit-length" , 500, 0. , 500.); - Hist->tchDoca [1] = Dir->make("tchDoca1 " , "trackCaloHit added lastly: DOCA; DOCA [mm]" , 400, -200. , 200.); - Hist->tchDt [1] = Dir->make("tchDt1 " , "trackCaloHit added lastly: dt @ calo; dt [1] = t_{calo} - t_{trk} [ns]" , 400, -10. , 10.); - Hist->trkPath [1] = Dir->make("trkPath1 " , "trackCaloHit added lastly: track path length; trk-calo path [mm]" , 500, 0. , 500.); - Hist->tchEnergy[1] = Dir->make("tchEnergy1" , "trackCaloHit added lastly: energy; E [MeV]" , 240, 0. , 120.); - Hist->tchEp [1] = Dir->make("tchEp1" , "trackCaloHit added lastly: E/p; E/p" , 240, 0. , 1.2); - - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::bookHitHistograms(HitHist_t* Hist, art::TFileDirectory* Dir) { - Hist->doca = Dir->make("doca" ,"doca" , 1000, -20., 20 ); - Hist->xdoca = Dir->make("xdoca" ,"xdoca", 1000, -20., 20 ); - Hist->dtCls = Dir->make("dtCls" ,"dtCls; #Delta t = t_{calo-cluster}-t_{straw} - tof [ns]", 401, -200.5, 200.5 ); - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::bookHistograms(art::ServiceHandle& Tfs) { - char folder_name[20]; - - TH1::AddDirectory(0); - //----------------------------------------------------------------------------- - // book event-level histograms - fill them once per event - //----------------------------------------------------------------------------- - int book_event_histset[kNEventHistSets]; - for (int i=0; imkdir(folder_name); - - _hist._event[i] = new EventHist_t; - bookEventHistograms(_hist._event[i],&dir); - } - } - //----------------------------------------------------------------------------- - // book track histograms - //----------------------------------------------------------------------------- - int book_track_histset[kNTrackHistSets]; - for (int i=0; i 20 - book_track_histset[ 2] = 1; // nhits > 20 & p > 100 - - for (int i=0; imkdir(folder_name); - - _hist._track[i] = new TrackHist_t; - bookTrackHistograms(_hist._track[i],&dir); - } - } - //----------------------------------------------------------------------------- - // book doublet histograms - //----------------------------------------------------------------------------- - int book_doublet_histset[kNDoubletHistSets]; - for (int i=0; imkdir(folder_name); - - _hist._doublet[i] = new DoubletHist_t; - bookDoubletHistograms(_hist._doublet[i],&dir); - } - } - //----------------------------------------------------------------------------- - // book hit histograms - //----------------------------------------------------------------------------- - int book_hit_histset[kNHitHistSets]; - for (int i=0; imkdir(folder_name); - - _hist._hit[i] = new HitHist_t; - bookHitHistograms(_hist._hit[i],&dir); - } - } - - return 0; - } - - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::fillEventHistograms(EventHist_t* Hist, Data_t* Data) { - int ntrk = Data->tracks->size(); - Hist->ntracks->Fill(ntrk); - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::fillTrackHistograms(TrackHist_t* Hist, Data_t* Data, const KalRep*krep) { - - const TrkHitVector* thv = &(krep->hitVector()); - double h1_fltlen, hn_fltlen, entlen; - - h1_fltlen = krep->firstHit()->kalHit()->hit()->fltLen(); - hn_fltlen = krep->lastHit ()->kalHit()->hit()->fltLen(); - entlen = std::min(h1_fltlen,hn_fltlen); - - Hist->nhits ->Fill( thv->size()); - Hist->chi2dof ->Fill( krep->chisq()/(krep->nActive()-5.)); - Hist->p ->Fill( krep->momentum(entlen).mag()); - - if (Data->tchEnergy > 0){ - int tchAdd = Data->tchAdded; - Hist->tchAdded ->Fill( tchAdd); - Hist->tchDiskId[tchAdd] ->Fill( Data->tchDiskId); - Hist->tchDepth [tchAdd] ->Fill( Data->tchDepth); - Hist->tchDoca [tchAdd] ->Fill( Data->tchDOCA); - Hist->tchDt [tchAdd] ->Fill( Data->tchDt); - Hist->trkPath [tchAdd] ->Fill( Data->tchTrkPath); - Hist->tchEnergy[tchAdd] ->Fill( Data->tchEnergy); - Hist->tchEp [tchAdd] ->Fill( Data->tchEnergy/krep->momentum(entlen).mag()); - } - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::fillDoubletHistograms(DoubletHist_t* Hist, Doublet* D) { - - float chi2b = D->chi2Best (); - float chi2bc = D->chi2CoordBest(); - float chi2bs = D->chi2SlopeBest(); - float chi2r = chi2b/D->fChi2[D->fINext]; - - Hist->dSlope->Fill(D->bestDxDzRes()); - Hist->chi2b ->Fill(chi2b ); - Hist->chi2bc->Fill(chi2bc); - Hist->chi2bs->Fill(chi2bs); - - Hist->chi2r ->Fill(chi2r); - - return 0; - } - - //----------------------------------------------------------------------------- - int KalFinalFitDiag::fillHitHistograms(HitHist_t* Hist, HitData_t* HitData) { - Hist->doca ->Fill(HitData->doca ); - Hist->dtCls->Fill(HitData->dtCls); - return 0; - } - - //----------------------------------------------------------------------------- - // mode not used - //----------------------------------------------------------------------------- - int KalFinalFitDiag::fillHistograms(void* Data, int Mode) { - _data = (Data_t*) Data; - - HitData_t hitData; - //----------------------------------------------------------------------------- - // fill event histograms - //----------------------------------------------------------------------------- - fillEventHistograms(_hist._event[0],_data); - //----------------------------------------------------------------------------- - // fill track histograms - per-track, can't have the loop here - some are - // not reconstructed - //----------------------------------------------------------------------------- - int ntrk = _data->tracks->size(); - for (int i=0; itracks->at(i); - - fillTrackHistograms(_hist._track[0], _data, krep); - // hits on the track - - TrkHitVector const& hot_l = krep->hitVector(); - - krep->traj().getInfo(0.0,tpos,tdir); - // loop over track hits - int nhits = krep->hitVector().size(); - - if (nhits > 20) fillTrackHistograms(_hist._track[1], _data, krep); - double h1_fltlen, hn_fltlen, entlen; - - h1_fltlen = krep->firstHit()->kalHit()->hit()->fltLen(); - hn_fltlen = krep->lastHit ()->kalHit()->hit()->fltLen(); - entlen = std::min(h1_fltlen,hn_fltlen); - double mom = krep->momentum(entlen).mag(); - - if (nhits > 20 && mom>100.) fillTrackHistograms(_hist._track[2], _data, krep); - - //----------------------------------------------------------------------------- - // get the calorimeter cluster from the KalSeed - //----------------------------------------------------------------------------- - double z_cls(-99999), time_cls(-9999); - double pitchAngle(0.67);//FIX ME! that should be parsed from the fcl - double meanDriftTime = 1.25/0.06;// half straw tube radius / drift velocity - - const CaloCluster* cluster = _data->kscol->at(i).caloCluster().get(); - - if (cluster != 0) { - CLHEP::Hep3Vector gpos = _data->calorimeter->geomUtil().diskToMu2e(cluster->diskID(),cluster->cog3Vector()); - CLHEP::Hep3Vector cog_cluster = _data->calorimeter->geomUtil().mu2eToTracker(gpos); - - z_cls = cog_cluster.z(); // z-coordinate of the cluster in the tracker coordinate frame - time_cls = cluster->time(); - } - - for (int i=0; i (hot_l.at(i)); - int hIndex = hit->index(); - ComboHit const* sh = & _data->result->chcol->at(hIndex); - Straw const& straw = _data->tracker->getStraw(sh->strawId()); - const CLHEP::Hep3Vector& hpos = straw.getMidPoint(); - const CLHEP::Hep3Vector& hdir = straw.getDirection(); - - bool found(false); - - for (auto it=hot_l.begin(); it (*it); - if (!hit->isActive()) continue; - int hit_index = hit->index(); - if (hIndex == hit_index) { - found = true; - break; - } - } - //----------------------------------------------------------------------------- - // convert to HepPoint to satisfy antique BaBar interface: FIXME!!! - // estimate flight length along track. This assumes a constant BField!!! - //----------------------------------------------------------------------------- - HepPoint spt(hpos.x(),hpos.y(),hpos.z()); - TrkLineTraj htraj(spt,hdir,-20,20); - - double fltlen = (hpos.z()-tpos.z())/tdir.z(); - TrkPoca hitpoca(krep->traj(),fltlen,htraj,0.0); - - hitData.doca = hitpoca.doca(); - //----------------------------------------------------------------------------- - // estimate the time residual between the straw hit and the calorimeter cluster - // taking into account the hit TOF and mean drift time - //----------------------------------------------------------------------------- - double dt(-9999.), z_straw, time, tof; - if (cluster != 0){ - z_straw = hpos.z(); - time = sh->time(); - tof = (z_cls - z_straw)/sin(pitchAngle)/CLHEP::c_light; - dt = time_cls - (time + tof - meanDriftTime); - } - - hitData.dtCls = dt; - - if (found) fillHitHistograms(_hist._hit[0],&hitData); - else fillHitHistograms(_hist._hit[1],&hitData); - } - //----------------------------------------------------------------------------- - // doublet histograms - //----------------------------------------------------------------------------- - _data->dar->findDoublets(krep,_data->listOfDoublets); - - Doublet* d; - int nd = _data->listOfDoublets->size(); - - double mcdoca[2]; - //----------------------------------------------------------------------------- - // doublet stores TrkStrawHit's - //----------------------------------------------------------------------------- - for (int i=0; ilistOfDoublets->at(i); - if (d->fNStrawHits == 2) { - - int same_sign = d->isSameSign(); - int a0 = d->fHit[0]->ambig(); - int a1 = d->fHit[1]->ambig(); - - mcdoca[0] = _mcUtils->mcDoca(_data->event,d->fHit[0]); - mcdoca[1] = _mcUtils->mcDoca(_data->event,d->fHit[1]); - - // bool h1_ok = ((a0 != 0) && (a0*d->fMcDoca[0] > 0)); - // bool h2_ok = ((a1 != 0) && (a1*d->fMcDoca[1] > 0)); - - bool h1_ok = ((a0 != 0) && (a0*mcdoca[0] > 0)); - bool h2_ok = ((a1 != 0) && (a1*mcdoca[1] > 0)); - - if (! same_sign) { - // OS doublet - fillDoubletHistograms(_hist._doublet[0],d); - if (h1_ok && h2_ok) fillDoubletHistograms(_hist._doublet[1],d); - } - else { - // SS doublet - fillDoubletHistograms(_hist._doublet[2],d); - if (h1_ok && h2_ok) fillDoubletHistograms(_hist._doublet[3],d); - } - } - } - } - return 0; - } - - DEFINE_ART_CLASS_TOOL(KalFinalFitDiag) - -} -*/ diff --git a/TrkPatRec/src/KalFinalFit_module.cc b/TrkPatRec/src/KalFinalFit_module.cc deleted file mode 100644 index 83e4c91fb0..0000000000 --- a/TrkPatRec/src/KalFinalFit_module.cc +++ /dev/null @@ -1,721 +0,0 @@ -// -// Final Kalman fit -// -// Original author D. Brown and G. Tassielli -// -/* -// framework -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Core/EDProducer.h" -#include "art_root_io/TFileService.h" -#include "art/Utilities/make_tool.h" -// conditions -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/TrackerConditions/inc/StrawResponse.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -// utiliites -#include "Offline/GeneralUtilities/inc/Angles.hh" -#include "Offline/TrkReco/inc/TrkUtilities.hh" -#include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -// data -#include "Offline/DataProducts/inc/Helicity.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/KalSeed.hh" -#include "Offline/RecoDataProducts/inc/KalSeedAssns.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/TrkReco/inc/KalFitData.hh" -#include "Offline/TrkPatRec/inc/KalFinalFit_types.hh" -#include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" -// BaBar -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -// Mu2e BaBar -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/TrkReco/inc/KalFit.hh" -//CLHEP -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/Vector.h" -// root -#include "TH1F.h" -#include "TTree.h" -// C++ -#include -#include -#include -#include -#include -#include -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; - -namespace mu2e -{ - using namespace KalFinalFitTypes; - - class KalFinalFit : public art::EDProducer - { - public: - explicit KalFinalFit(fhicl::ParameterSet const&); - virtual ~KalFinalFit(); - void beginRun(art::Run& aRun); - private: - void produce(art::Event& event) override; - - unsigned _iev; - // configuration parameters - int _debug; - int _diag; - int _printfreq; - int _cprmode; - bool _saveall,_addhits; - vector _zsave; - // event object tokens - art::ProductToken const _shToken; - art::InputTag const _shfTag; - art::ProductToken const _shfToken; - art::ProductToken const _ksToken; - art::ProductToken const _khaToken; - art::ProductToken const _clToken; - // flags - StrawHitFlag _addsel; - StrawHitFlag _addbkg; - TrkFitFlag _goodseed; - double _maxdtmiss; - // outlier cuts - double _maxadddoca, _maxaddchi, _maxtchchi; - TrkParticle _tpart; // particle type being searched for - TrkFitDirection _fdir; // fit direction in search - // event objects - const ComboHitCollection* _chcol; - const StrawHitFlagCollection* _shfcol; - const KalSeedCollection * _kscol; - const KalHelixAssns * _khassns; - const CaloClusterCollection* _clCol; - // Kalman fitter - KalFit _kfit; - KalFitData _result; - - // diagnostic - Data_t _data; - std::unique_ptr _hmanager; - - // helper functions - bool findData(const art::Event& e); - void findMissingHits(KalFitData&kalData); - void findMissingHits_cpr(StrawResponse::cptr_t srep, KalFitData&kalData); - bool hasTrkCaloHit(KalFitData&kalData); - - ProditionsHandle _strawResponse_h; - ProditionsHandle _mu2eDetector_h; - ProditionsHandle _alignedTracker_h; - // flow diagnostic - }; - - KalFinalFit::KalFinalFit(fhicl::ParameterSet const& pset) : - art::EDProducer{pset}, - _debug(pset.get("debugLevel", 0)), - _diag(pset.get("diagLevel",0)), - _printfreq(pset.get("printFrequency", 101)), - _cprmode(pset.get("cprmode",0)), - _saveall(pset.get("saveall", false)), - _addhits(pset.get("addhits", true)), - _zsave(pset.get>("ZSavePositions", vector{-1522.0,0.0,1522.0})), // front, middle and back of the tracker - _shToken{consumes(pset.get("ComboHitCollection"))}, - _shfTag{pset.get("StrawHitFlagCollection", "none")}, - _shfToken{consumes(_shfTag)}, - _ksToken{consumes(pset.get("SeedCollection"))}, - _khaToken{consumes(pset.get("SeedCollection"))}, - _clToken{consumes(pset.get("CaloClusterCollection"))}, - _addsel(pset.get>("AddHitSelectionBits", vector{})), - _addbkg(pset.get>("AddHitBackgroundBits", vector{})), - _goodseed(pset.get>("GoodKalSeedFitBits", vector{})), - _maxdtmiss(pset.get("DtMaxMiss",40.0)), - _maxadddoca(pset.get("MaxAddDoca",2.75)), - _maxaddchi(pset.get("MaxAddChi",4.0)), - _tpart((TrkParticle::type)(pset.get("fitparticle", TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection", TrkFitDirection::downstream))), - _kfit(pset.get("KalFit", {})), - _result() - { - - produces(); - produces(); - //produces(); - produces(); - produces(); - //----------------------------------------------------------------------------- - // provide for interactive diagnostics - //----------------------------------------------------------------------------- - _data.result = &_result; - - if (_diag != 0) { - _hmanager = art::make_tool(pset.get("diagPlugin")); - fhicl::ParameterSet ps1 = pset.get("KalFit.DoubletAmbigResolver"); - _data.dar = new DoubletAmbigResolver(ps1,0,0,0); - _data.listOfDoublets = new std::vector; - // histogram booking belongs to beginJob, KalFinalFit doesn't have it - art::ServiceHandle tfs; - _hmanager->bookHistograms(tfs); - } - else { - _hmanager = std::make_unique(); - _data.dar = NULL; - _data.listOfDoublets = NULL; - } - } - - KalFinalFit::~KalFinalFit(){ - if (_data.dar) { - delete _data.listOfDoublets; - delete _data.dar; - } - } - //----------------------------------------------------------------------------- - void KalFinalFit::beginRun(art::Run& r) { - mu2e::GeomHandle ch; - _data.calorimeter = ch.get(); - - _kfit.setCalorimeter (_data.calorimeter); - _kfit.setCaloGeom(); - } - - - void KalFinalFit::produce(art::Event& event ) { - - auto srep = _strawResponse_h.getPtr(event.id()); - auto detmodel = _mu2eDetector_h.getPtr(event.id()); - - _data.tracker = _alignedTracker_h.getPtr(event.id()).get(); - _kfit.setTracker(_data.tracker); - - // event printout - _iev=event.id().event(); - if(_debug > 0 && (_iev%_printfreq)==0)cout<<"KalFinalFit: event="<<_iev< krcol(new KalRepCollection ); - unique_ptr krPtrcol(new KalRepPtrCollection ); - unique_ptr kscol(new KalSeedCollection()); - unique_ptr kfhassns (new KalHelixAssns()); - //unique_ptr shfcol(new StrawHitFlagCollection()); - // lookup productID for payload saver - art::ProductID kalRepsID(event.getProductID()); - auto KalSeedCollectionPID = event.getProductID(); - auto KalSeedCollectionGetter = event.productGetter(KalSeedCollectionPID); - // copy and merge hit flags - // size_t index(0); - //for(auto const& ch : *_chcol) { - // StrawHitFlag flag(ch.flag()); - // if(_shfcol != 0) flag.merge(_shfcol->at(index++)); - // shfcol->push_back(flag); - //} - - if (_diag!=0){ - _data.event = &event; - _data.eventNumber = event.event(); - _data.result = &_result; - _data.tracks = krcol.get(); - _data.kscol = kscol.get(); - } - - _result.fitType = 1; - _result.event = &event ; - _result.chcol = _chcol ; - //_result.shfcol = _shfcol ; - _result.shfcol = nullptr; // _shfcol ; - if (_kfit.useTrkCaloHit()) _result.caloClusterCol = _clCol; - // _result.tpart = _tpart ; - _result.fdir = _fdir ; - - // loop over the seed fits. I need an index loop here to build the Ptr - for(size_t ikseed=0; ikseed < _kscol->size(); ++ikseed) { - KalSeed const& kseed(_kscol->at(ikseed)); - _result.kalSeed = & kseed; - auto hptr = (*_khassns)[ikseed].second; // Ptr to the original HelixSeed - // _result.tpart = kseed.particle(); - // create a Ptr for possible added CaloCluster - art::Ptr ccPtr; - if (kseed.caloCluster()){ - _result.caloCluster = kseed.caloCluster().get(); // should not be using KalFitData as a common block FIXME! - ccPtr = kseed.caloCluster(); // remember the Ptr for creating the TrkCaloHitSeed and KalSeed Ptr - } - - // only process fits which meet the requirements - if(kseed.status().hasAllProperties(_goodseed)) { - // check the seed has the same basic parameters as this module expects - - // if(kseed.particle() != _tpart || kseed.fitDirection() != _fdir ) { - // throw cet::exception("RECO")<<"mu2e::KalFinalFit: wrong particle or direction"<< endl; - // } - - // seed should have at least 1 segment - if(kseed.segments().size() < 1){ - throw cet::exception("RECO")<<"mu2e::KalFinalFit: no segments"<< endl; - } - // build a Kalman rep around this seed - //fill the KalFitData variable - // _result.kalSeed = &kseed; - - // _kfit.makeTrack(_shcol,kseed,krep); - _result.init(); - _kfit.makeTrack(srep,detmodel,_result); - - // KalRep *krep = _result.stealTrack(); - - if(_debug > 1){ - if(_result.krep == 0) - cout << "No Final fit produced " << endl; - else{ - cout << "Seed Fit HelixTraj parameters " << _result.krep->seedTrajectory()->parameters()->parameter() - << " covariance " << _result.krep->seedTrajectory()->parameters()->covariance() - << " NDOF = " << _result.krep->nDof() - << " Final Fit status " << _result.krep->fitStatus() << endl; - } - } - // if successfull, try to add missing hits - if(_addhits && _result.krep != 0 && _result.krep->fitStatus().success()){ - // first, add back the hits on this track - // _result.nunweediter = 0; - _kfit.unweedHits(_result,_maxaddchi); - if (_debug > 0) _kfit.printUtils()->printTrack(&event,_result.krep,"banner+data+hits","CalTrkFit::produce after unweedHits"); - - if (_cprmode){ - findMissingHits_cpr(srep,_result); - }else { - findMissingHits(_result); - } - //check the presence of a TrkCaloHit; if it's not present, add it - if (_kfit.useTrkCaloHit() ){ - if (!hasTrkCaloHit(_result)){ - int icc = _kfit.addTrkCaloHit(detmodel, _result); - if(icc >=0){ - // set the CaloCluster Ptr for the TrkCaloHitSeed. - ccPtr = art::Ptr(clH,(size_t)icc); - } - } - if ( hasTrkCaloHit(_result)) _kfit.weedTrkCaloHit(_result); - if (_diag!=0) { - _kfit.fillTchDiag(_result); - _data.tchDiskId = _result.diag.diskId; - _data.tchAdded = _result.diag.added; - _data.tchDepth = _result.diag.depth; - _data.tchDOCA = _result.diag.doca; - _data.tchDt = _result.diag.dt; - _data.tchTrkPath = _result.diag.trkPath; - _data.tchEnergy = _result.diag.energy; - - } - } - - if(_result.missingHits.size() > 0){ - _kfit.addHits(srep,detmodel,_result,_maxaddchi); - }else if (_cprmode){ - int last_iteration = -1; - _kfit.fitIteration(detmodel,_result,last_iteration); - } - if(_debug > 1) - cout << "AddHits Fit result " << _result.krep->fitStatus() - << " NDOF = " << _result.krep->nDof() << endl; - - //----------------------------------------------------------------------------- - // and weed hits again to insure that addHits doesn't add junk - //----------------------------------------------------------------------------- - int last_iteration = -1; - if (_cprmode) _kfit.weedHits(_result,last_iteration); - } - // put successful fits into the event - if(_result.krep != 0 && (_result.krep->fitStatus().success() || _saveall)){ - //----------------------------------------------------------------------------- - // now evaluate the T0 and its error using the straw hits - //----------------------------------------------------------------------------- - // int last_iteration = -1; - // if (_cprmode) _kfit.updateT0(_result, last_iteration); - - // warning about 'fit current': this is not an error - if(!_result.krep->fitCurrent()){ - cout << "Fit not current! " << endl; - _result.deleteTrack(); - } else { - // flg all hits as belonging to a track. Doesn't work for TrkCaloHit FIXME! - if(ikseedhitVector().begin();ihit != _result.krep->hitVector().end();++ihit){ - TrkStrawHit* tsh = dynamic_cast(*ihit); - //if((*ihit)->isActive() && tsh != 0)shfcol->at(tsh->index()).merge(StrawHitFlag::track); - if (tsh == nullptr) continue; - StrawHitFlag* flag = (StrawHitFlag*) &tsh->comboHit().flag(); - //if((*ihit)->isActive() && tsh != 0)shfcol->at(tsh->index()).merge(StrawHitFlag::track); - if ((*ihit)->isActive()) flag->merge(StrawHitFlag::track); - } - } - - - // save successful kalman fits in the event - KalRep *krep = _result.stealTrack(); - krcol->push_back(krep); - - int index = krcol->size()-1; - krPtrcol->emplace_back(kalRepsID, index, event.productGetter(kalRepsID)); - // convert successful fits into 'seeds' for persistence - TrkFitFlag fflag(kseed.status()); - fflag.merge(TrkFitFlag::KFF); - if(krep->fitStatus().success()) fflag.merge(TrkFitFlag::kalmanOK); - if(krep->fitStatus().success()==1) fflag.merge(TrkFitFlag::kalmanConverged); - // KalSeed fseed(_tpart,_fdir,krep->t0(),krep->flt0(),kseed.status()); - KalSeed fseed(PDGCode::type(krep->particleType().particleType()),fflag,krep->flt0()); - // fill with new information - fseed._flt0 = krep->flt0(); - // global fit information - fseed._chisq = krep->chisq(); - fseed._ndof = krep->nDof(); - // compute the fit consistency. Note our fit has effectively 6 parameters as t0 is allowed to float and its error is propagated to the chisquared - fseed._fitcon = TrkUtilities::chisqConsistency(krep); - TrkUtilities::fillStrawHitSeeds(krep,*_chcol,fseed._hits); - TrkUtilities::fillStraws(krep,fseed._straws); - // sample the fit at the requested z positions. Need options here to define a set of - // standard points, or to sample each unique segment on the fit FIXME! - for(auto zpos : _zsave) { - // compute the flightlength for this z - double fltlen = krep->pieceTraj().zFlight(zpos); - // sample the momentum at this flight. This belongs in a separate utility FIXME - BbrVectorErr momerr = krep->momentumErr(fltlen); - // sample the helix - double locflt(0.0); - const HelixTraj* htraj = dynamic_cast(krep->localTrajectory(fltlen,locflt)); - // fill the segment - KalSegment kseg; - TrkUtilities::fillSegment(*htraj,locflt,fltlen,krep->t0(),_tpart.mass(),kseed.segments().begin()->centralHelix().charge(),_kfit.bField(),kseg); - fseed._segments.push_back(kseg); - } - // see if there's a TrkCaloHit - const TrkCaloHit* tch = TrkUtilities::findTrkCaloHit(krep); - if(tch != 0){ - auto tmom = krep->momentum(tch->fltLen()); - TrkUtilities::fillCaloHitSeed(tch,tmom,fseed._chit); - // set the Ptr using the helix: this could be more direct FIXME! - fseed._chit._cluster = ccPtr; - // create a helix segment at the TrkCaloHit - KalSegment kseg; - // sample the momentum at this flight. This belongs in a separate utility FIXME - BbrVectorErr momerr = krep->momentumErr(tch->fltLen()); - double locflt(0.0); - const HelixTraj* htraj = dynamic_cast(krep->localTrajectory(tch->fltLen(),locflt)); - TrkUtilities::fillSegment(*htraj,locflt,tch->fltLen(),krep->t0(),_tpart.mass(),kseed.segments().begin()->centralHelix().charge(),_kfit.bField(),kseg); - fseed._segments.push_back(kseg); - } - // save KalSeed for this track - kscol->push_back(fseed); - // fill assns with the helix seed - auto kseedptr = art::Ptr(KalSeedCollectionPID,kscol->size()-1,KalSeedCollectionGetter); - kfhassns->addSingle(kseedptr,hptr); - - if (_diag > 0) _hmanager->fillHistograms(&_data); - } - } else {// fit failure - _result.deleteTrack(); - // delete krep; - } - } - } - - // if (_diag > 0) _hmanager->fillHistograms(&_data); - - // put the output products into the event - event.put(move(krcol)); - event.put(move(krPtrcol)); - event.put(move(kscol)); - event.put(move(kfhassns)); - //event.put(move(shfcol)); - } - - // find the input data objects - bool KalFinalFit::findData(const art::Event& evt){ - _chcol = 0; - _kscol = 0; - _khassns = 0; - - auto shH = evt.getValidHandle(_shToken); - _chcol = shH.product(); - auto ksH = evt.getValidHandle(_ksToken); - _kscol = ksH.product(); - auto khaH = evt.getValidHandle(_khaToken); - _khassns = khaH.product(); - if(_shfTag.label() != "none"){ - // auto shfH = evt.getValidHandle(_shfToken); - //_shfcol = shfH.product(); - //if(_shfcol->size() != _chcol->size()) - // throw cet::exception("RECO")<<"mu2e::KalFinalFit: inconsistent input collections"<< endl; - } else { - // _shfcol = 0; - } - if(_kfit.useTrkCaloHit() == 1){ - auto clH = evt.getValidHandle(_clToken); - _clCol = clH.product(); - } - - return _chcol != 0 && _kscol != 0; - } - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - void KalFinalFit::findMissingHits_cpr(StrawResponse::cptr_t srep, KalFitData& KRes) { - - const char* oname = "KalFinalFit::findMissingHits_cpr"; - - Hep3Vector tdir; - HepPoint tpos; - double dt; - - KalRep* krep = KRes.krep; - - krep->pieceTraj().getInfo(0.0,tpos,tdir); - - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - - if (_debug > 0) printf("[%s] shId sec panel doca drift dr added\n",oname); - - KRes.missingHits.clear(); - // KRes.doca.clear(); - - MissingHit_t mh; - - int nstrs = KRes.chcol->size(); - for (int istr=0; istrat(istr); - if (sh.flag().hasAnyProperty(StrawHitFlag::dead)) { - continue; - } - //----------------------------------------------------------------------------- - // I think, we want to check the radial bit: if it is set, than at least one of - // the two measured times is wrong... - //----------------------------------------------------------------------------- - // int radius_ok = _shfcol->at(istr).hasAllProperties(StrawHitFlag::radsel); - dt = _chcol->at(istr).time()-KRes.krep->t0()._t0; - - // if (radius_ok && (fabs(dt) < _maxdtmiss)) { - if (fabs(dt) < _maxdtmiss) { - // make sure we haven't already used this hit - - TrkStrawHit *tsh, *closest(NULL); - bool found = false; - - Straw const& straw = _data.tracker->getStraw(sh.strawId()); - CLHEP::Hep3Vector hpos = straw.getMidPoint(); - - double dz_max(1.e12) ; // closest_z(1.e12); - double zhit = hpos.z(); - - for (std::vector::iterator it=krep->hitVector().begin(); it!=krep->hitVector().end(); it++) { - // tsh = static_cast (*it); - tsh = dynamic_cast (*it); - if (tsh ==0) continue; - int tsh_index = tsh->index(); - if (tsh_index == istr) { - found = true; - break; - } - // check proximity in Z - Straw const& trk_straw = _data.tracker->getStraw(tsh->comboHit().strawId()); - double ztrk = trk_straw.getMidPoint().z(); - - double dz = ztrk-zhit; - if (fabs(dz) < fabs(dz_max)) { - closest = tsh; - dz_max = dz; - } - } - - if (! found) { - // estimate trajectory length to hit - double hflt = 0; - TrkHelixUtils::findZFltlen(*reftraj,zhit,hflt); - - // good in-time hit. Compute DOCA of the wire to the trajectory - // also estimate the drift time if this hit were on the track to get hte hit radius - - TrkT0 hitt0 = closest->hitT0(); - - double s = closest->fltLen(); - double mom = krep->momentum(s).mag(); - double beta = krep->particleType().beta(mom); - - double tflt = (hflt-s)/(beta*CLHEP::c_light); - hitt0._t0 += tflt; - - CLHEP::Hep3Vector hdir = straw.getDirection(); - // convert to HepPoint to satisfy antique BaBar interface: FIXME!!! - HepPoint spt(hpos.x(),hpos.y(),hpos.z()); - TrkLineTraj htraj(spt,hdir,-20,20); - // estimate flightlength along track. This assumes a constant BField!!! - - double fltlen = (hpos.z()-tpos.z())/tdir.z(); - - TrkPoca hitpoca(krep->pieceTraj(),fltlen,htraj,0.0); - - double rdrift;//, hit_error(0.2); - - TrkStrawHit hit(srep,sh,*_data.tracker,istr,hitt0,hflt,1.,1.);//hit_error,1.,_maxadddoca,1.); - - double tdrift=hit.time()-hit.hitT0()._t0; - - // tcal->TimeToDistance(straw.index(),tdrift,tdir,t2d); - - // find the track direction at this hit - Hep3Vector tdir = krep->traj().direction(fltlen); - Hep3Vector tperp = tdir - tdir.dot(straw.getDirection())*straw.getDirection(); - double phi = tperp.theta(); - - rdrift = srep->driftTimeToDistance(straw.id(),tdrift,phi); - - mh.doca = hitpoca.doca(); - if (mh.doca > 0) mh.dr = mh.doca-rdrift; - else mh.dr = mh.doca+rdrift; - //----------------------------------------------------------------------------- - // flag hits with small residuals - //----------------------------------------------------------------------------- - int added (0); - if (fabs(mh.dr) < _maxadddoca) { - KRes.missingHits.push_back(mh); - // KRes.doca.push_back(doca); - added = 1; - } - - if (_debug > 0) { - printf("[CalTrkFit::findMissingHits] %8i %6i %8i %10.3f %10.3f %10.3f %3i\n", - straw.id().asUint16(), - straw.id().getPlane(), - straw.id().getPanel(), - mh.doca, rdrift, mh.dr,added); - } - } - } - else { - if (_debug > 0) { - printf("[%s] rejected hit: i, index, flag, dt: %5i %5i %s %10.3f\n", - oname,istr,sh.strawId().asUint16(), - KRes.shfcol->at(istr).hex().data(),-1.); - } - } - } - //----------------------------------------------------------------------------- - // sort hits in accending |dr|, such that the first hit has the smallest |dr| - //----------------------------------------------------------------------------- - int nmiss = KRes.missingHits.size(); - for (int i1=0; i1dr) > fabs(h2->dr)) { - // swap hits - MissingHit_t tmp = *h1; - *h1 = *h2; - *h2 = tmp; - } - } - } - } - - void KalFinalFit::findMissingHits(KalFitData&kalData) { - KalRep* krep = kalData.krep; - - //clear the array - kalData.missingHits.clear(); - const Tracker& tracker = *_data.tracker; - - // Trajectory info - Hep3Vector tdir; - HepPoint tpos; - krep->pieceTraj().getInfo(krep->flt0(),tpos,tdir); - unsigned nstrs = _chcol->size(); - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - for(unsigned istr=0; istrat(istr).hasAllProperties(_addsel)&& !_shfcol->at(istr).hasAnyProperty(_addbkg)){ - // ComboHit const& sh = _chcol->at(istr); - // if (sh.flag().hasAnyProperty(StrawHitFlag::dead)) { - ComboHit const& sh = _chcol->at(istr); - StrawHitFlag flag = sh.flag(); - - // if(_shfcol->at(istr).hasAllProperties(_addsel)&& !_shfcol->at(istr).hasAnyProperty(_addbkg)){ - if(flag.hasAllProperties(_addsel)&& !flag.hasAnyProperty(_addbkg)){ - if (flag.hasAnyProperty(StrawHitFlag::dead)) { - continue; - } - if(fabs(_chcol->at(istr).time()-krep->t0()._t0) < _maxdtmiss) { - // make sure we haven't already used this hit - vector::iterator ifnd = find_if(tshv.begin(),tshv.end(),FindTrkStrawHit(sh)); - if(ifnd == tshv.end()){ - // good in-time hit. Compute DOCA of the wire to the trajectory - Straw const& straw = tracker.getStraw(sh.strawId()); - CLHEP::Hep3Vector hpos = straw.getMidPoint(); - CLHEP::Hep3Vector hdir = straw.getDirection(); - // convert to HepPoint to satisfy antique BaBar interface: FIXME!!! - HepPoint spt(hpos.x(),hpos.y(),hpos.z()); - TrkLineTraj htraj(spt,hdir,-straw.halfLength(),straw.halfLength()); - // estimate flightlength along track. This assumes a constant BField!!! - double fltlen = (hpos.z()-tpos.z())/tdir.z(); - // estimate hit length - HepPoint tp = krep->pieceTraj().position(fltlen); - Hep3Vector tpos(tp.x(),tp.y(),tp.z()); // ugly conversion FIXME! - double hitlen = hdir.dot(tpos - hpos); - TrkPoca hitpoca(krep->pieceTraj(),fltlen,htraj,hitlen); - - // flag hits with small residuals - if(fabs(hitpoca.doca()) < _maxadddoca){ - MissingHit_t m; - m.index = istr; - m.doca = hitpoca.doca(); - // m.dr = ??; - kalData.missingHits.push_back(m); - } - } - } - } - } - } - - //-------------------------------------------------------------------------------- - // function to check the presence of a TrkCaloHit in the KalRep - //-------------------------------------------------------------------------------- - bool KalFinalFit::hasTrkCaloHit(KalFitData&kalData){ - bool retval(false); - - TrkHitVector *thv = &(kalData.krep->hitVector()); - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkCaloHit*hit = dynamic_cast(*ihit); - if (hit != 0){ - retval = true; - break; - } - } - - return retval; - } - - - }// mu2e - - DEFINE_ART_MODULE(mu2e::KalFinalFit) -*/ diff --git a/TrkPatRec/src/KalSeedFitDiag_tool.cc b/TrkPatRec/src/KalSeedFitDiag_tool.cc deleted file mode 100644 index a1c77eac92..0000000000 --- a/TrkPatRec/src/KalSeedFitDiag_tool.cc +++ /dev/null @@ -1,249 +0,0 @@ -// -/* -#include "Offline/TrkPatRec/inc/KalSeedFit_types.hh" -#include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh" -#include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" -#include "Offline/TrkReco/inc/KalFitData.hh" - -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - -#include "art/Utilities/ToolMacros.h" -#include "art/Utilities/make_tool.h" -#include "fhiclcpp/ParameterSet.h" - -#include "TH1F.h" - -namespace mu2e { - - using namespace KalSeedFitTypes; - - class KalSeedFitDiag : public mu2e::ModuleHistToolBase { - public: - - enum { - kNEventHistSets = 10, - kNTrackHistSets = 10, - kNHitHistSets = 10 - }; - - struct KalSeedData_t { - int nactive; - int ndeactivated; - int nrescued; - float mom; - - KalSeedData_t(): nactive(0), ndeactivated(0), nrescued(0), mom(-1.) {} - }; - - struct EventHist_t { - TH1F* ntracks; // - }; - - struct TrackHist_t { - TH1F* nha; // number of active hits - TH1F* nhd; // number of deactivated hits - TH1F* nhr; // number of rescued hits - TH1F* chi2dof; - TH1F* p; - }; - - struct HitHist_t { - TH1F* doca; // distance of closest approach - }; - - struct Hist_t { - EventHist_t* event[kNEventHistSets]; - TrackHist_t* track[kNTrackHistSets]; - HitHist_t* hit [kNHitHistSets ]; - }; - - protected: - int _mcTruth; - std::unique_ptr _mcUtils; - std::string _shDigiLabel; - Hist_t _hist; // owned - Data_t* _data; // cached - - // const mu2e::PtrStepPointMCVectorCollection* _listOfMCStrawHits; - - public: - - KalSeedFitDiag(const fhicl::ParameterSet& PSet); - ~KalSeedFitDiag(); - - private: - - int bookEventHistograms(EventHist_t* Hist, art::TFileDirectory* Dir); - int bookTrackHistograms(TrackHist_t* Hist, art::TFileDirectory* Dir); - int bookHitHistograms (HitHist_t* Hist, art::TFileDirectory* Dir); - - int fillEventHistograms(EventHist_t* Hist, Data_t* Data); - int fillTrackHistograms(TrackHist_t* Hist, KalSeed* Track, KalSeedData_t* KsData); - - virtual int bookHistograms(art::ServiceHandle& Tfs) override ; - virtual int fillHistograms(void* Data, int Mode = -1) override ; - }; - - - //----------------------------------------------------------------------------- - KalSeedFitDiag::KalSeedFitDiag(const fhicl::ParameterSet& PSet) { - _mcTruth = PSet.get ("mcTruth"); - - if (_mcTruth != 0) _mcUtils = art::make_tool(PSet.get("mcUtils")); - else _mcUtils = std::make_unique(); - } - - //----------------------------------------------------------------------------- - KalSeedFitDiag::~KalSeedFitDiag() { - } - - //----------------------------------------------------------------------------- - int KalSeedFitDiag::bookEventHistograms(EventHist_t* Hist, art::TFileDirectory* Dir) { - Hist->ntracks = Dir->make("ntracks", "number of track candidates: all events", 21, -0.5, 20.5); - return 0; - } - - //----------------------------------------------------------------------------- - int KalSeedFitDiag::bookTrackHistograms(TrackHist_t* Hist, art::TFileDirectory* Dir) { - Hist->nha = Dir->make("nha" , "N(track hits)" , 101, -0.5, 100.5); - Hist->nhd = Dir->make("nhd" , "N(deactivated track hits)", 101, -0.5, 100.5); - Hist->nhr = Dir->make("nhr" , "N(rescued track hits)" , 101, -0.5, 100.5); - Hist->chi2dof = Dir->make("chi2d", "track chi2/dof" , 100, 0. , 10.); - Hist->p = Dir->make("p" , "track momentum" , 400, 0. , 200.); - - return 0; - } - - //----------------------------------------------------------------------------- - int KalSeedFitDiag::bookHitHistograms(HitHist_t* Hist, art::TFileDirectory* Dir) { - Hist->doca = Dir->make("doca","doca, [mm]", 1000, -20., 20); - return 0; - } - - //----------------------------------------------------------------------------- - int KalSeedFitDiag::bookHistograms(art::ServiceHandle& Tfs) { - char folder_name[20]; - - TH1::AddDirectory(0); - //----------------------------------------------------------------------------- - // book event-level histograms - fill them once per event - //----------------------------------------------------------------------------- - int book_event_histset[kNEventHistSets]; - for (int i=0; imkdir(folder_name); - - _hist.event[i] = new EventHist_t; - bookEventHistograms(_hist.event[i],&dir); - } - } - //----------------------------------------------------------------------------- - // book track histograms - //----------------------------------------------------------------------------- - int book_track_histset[kNTrackHistSets]; - for (int i=0; i 15 - - for (int i=0; imkdir(folder_name); - - _hist.track[i] = new TrackHist_t; - bookTrackHistograms(_hist.track[i],&dir); - } - } - //----------------------------------------------------------------------------- - // book hit histograms - //----------------------------------------------------------------------------- - int book_hit_histset[kNHitHistSets]; - for (int i=0; imkdir(folder_name); - - _hist.hit[i] = new HitHist_t; - bookHitHistograms(_hist.hit[i],&dir); - } - } - - return 0; - } - - - //----------------------------------------------------------------------------- - int KalSeedFitDiag::fillEventHistograms(EventHist_t* Hist, Data_t* Data) { - int ntrk = Data->tracks->size(); - Hist->ntracks->Fill(ntrk); - return 0; - } - - //----------------------------------------------------------------------------- - int KalSeedFitDiag::fillTrackHistograms(TrackHist_t* Hist, KalSeed* Track, KalSeedData_t* KsData) { - Hist->nha->Fill(KsData->nactive); - Hist->nhd->Fill(KsData->ndeactivated); - Hist->nhr->Fill(KsData->ndeactivated); - - double chi2dof = Track->chisquared()/(KsData->nactive-5); - - Hist->chi2dof->Fill(chi2dof); - - return 0; - } - - //----------------------------------------------------------------------------- - // Mode is not used - //----------------------------------------------------------------------------- - int KalSeedFitDiag::fillHistograms(void* Data, int Mode) { - - _data = (Data_t*) Data; - - //----------------------------------------------------------------------------- - // fill event-level histograms - //----------------------------------------------------------------------------- - fillEventHistograms(_hist.event[0],_data); - //----------------------------------------------------------------------------- - // fill track-level histograms - //----------------------------------------------------------------------------- - int ntrk = _data->tracks->size(); - for (int i=0; itracks->at(i); - - KalSeedData_t ksdata; - - vector const& hot_l = kseed->hits(); - for (auto it=hot_l.begin(); it (&(*it)); - StrawHitFlag flag = hit->flag(); - bool hitIsActive = flag.hasAllProperties(StrawHitFlagDetail::active); - if (hitIsActive) ++ksdata.nactive; - else ++ksdata.ndeactivated; - } - - ksdata.nrescued = _data->nrescued.at(i); - ksdata.mom = _data->mom.at(i); - - fillTrackHistograms(_hist.track[0],kseed,&ksdata); - if (ksdata.nactive > 15) fillTrackHistograms(_hist.track[1],kseed,&ksdata); - } - return 0; - } - - DEFINE_ART_CLASS_TOOL(KalSeedFitDiag) - -} -*/ diff --git a/TrkPatRec/src/KalSeedFit_module.cc b/TrkPatRec/src/KalSeedFit_module.cc deleted file mode 100644 index eb69ec6bd1..0000000000 --- a/TrkPatRec/src/KalSeedFit_module.cc +++ /dev/null @@ -1,569 +0,0 @@ -// -// Starting with a Helix fit, perform a Least-squares fit (using the BTrk -// Kalman fit, appropriately configured) to produce an initial estimate of the parmeters and -// covariance for the final Kalman fit. This fit uses wire positions only, -// not drift. -// -// Original author Dave Brown (LBNL) 31 Aug 2016 -// -/* -// framework -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Core/EDProducer.h" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "art_root_io/TFileService.h" -#include "art/Utilities/make_tool.h" -#include "art/Framework/Principal/Run.h" -// conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/TrackerConditions/inc/StrawResponse.hh" -#include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" -// utiliites -#include "Offline/GeneralUtilities/inc/Angles.hh" -#include "Offline/TrkReco/inc/TrkUtilities.hh" -#include "Offline/TrkReco/inc/TrkDef.hh" -#include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" -// data -#include "Offline/DataProducts/inc/Helicity.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "Offline/RecoDataProducts/inc/KalSeed.hh" -#include "Offline/RecoDataProducts/inc/KalSeedAssns.hh" -#include "Offline/RecoDataProducts/inc/TrkFitFlag.hh" -// Diagnostic data objects -#include "Offline/TrkReco/inc/KalFitData.hh" -#include "Offline/TrkPatRec/inc/KalSeedFit_types.hh" -// BaBar -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -// Mu2e BaBar -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/TrkReco/inc/KalFit.hh" -//CLHEP -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/Vector.h" -// root -#include "TH1F.h" -#include "TTree.h" -// C++ -#include -#include -#include -#include -#include -#include -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; - -namespace mu2e -{ - - using namespace KalSeedFitTypes; - - - class KalSeedFit : public art::EDProducer - { - public: - explicit KalSeedFit(fhicl::ParameterSet const&); - virtual ~KalSeedFit(); - virtual void beginRun(art::Run&); - virtual void produce(art::Event& event ); - private: - unsigned _iev; - // configuration parameters - int _debug; - int _diag; - int _printfreq; - bool _saveall; - bool _checkhelicity; - // event object tags - art::ProductToken const _shToken; - art::ProductToken const _hsToken; - TrkFitFlag _seedflag; // helix fit flag - unsigned _minnhits; // minimum # of hits - double _maxdoca; // outlier cut - bool _foutliers; // filter hits far from the helix - bool _fhoutliers; // filter hits found flagged as outliers in the helix fit - double _maxAddDoca; // rescue hits cut after fit - double _maxAddChi; // cut for KalFit::AddHits - int _rescueHits; // search for missing hits after the fit is performed - TrkParticle _tpart; // particle type being searched for - TrkFitDirection _fdir; // fit direction in search - vector _perr; // diagonal parameter errors to use in the fit - Helicity _helicity; // cached value of helicity expected for this fit - double _upz, _downz; // z positions to extend the segment - double _amsign; // cached sign of angular momentum WRT the z axis - double _bz000; // sign of the magnetic field at (0,0,0) - HepSymMatrix _hcovar; // cache of parameter error covariance matrix - TrkFitFlag _ksf; // default fit flag - // cache of event objects - const ComboHitCollection *_chcol; - const HelixSeedCollection *_hscol; - // ouptut collections - // Kalman fitter. This will be configured for a least-squares fit (no material or BField corrections). - KalFit _kfit; - KalFitData _result; - const Tracker* _tracker; // straw tracker geometry - - ProditionsHandle _strawResponse_h; - ProditionsHandle _mu2eMaterial_h; - ProditionsHandle _mu2eDetector_h; - ProditionsHandle _alignedTracker_h; - - // diagnostic - Data_t _data; - std::unique_ptr _hmanager; - - // helper functions - bool findData(const art::Event& e); - void filterOutliers(TrkDef& trkdef); - void findMissingHits(KalFitData&kalData); - }; - - KalSeedFit::KalSeedFit(fhicl::ParameterSet const& pset) : - art::EDProducer{pset}, - _debug(pset.get("debugLevel",0)), - _diag(pset.get("diagLevel",0)), - _printfreq(pset.get("printFrequency",101)), - _saveall(pset.get("saveall",false)), - _checkhelicity(pset.get("CheckHelicity",true)), - _shToken{consumes(pset.get("ComboHitCollection"))}, - _hsToken{consumes(pset.get("SeedCollection"))}, - _seedflag(pset.get >("HelixFitFlag",vector{"HelixOK"})), - _minnhits(pset.get("MinNHits",10)), - _maxdoca(pset.get("MaxDoca",40.0)), - _foutliers(pset.get("FilterOutliers",true)), - _fhoutliers(pset.get("FilterHelixOutliers",false)), - _maxAddDoca(pset.get("MaxAddDoca")), - _maxAddChi(pset.get("MaxAddChi")), - _rescueHits(pset.get("rescueHits")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _perr(pset.get >("ParameterErrors")), - _upz(pset.get("UpstreamZ",-1500)), - _downz(pset.get("DownstreamZ",1500)), - _ksf(TrkFitFlag::KSF), - _kfit(pset.get("KalFit",fhicl::ParameterSet())), - _result() - { - // This following consumesMany call is necessary because - // ComboHitCollection::fillStrawHitIndices calls getManyByType - // under the covers. - consumesMany(); - produces(); - produces(); - // check dimensions - if(_perr.size() != HelixTraj::NHLXPRM) - throw cet::exception("RECO")<<"mu2e::KalSeedFit: parameter error vector has wrong size"<< endl; - // mock covariance matrix, all diagonal - _hcovar = HepSymMatrix(HelixTraj::NHLXPRM,0); - for(size_t ipar = 0; ipar < HelixTraj::NHLXPRM; ++ipar){ - _hcovar(ipar+1,ipar+1) = _perr[ipar]*_perr[ipar]; // clhep indexing starts a 1 - } - - //----------------------------------------------------------------------------- - // provide for interactive disanostics - //----------------------------------------------------------------------------- - _data.result = &_result; - - - if (_diag != 0) _hmanager = art::make_tool(pset.get("diagPlugin")); - else _hmanager = std::make_unique(); - } - - KalSeedFit::~KalSeedFit(){} - - void KalSeedFit::beginRun(art::Run& run){ - // calculate the helicity - GeomHandle bfmgr; - GeomHandle det; - - // initialize the BTrk material and particle models - _mu2eMaterial_h.get(run.id()); - - _kfit.setCaloGeom(); - - // change coordinates to mu2e - CLHEP::Hep3Vector vpoint(0.0,0.0,0.0); - CLHEP::Hep3Vector vpoint_mu2e = det->toMu2e(vpoint); - CLHEP::Hep3Vector field = bfmgr->getBField(vpoint_mu2e); - // helicity is a purely geometric quantity, however it's easiest - // to determine it from the kinematics (angular momentum and Z momentum) - _bz000 = field.z(); - _amsign = copysign(1.0,-_tpart.charge()*_bz000); - _helicity = Helicity(static_cast(_fdir.dzdt()*_amsign)); - } - - void KalSeedFit::produce(art::Event& event ) { - - auto srep = _strawResponse_h.getPtr(event.id()); - auto detmodel = _mu2eDetector_h.getPtr(event.id()); - - _tracker = _alignedTracker_h.getPtr(event.id()).get(); - _kfit.setTracker(_tracker); - - // create output collection - unique_ptr kscol(new KalSeedCollection()); - unique_ptr ksha(new KalHelixAssns()); - auto KalSeedCollectionPID = event.getProductID(); - auto KalSeedCollectionGetter = event.productGetter(KalSeedCollectionPID); - // event printout - _iev=event.id().event(); - if(_debug > 0 && (_iev%_printfreq)==0)cout<<"KalSeedFit: event="<<_iev<size(); ++iseed) { - // convert the HelixSeed to a TrkDef - HelixSeed const& hseed(_hscol->at(iseed)); - - if (hseed.caloCluster()) _result.caloCluster = hseed.caloCluster().get(); - _result.helixSeed = &hseed; - //----------------------------------------------------------------------------- - // 2018-12-08 PM : allow list of helices to contain helices of different - // helicities and corresponding to particles of opposite signs. Assume that the - // PDG particle coding scheme is used such that the particle and antiparticle - // PDG codes have opposite signs - //----------------------------------------------------------------------------- - TrkParticle tpart(_tpart); - if(_helicity != hseed.helix().helicity()) { - if(_checkhelicity) throw cet::exception("RECO")<<"mu2e::KalSeedFit: helicity doesn't match configuration" << endl; - TrkParticle::type t = (TrkParticle::type) (-int(_tpart.particleType())); - tpart = TrkParticle(t); - } - - double amsign = copysign(1.0,-tpart.charge()*_bz000); - - HepVector hpvec(HelixTraj::NHLXPRM); - // verify the fit meets requirements and can be translated - // to a fit trajectory. This accounts for the physical particle direction - // helicity. This could be wrong due to FP effects, so don't treat it as an exception - if(hseed.status().hasAllProperties(_seedflag) && - // _helicity == hseed.helix().helicity() && - TrkUtilities::RobustHelix2Traj(hseed._helix,hpvec,amsign)){ - HelixTraj hstraj(hpvec,_hcovar); - // update the covariance matrix - if(_debug > 1) - // hstraj.printAll(cout); - cout << "Seed Fit HelixTraj parameters " << hstraj.parameters()->parameter() - << "and covariance " << hstraj.parameters()->covariance() << endl; - // build a time cluster: exclude the outlier hits - TimeCluster tclust; - tclust._t0 = hseed._t0; - for(uint16_t ihit=0;ihit < hseed.hits().size(); ++ihit){ - ComboHit const& ch = hseed.hits()[ihit]; - if((!_fhoutliers) || (!ch.flag().hasAnyProperty(StrawHitFlag::outlier))) - hseed.hits().fillStrawHitIndices(ihit,tclust._strawHitIdxs); - } - // create a TrkDef; it should be possible to build a fit from the helix seed directly FIXME! - // TrkDef seeddef(tclust,hstraj,_tpart,_fdir); - TrkDef seeddef(tclust,hstraj,tpart,_fdir); - // filter outliers; this doesn't use drift information, just straw positions - if(_foutliers)filterOutliers(seeddef); - const HelixTraj* htraj = &seeddef.helix(); - double flt0 = htraj->zFlight(0.0); - double mom = TrkMomCalculator::vecMom(*htraj, _kfit.bField(), flt0).mag(); - double vflt = seeddef.particle().beta(mom)*CLHEP::c_light; - double helt0 = hseed.t0().t0(); - - KalSeed kf(PDGCode::type(tpart.particleType()),hseed.status(), flt0 ); - // extract the hits from the rep and put the hitseeds into the KalSeed - int nsh = seeddef.strawHitIndices().size();//tclust._strawHitIdxs.size(); - for (int i=0; i< nsh; ++i){ - size_t istraw = seeddef.strawHitIndices().at(i); - const ComboHit& strawhit(_chcol->at(istraw)); - const Straw& straw = _tracker->getStraw(strawhit.strawId()); - double fltlen = htraj->zFlight(straw.getMidPoint().z()); - double propTime = (fltlen-flt0)/vflt; - - //fill the TrkStrwaHitSeed info - TrkStrawHitSeed tshs; - tshs._index = istraw; - tshs._t0 = TrkT0(helt0 + propTime, hseed.t0().t0Err()); - tshs._trklen = fltlen; - kf._hits.push_back(tshs); - } - - if(kf._hits.size() >= _minnhits) kf._status.merge(TrkFitFlag::hitsOK); - // extract the helix trajectory from the fit (there is just 1) - // use this to create segment. This will be the only segment in this track - if(htraj != 0){ - KalSegment kseg; - // sample the momentum at this point - TrkUtilities::fillSegment(*htraj,0.0,0.0,hseed.t0(),tpart.mass(),int(tpart.charge()),_kfit.bField(),kseg); - kf._segments.push_back(kseg); - } else { - throw cet::exception("RECO")<<"mu2e::KalSeedFit: Can't extract helix traj from seed fit" << endl; - } - - // now, fit the seed helix from the filtered hits - - //fill the KalFitData variable - _result.kalSeed = &kf; - - _kfit.makeTrack(srep,detmodel,_result); - - if(_debug > 1){ - if(_result.krep == 0) - cout << "No Seed fit produced " << endl; - else - cout << "Seed Fit result " << _result.krep->fitStatus() << endl; - } - if(_result.krep != 0 && (_result.krep->fitStatus().success() || _saveall)){ - if (_rescueHits) { - int nrescued = 0; - findMissingHits(_result); - nrescued = _result.missingHits.size(); - if (nrescued > 0) { - _kfit.addHits(srep,detmodel,_result, _maxAddChi); - } - } - - // KalRep *krep = _result.stealTrack(); - - // convert the status into a FitFlag - // create a KalSeed object from this fit, recording the particle and fit direction - // KalSeed kseed(_tpart,_fdir,_result.krep->t0(),_result.krep->flt0(),seedok); - - KalSeed kseed(PDGCode::type(_result.krep->particleType().particleType()),kf.status(), _result.krep->flt0()); - kseed._status.merge(_ksf); - if(_result.krep->fitStatus().success())kseed._status.merge(TrkFitFlag::kalmanOK); - // add CaloCluster if present - kseed._chit._cluster = hseed.caloCluster(); - // extract the hits from the rep and put the hitseeds into the KalSeed - TrkUtilities::fillStrawHitSeeds(_result.krep,*_chcol,kseed._hits); - if(_result.krep->fitStatus().success())kseed._status.merge(TrkFitFlag::seedOK); - if(_result.krep->fitStatus().success()==1)kseed._status.merge(TrkFitFlag::seedConverged); - if(kseed._hits.size() >= _minnhits)kseed._status.merge(TrkFitFlag::hitsOK); - kseed._chisq = _result.krep->chisq(); - kseed._ndof = _result.krep->nDof(); - // use the default consistency calculation, as t0 is not fit here - kseed._fitcon = _result.krep->chisqConsistency().significanceLevel(); - // extract the helix trajectory from the fit (there is just 1) - double locflt; - const HelixTraj* htraj = dynamic_cast(_result.krep->localTrajectory(_result.krep->flt0(),locflt)); - // use this to create segment. This will be the only segment in this track - if(htraj != 0){ - KalSegment kseg; - // sample the momentum at this point - BbrVectorErr momerr = _result.krep->momentumErr(_result.krep->flt0()); - TrkUtilities::fillSegment(*htraj,locflt,_result.krep->flt0(),_result.krep->t0(),tpart.mass(),int(tpart.charge()),_kfit.bField(),kseg); - // extend the segment - double upflt(0.0), downflt(0.0); - TrkHelixUtils::findZFltlen(*htraj,_upz,upflt); - TrkHelixUtils::findZFltlen(*htraj,_downz,downflt); - double tup = kseg.fltToTime(upflt); - double tdown = kseg.fltToTime(downflt); - if(_fdir == TrkFitDirection::downstream){ - kseg._tmin = tup; - kseg._tmax = tdown; - } else { - kseg._tmax = tup; - kseg._tmin = tdown; - } - kseed._segments.push_back(kseg); - // push this seed into the collection - kscol->push_back(kseed); - // fill assns with the helix seed - auto hsH = event.getValidHandle(_hsToken); - auto hptr = art::Ptr(hsH,iseed); - auto kseedptr = art::Ptr(KalSeedCollectionPID,kscol->size()-1,KalSeedCollectionGetter); - ksha->addSingle(kseedptr,hptr); - if(_debug > 1){ - cout << "Seed fit segment parameters " << endl; - for(size_t ipar=0;ipar<5;++ipar) cout << kseg.helix()._pars[ipar] << " "; - cout << " covariance " << endl; - for(size_t ipar=0;ipar<15;++ipar) - cout << kseg.covar()._cov[ipar] << " "; - cout << endl; - } - } else { - throw cet::exception("RECO")<<"mu2e::KalSeedFit: Can't extract helix traj from seed fit" << endl; - } - } - // cleanup the seed fit KalRep. Optimally the krep should be a data member of this module - // and get reused to avoid thrashing memory, but the BTrk code doesn't support that, FIXME! - _result.deleteTrack(); - } - } - // put the tracks into the event - event.put(move(kscol)); - event.put(move(ksha)); - } - - - // find the input data objects - bool KalSeedFit::findData(const art::Event& evt){ - _chcol = 0; - _hscol = 0; - - auto shH = evt.getValidHandle(_shToken); - _chcol = shH.product(); - auto hsH = evt.getValidHandle(_hsToken); - _hscol = hsH.product(); - - return _chcol != 0 && _hscol != 0; - } - - void KalSeedFit::filterOutliers(TrkDef& mydef){ - // for now filter on DOCA. In future this shoudl be an MVA using time and position FIXME! - // Trajectory info - Hep3Vector tdir; - HepPoint tposp; - double flt0 = mydef.helix().zFlight(0.0); - mydef.helix().getInfo(flt0,tposp,tdir); - // tracker and conditions - const Tracker& tracker = *_tracker; - - - const vector& indices = mydef.strawHitIndices(); - vector goodhits; - for(unsigned ihit=0;ihitat(indices[ihit]); - Straw const& straw = tracker.getStraw(sh.strawId()); - CLHEP::Hep3Vector hpos = straw.getMidPoint(); - CLHEP::Hep3Vector hdir = straw.getDirection(); - // convert to HepPoint to satisfy antique BaBar interface: FIXME!!! - HepPoint spt(hpos.x(),hpos.y(),hpos.z()); - TrkLineTraj htraj(spt,hdir,-straw.halfLength(),straw.halfLength()); - // estimate flightlength along track. This assumes a constant BField!!! - double fltlen = (hpos.z()-tposp.z())/tdir.z(); - HepPoint tp = mydef.helix().position(fltlen); - Hep3Vector tpos(tp.x(),tp.y(),tp.z()); // ugly conversion FIXME! - double hitlen = hdir.dot(tpos - hpos); - TrkPoca hitpoca(mydef.helix(),fltlen,htraj,hitlen); - // keep hits with small residuals - if(fabs(hitpoca.doca()) < _maxdoca){ - goodhits.push_back(indices[ihit]); - } - } - // update track - mydef.strawHitIndices() = goodhits; - } - - //----------------------------------------------------------------------------- - // look for hits which were not a part of the helix hit list around the - // trajectory found by the seed fit - // look at all hits included into the corresponding time cluster - // first reactivate already associated hits - //----------------------------------------------------------------------------- - void KalSeedFit::findMissingHits(KalFitData&kalData){ - - const char* oname = "KalSeedFit::findMissingHits"; - - mu2e::TrkStrawHit* hit; - int hit_index; - const ComboHit* sh; - const Straw* straw; - - Hep3Vector tdir; - HepPoint tpos; - double doca, *rdrift, fltlen; - - if (_debug > 0) printf("[%s]: BEGIN\n",oname); - - const KalRep* krep = kalData.krep; - - kalData.missingHits.clear(); - - const TrkDifTraj& trajectory = krep->traj(); - const vector& trackHits = krep->hitVector(); - //----------------------------------------------------------------------------- - // get track position and direction at S=0 - //----------------------------------------------------------------------------- - trajectory.getInfo(0.0,tpos,tdir); - //----------------------------------------------------------------------------- - // look for so far unused hits around the trajectory - //----------------------------------------------------------------------------- - const HelixSeed* hseed = kalData.helixSeed; - const std::vector& tchits = hseed->timeCluster()->hits(); - - int n = tchits.size(); - for (int i=0; iat(hit_index); - if (sh->flag().hasAnyProperty(StrawHitFlag::dead)) { - continue; - } - straw = &_tracker->getStraw(sh->strawId()); - - const CLHEP::Hep3Vector& wpos = straw->getMidPoint(); - const CLHEP::Hep3Vector& wdir = straw->getDirection(); - - HepPoint wpt (wpos.x(),wpos.y(),wpos.z()); - TrkLineTraj wire (wpt,wdir,-20,20); - //----------------------------------------------------------------------------- - // estimate flightlength along the track for z-coordinate corresponding to the - // wire position. This assumes a constant BField!!! - // in principle, this should work well enough, however, may want to check - // then determine the distance from the wire to the trajectory - //----------------------------------------------------------------------------- - fltlen = (wpos.z()-tpos.z())/tdir.z(); - TrkPoca wpoca(trajectory,fltlen,wire,0.0); - doca = wpoca.doca(); - - int found(-1); - - if (std::fabs(doca) < _maxAddDoca) { - found = 0; - for (auto it=trackHits.begin(); it (*it); - if (hit == 0) continue; //it means that "hit" is a TrkCaloHit - int shIndex = int(hit->index()); - if (hit_index == shIndex) { - found = 1; - break; - } - } - //----------------------------------------------------------------------------- - // KalSeedFit doesn't look at the hit residuals, only wires - //----------------------------------------------------------------------------- - if (found == 0) { - MissingHit_t m; - m.index = hit_index; - m.doca = doca; - // m.dr = ??; - kalData.missingHits.push_back(m);//hit_index); - // KRes._doca.push_back(doca); - } - } - - if (_debug > 0) printf("[%s] %5i %8.3f %2i \n",oname,hit_index,doca,found); - - } - } - -}// mu2e -using mu2e::KalSeedFit; -DEFINE_ART_MODULE(KalSeedFit) -*/ diff --git a/TrkPatRec/src/RobustHelixFinderDiag_tool.cc b/TrkPatRec/src/RobustHelixFinderDiag_tool.cc index a7b78bcd00..d44fbe1baf 100644 --- a/TrkPatRec/src/RobustHelixFinderDiag_tool.cc +++ b/TrkPatRec/src/RobustHelixFinderDiag_tool.cc @@ -2,9 +2,6 @@ #include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" #include "Offline/TrkReco/inc/RobustHelixFit.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" #include "art/Utilities/ToolMacros.h" #include "art/Utilities/make_tool.h" diff --git a/TrkPatRec/src/RobustHelixFinder_module.cc b/TrkPatRec/src/RobustHelixFinder_module.cc index 02d5cfbb1e..429dfd7ae7 100644 --- a/TrkPatRec/src/RobustHelixFinder_module.cc +++ b/TrkPatRec/src/RobustHelixFinder_module.cc @@ -30,7 +30,6 @@ #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" -#include "BTrk/BaBar/BaBar.hh" #include "Offline/TrkReco/inc/RobustHelixFit.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" diff --git a/TrkReco/inc/PanelAmbigStructs.hh b/TrkReco/inc/PanelAmbigStructs.hh deleted file mode 100644 index 720a83a163..0000000000 --- a/TrkReco/inc/PanelAmbigStructs.hh +++ /dev/null @@ -1,113 +0,0 @@ -// -// Object to allow exhaustively iterating over state permutations of a set of TrkStrawHits -// -// Original author: David Brown (LBNL), 2012 -// -// -#ifndef mu2e_PanelAmbig_PanelAmbigStructs_HH -#define mu2e_PanelAmbig_PanelAmbigStructs_HH -#include "Offline/DataProducts/inc/GenVector.hh" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/SymMatrix.h" -#include "CLHEP/Matrix/Vector.h" -#include "Rtypes.h" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include -#include -#include - -class HepPoint; - -namespace mu2e { - class TrkStrawHit; - namespace PanelAmbig { - // struct to describe the ambiguity and activity state of a single TrkStrawHit - struct HitState { - enum TSHState {negambig=-1,noambig,posambig,inactive}; - HitState(TSHState state=negambig) : _state(state){} - HitState(int ambig, bool active); - // set state from an existing strawhit - HitState(const TrkStrawHit* tsh); - // set TrkStrawHit to this state - bool setHitState(TrkStrawHit* tsh) const; - // comparators - bool operator == (HitState const& other) const { return _state == other._state; } - bool operator != (HitState const& other) const { return !operator==(other); } - bool operator < (HitState const& other ) const { return _state < other._state; } - TSHState _state; // - }; - // vector of HitStates - typedef std::vector HSV; - // the state of all hits in a panel defines the panel state - typedef std::vector PanelState; - // a vector to expliclty define all possible panel states - typedef std::vector PSV; - - // class to store the 1-d projection of a hit. - // this direction (u) is perpendicular to the wire and to the track as it hits the panel - struct TSHUInfo { - enum Use {free=0,fixed,unused}; // free hits are allowed change. Fixed are not, but are still used in chisquared. unused hits are ignored - // construct from a TrkStrawHit, the U direction and the U origin in mu2e coordinates - TSHUInfo(const TrkStrawHit* tsh,CLHEP::Hep3Vector const& udir, HepPoint const& uorigin); - TSHUInfo() : _use(free), _upos(0.0), _wcpos(0.0), _uerr(-1.0), _uwt(0.0), _dr(0.0), _dv(0.0), _ambig(0), _active(-1) {} - Use _use; // use status of this hit - HitState _hstate; // initial hitstate - Float_t _upos; // hit position in u relative to the projected track position - Float_t _wcpos; // wire center position in detector coordinate - Float_t _uerr; // hit error projected in u direction - Float_t _uwt; // cache of the hit weight = 1/error^2 - Float_t _dr; // drift radius - Float_t _dv; // drift velocity - Int_t _ambig; // TrkStrawHit nominal ambiguity - Int_t _active; // TrkStrawHit nominal activity - UInt_t _index; // index into TSH array - }; - typedef std::vector TSHUIV; - - // MC truth hit U projection information, for diagnostics - struct TSHMCUInfo { - Float_t _dr; // true drift radius - Int_t _ambig; - TSHMCUInfo() : _dr(-1000.0),_ambig(-10) {} - }; - typedef std::vector TSHMCUIV; - - // struct to hold hit and other information for a single panel. - // It also holds the result of the optimization - struct PanelInfo { - PanelInfo() : _tupos(0.0), _tuerr(0.0), _tuwt(0.0), _nused(0), _nfree(0) {} - // information from the track fit, excluding the hits from panel, projected into this panel's measurement direction - XYZVectorF _udir; // u direction in detector coordinates - Float_t _tupos; // hit position projected perpendicular to track direction WRT wire - Float_t _tuerr; // track error projected into U coordinate - Float_t _tuwt; // cache of track weight = 1/error^2 - UInt_t _nused; // # of hits used in chisquared - UInt_t _nfree; // # of hits whose state is allowed to vary - // information from all the hits - TSHUIV _uinfo; - }; - - // struct to hold the result of optimizing the panel parameters. - struct PanelResult { - // classify the hit patterns in terms of having hits on the same or opposite sides - // null is when - enum HitPattern{null=0,same,opposite}; - PanelResult(PanelState const& state); - PanelResult() : _chisq(-1.0), _status(-1), _hpat(null) , _statechange(0) {} - PanelState _state; // ambiguity/activity state of each hit in this panel - Float_t _chisq; // chisquared of this state, including all penalties - CLHEP::HepVector _delta; // change in parameters at optimum; U is parameter 0, deltaT is parameter 1 - CLHEP::HepSymMatrix _dcov; // covariance of parameter changes - Int_t _status; // status of matrix inversion - HitPattern _hpat; - UInt_t _statechange; // bit pattern of hit state changes - }; - - typedef std::vector PRV; - - // utility function for combinatorics - unsigned ipow(unsigned base, unsigned exp); - bool setHitStates(PanelState const& pstate, TrkStrawHitVector& hits); - } -} -#endif diff --git a/TrkReco/src/TrkRecoMcUtils_tool.cc b/TrkReco/src/TrkRecoMcUtils_tool.cc deleted file mode 100644 index 565155a064..0000000000 --- a/TrkReco/src/TrkRecoMcUtils_tool.cc +++ /dev/null @@ -1,1162 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -/////////////////////////////////////////////////////////////////////////////// -/* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* - * /* -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Utilities/ToolMacros.h" - -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/BbrGeom/TrkLineTraj.hh" - -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/TrkBase/TrkPoca.hh" - -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" - -#include "CLHEP/Matrix/Vector.h" - -#include "Offline/MCDataProducts/inc/StrawDigiMC.hh" - -#include "Offline/MCDataProducts/inc/StepPointMC.hh" - -#include "Offline/RecoDataProducts/inc/ComboHit.hh" - -#include "Offline/TrackerGeom/inc/Straw.hh" - -#include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh" - -namespace mu2e { - - class TrkRecoMcUtils : public mu2e::McUtilsToolBase { - protected: - art::InputTag _comboHitCollTag; - const ComboHitCollection* _chColl; - art::InputTag _strawDigiMCCollTag; - const StrawDigiMCCollection* _mcdigis; - art::EventID _lastEvent; - double _mbtime; - - public: - - TrkRecoMcUtils(const fhicl::Table& config); - ~TrkRecoMcUtils(); - - public: - - int initEvent(const art::Event* Event); - - virtual int strawHitSimId(const art::Event* Event, int Index) override; - - virtual double mcDoca(const art::Event* Event, const TrkStrawHit* StrawHit) override; - // int Index, - // const Straw* Straw) override ; - - // virtual int nGenHits(const art::Event* Event , - // const StrawHitCollection* Shcol ) override; - - // virtual const StrawDigiMCCollection* getListOfMcStrawHits(const art::Event* Event, - // const art::InputTag& Tag) override; - - virtual const SimParticle* getSimParticle(const art::Event* Event, int HitIndex) override; - virtual const XYZVectorF* getMom (const art::Event* Event, int HitIndex) override; - virtual const XYZVectorF* getPos (const art::Event* Event, int HitIndex) override; - - int getID (const SimParticle* Sim) override; - int getMotherID (const SimParticle* Sim) override; - int getMotherPdgID(const SimParticle* Sim) override; - int getPdgID (const SimParticle* Sim) override; - float getStartMom (const SimParticle* Sim) override; - - }; - -//----------------------------------------------------------------------------- - TrkRecoMcUtils::TrkRecoMcUtils(const fhicl::Table& config) : - _comboHitCollTag { config().comboHitCollTag() }, - _strawDigiMCCollTag{ config().strawDigiMCCollTag() } - { - _lastEvent = art::EventID(); - _mcdigis = nullptr; - _chColl = nullptr; - _mbtime = -1; - } - - //----------------------------------------------------------------------------- - TrkRecoMcUtils::~TrkRecoMcUtils() { - } - - //----------------------------------------------------------------------------- - int TrkRecoMcUtils::initEvent(const art::Event* Event) { - art::Handle mcdigiH; - Event->getByLabel(_strawDigiMCCollTag,mcdigiH); - if (mcdigiH.isValid()) _mcdigis = (mu2e::StrawDigiMCCollection*) mcdigiH.product(); - else _mcdigis = NULL; - - auto chcH = Event->getValidHandle(_comboHitCollTag); - _chColl = chcH.product(); - - if (_mbtime < 0) { - _mbtime = GlobalConstantsHandle()->getNominalDRPeriod(); - } - _lastEvent = Event->id(); - - return 0; - } - - //----------------------------------------------------------------------------- - // returns ID of the SimParticle corresponding to straw hit 'Index' - //----------------------------------------------------------------------------- - int TrkRecoMcUtils::strawHitSimId(const art::Event* Event, int HitIndex) { - if (Event->id() != _lastEvent) initEvent(Event); - return (*_mcdigis)[HitIndex].earlyStrawGasStep()->simParticle()->id().asInt(); - } - //----------------------------------------------------------------------------- - // find MC truth DOCA in a given straw - // start from finding the right vector of StepPointMC's - //----------------------------------------------------------------------------- - double TrkRecoMcUtils::mcDoca(const art::Event* Event, const TrkStrawHit* StrawHit) { - - double mcdoca(-99.0); - - if (Event->id() != _lastEvent) initEvent(Event); - - const ComboHit* ch = &StrawHit->comboHit(); - const Straw* straw = &StrawHit->straw(); - - CLHEP::Hep3Vector v1 = straw->getMidPoint(); - HepPoint p1(v1.x(),v1.y(),v1.z()); - - int hitIndex = ch-&_chColl->at(0); - - auto const& step = (*_mcdigis)[hitIndex].earlyStrawGasStep(); - - CLHEP::Hep3Vector v2 = step->position(); - HepPoint p2(v2.x(),v2.y(),v2.z()); - - TrkLineTraj trstraw(p1,straw->getDirection() ,0.,0.); - TrkLineTraj trstep (p2,GenVector::Hep3Vec(step->momentum()).unit(),0.,0.); - - TrkPoca poca(trstep, 0., trstraw, 0.); - - mcdoca = poca.doca(); - - return mcdoca; - } - - // //----------------------------------------------------------------------------- - // // calculates N(MC hits) produced by the signal particle, SIM_ID = 1, with P > 100 - // //----------------------------------------------------------------------------- - // int TrkRecoMcUtils::nGenHits(const art::Event* Event , - // const StrawHitCollection* Shcol ) { - - // // static int last_event(-1); - // // static int first_call(1); - - // double time_threshold(500.); - // int n_gen_hits( 0 ); - // //----------------------------------------------------------------------------- - // // update if new event - // //----------------------------------------------------------------------------- - // if (Event->id() != _lastEvent) initEvent(Event); - - // if (_mcdigis == NULL) return -1; - - // double pEntrance(.0); - - // int nhits = Shcol->size(); - // for (int i=0; i const& simptr = step->simParticle(); - - // if (simptr->fromGenerator()) gen_index = simptr->genParticle()->generatorId().id(); - // else gen_index = -1; - - // sim_id = simptr->id().asInt(); - // } - - // if ((gen_index > 0) && (sim_id == 1)) { - // double step_time = step->time(); - // step_time = fmod(step_time,_mbtime); - // if (step_time > time_threshold) { - // ++n_gen_hits; - // double pstep = step->momentum().mag(); - // if (pstep > pEntrance) { - // pEntrance = pstep; - // } - // } - // } - // } - - // if (pEntrance < 100. ) n_gen_hits = 0; - - // return n_gen_hits; - // } - - //----------------------------------------------------------------------------- - // const StrawDigiMCCollection* TrkRecoMcUtils::getListOfMcStrawHits(const art::Event* Event,const art::InputTag& Tag) { - // auto handle = Event->getValidHandle(Tag); - // const StrawDigiMCCollection* coll = handle.product(); - // return coll; - // } - - //----------------------------------------------------------------------------- - const SimParticle* TrkRecoMcUtils::getSimParticle(const art::Event* Event, int HitIndex) { - - if (Event->id() != _lastEvent) initEvent(Event); - - return (*_mcdigis)[HitIndex].earlyStrawGasStep()->simParticle().get(); - } - - //----------------------------------------------------------------------------- - const XYZVectorF* TrkRecoMcUtils::getMom(const art::Event* Event, int HitIndex) { - - if (Event->id() != _lastEvent) initEvent(Event); - - return &(*_mcdigis)[HitIndex].earlyStrawGasStep()->momentum(); - } - - //----------------------------------------------------------------------------- - const XYZVectorF* TrkRecoMcUtils::getPos(const art::Event* Event, int HitIndex) { - - if (Event->id() != _lastEvent) initEvent(Event); - - return &(*_mcdigis)[HitIndex].earlyStrawGasStep()->startPosition(); - } - - //----------------------------------------------------------------------------- - int TrkRecoMcUtils::getID (const SimParticle* Sim) { return Sim->id().asInt(); } - - //----------------------------------------------------------------------------- - int TrkRecoMcUtils::getMotherID(const SimParticle* Sim) { - - const SimParticle* mother = Sim; - while(mother->hasParent()) mother = mother->parent().get(); - return mother->id().asInt(); - } - - //----------------------------------------------------------------------------- - int TrkRecoMcUtils::getMotherPdgID(const SimParticle* Sim) { - - const SimParticle* mother = Sim; - while(mother->hasParent()) mother = mother->parent().get(); - return mother->pdgId(); - } - - //----------------------------------------------------------------------------- - int TrkRecoMcUtils::getPdgID (const SimParticle* Sim) { return Sim->pdgId(); } - - //----------------------------------------------------------------------------- - float TrkRecoMcUtils::getStartMom(const SimParticle* Sim) { - CLHEP::HepLorentzVector const& p = Sim->startMomentum(); - return sqrt(p.x()*p.x()+p.y()*p.y()+p.z()*p.z()); - } - - DEFINE_ART_CLASS_TOOL(TrkRecoMcUtils) -} -*/ From dd4a93fdf70c18db688c241df5cc954169d420df Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 22 Apr 2025 22:13:30 -0700 Subject: [PATCH 015/174] Got rid of unused BTrk includes in CalPatRec/inc/CalTimePeakFinder_module.hh, and got rid of unused includes in CalPatRec/inc/CalHelixFinder_module.hh, which only needs HelixTraj.hh --- CalPatRec/inc/CalHelixFinder_module.hh | 4 +++- CalPatRec/inc/CalTimePeakFinder_module.hh | 24 +++++++++++------------ CalPatRec/src/CalHelixFinder_module.cc | 3 ++- CalPatRec/src/CalTimePeakFinder_module.cc | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index aad342083a..ebc53c7d03 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -20,6 +20,7 @@ #include "Offline/DataProducts/inc/Helicity.hh" // BaBar +/* #include "BTrk/BaBar/BaBar.hh" #include "BTrk/BField/BField.hh" #include "BTrk/BField/BFieldFixed.hh" @@ -30,7 +31,8 @@ #include "BTrk/TrkBase/HelixParams.hh" #include "BTrk/TrkBase/TrkPoca.hh" #include "BTrk/TrkBase/TrkMomCalculator.hh" - +*/ +#include "BTrk/TrkBase/HelixTraj.hh" #include "Offline/BFieldGeom/inc/BFieldConfig.hh" #include "Offline/CalPatRec/inc/CalHelixFinder_types.hh" diff --git a/CalPatRec/inc/CalTimePeakFinder_module.hh b/CalPatRec/inc/CalTimePeakFinder_module.hh index 534dce2936..4e54250c7b 100644 --- a/CalPatRec/inc/CalTimePeakFinder_module.hh +++ b/CalPatRec/inc/CalTimePeakFinder_module.hh @@ -28,18 +28,18 @@ namespace art { #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" // BaBar -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BField/BField.hh" -#include "BTrk/BField/BFieldFixed.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "Offline/BFieldGeom/inc/BFieldConfig.hh" -#include "BTrk/BaBar/BbrStringUtils.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/TrkPatRec/inc/TrkHitFilter.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" +//#include "BTrk/BaBar/BaBar.hh" +//#include "BTrk/BField/BField.hh" +//#include "BTrk/BField/BFieldFixed.hh" +//#include "BTrk/ProbTools/ChisqConsistency.hh" +//#include "BTrk/BbrGeom/BbrVectorErr.hh" +//#include "Offline/BFieldGeom/inc/BFieldConfig.hh" +//#include "BTrk/BaBar/BbrStringUtils.hh" +//#include "Offline/BTrkData/inc/TrkStrawHit.hh" +//#include "BTrk/TrkBase/HelixParams.hh" +//#include "BTrk/TrkBase/TrkPoca.hh" +//#include "Offline/TrkPatRec/inc/TrkHitFilter.hh" +//#include "BTrk/TrkBase/TrkMomCalculator.hh" // #include "CalPatRec/inc/CalTimePeak.hh" #include "Offline/CalPatRec/inc/CalTimePeakFinder_types.hh" diff --git a/CalPatRec/src/CalHelixFinder_module.cc b/CalPatRec/src/CalHelixFinder_module.cc index cf947d9d8b..a9bb7e5545 100644 --- a/CalPatRec/src/CalHelixFinder_module.cc +++ b/CalPatRec/src/CalHelixFinder_module.cc @@ -203,7 +203,8 @@ namespace mu2e { //----------------------------------------------------------------------------- // done //----------------------------------------------------------------------------- - return (_chcol != 0) /*&& (_shpcol != 0) */&& (_timeclcol != 0); + return (_chcol != 0) //&& (_shpcol != 0) + && (_timeclcol != 0); } //----------------------------------------------------------------------------- diff --git a/CalPatRec/src/CalTimePeakFinder_module.cc b/CalPatRec/src/CalTimePeakFinder_module.cc index 5235689b7e..9b88f717c9 100644 --- a/CalPatRec/src/CalTimePeakFinder_module.cc +++ b/CalPatRec/src/CalTimePeakFinder_module.cc @@ -167,7 +167,7 @@ namespace mu2e { int ncl, nch; double time, dt, tof, zstraw, cl_time;//, stime; - double xcl, ycl, zcl/*, dz_cl*/; + double xcl, ycl, zcl;//, dz_cl; const CaloCluster* cl; const ComboHit* hit; // const Straw* straw; From a2d4d7b09f95da01e3353725ccf40db053737a7d Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 29 Apr 2025 17:40:07 -0700 Subject: [PATCH 016/174] removed more unused includes and removed CalPatRec/src/MergeHelixFinder_module.cc and CalPatRec/src/ObjectDumpUtils.cc --- CalPatRec/CMakeLists.txt | 26 +++++++++++------------ CalPatRec/inc/CalHelixFinderAlg.hh | 2 -- CalPatRec/inc/CalHelixFinder_module.hh | 12 ----------- CalPatRec/inc/CalTimePeakFinder_module.hh | 15 ------------- CalPatRec/src/CalHelixFinderAlg.cc | 1 - CalPatRec/src/ObjectDumpUtils.cc | 3 +++ 6 files changed, 16 insertions(+), 43 deletions(-) diff --git a/CalPatRec/CMakeLists.txt b/CalPatRec/CMakeLists.txt index e0e914d8f8..b5903db8e3 100644 --- a/CalPatRec/CMakeLists.txt +++ b/CalPatRec/CMakeLists.txt @@ -111,19 +111,19 @@ cet_build_plugin(DeltaFinder art::module Offline::TrackerGeom ) -cet_build_plugin(MergeHelixFinder art::module - REG_SOURCE src/MergeHelixFinder_module.cc - LIBRARIES REG - Offline::CalPatRec - - Offline::BTrkData - Offline::CalorimeterGeom - Offline::ConfigTools - Offline::GeometryService - Offline::Mu2eUtilities - Offline::RecoDataProducts - Offline::TrkReco -) +#cet_build_plugin(MergeHelixFinder art::module +# REG_SOURCE src/MergeHelixFinder_module.cc +# LIBRARIES REG +# Offline::CalPatRec +# +# Offline::BTrkData +# Offline::CalorimeterGeom +# Offline::ConfigTools +# Offline::GeometryService +# Offline::Mu2eUtilities +# Offline::RecoDataProducts +# Offline::TrkReco +#) cet_build_plugin(PhiClusterFinder art::module REG_SOURCE src/PhiClusterFinder_module.cc diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index 3bef9d79f5..9098e62d9f 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -13,8 +13,6 @@ #include "Offline/RecoDataProducts/inc/TimeCluster.hh" #include "Offline/RecoDataProducts/inc/ComboHit.hh" -// BaBar -#include "BTrk/TrkBase/TrkErrCode.hh" //root //#include "TString.h" diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index ebc53c7d03..027645945e 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -20,18 +20,6 @@ #include "Offline/DataProducts/inc/Helicity.hh" // BaBar -/* -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BField/BField.hh" -#include "BTrk/BField/BFieldFixed.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BaBar/BbrStringUtils.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -*/ #include "BTrk/TrkBase/HelixTraj.hh" #include "Offline/BFieldGeom/inc/BFieldConfig.hh" diff --git a/CalPatRec/inc/CalTimePeakFinder_module.hh b/CalPatRec/inc/CalTimePeakFinder_module.hh index 4e54250c7b..b884c91732 100644 --- a/CalPatRec/inc/CalTimePeakFinder_module.hh +++ b/CalPatRec/inc/CalTimePeakFinder_module.hh @@ -27,21 +27,6 @@ namespace art { #include "Offline/RecoDataProducts/inc/KalRepCollection.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -// BaBar -//#include "BTrk/BaBar/BaBar.hh" -//#include "BTrk/BField/BField.hh" -//#include "BTrk/BField/BFieldFixed.hh" -//#include "BTrk/ProbTools/ChisqConsistency.hh" -//#include "BTrk/BbrGeom/BbrVectorErr.hh" -//#include "Offline/BFieldGeom/inc/BFieldConfig.hh" -//#include "BTrk/BaBar/BbrStringUtils.hh" -//#include "Offline/BTrkData/inc/TrkStrawHit.hh" -//#include "BTrk/TrkBase/HelixParams.hh" -//#include "BTrk/TrkBase/TrkPoca.hh" -//#include "Offline/TrkPatRec/inc/TrkHitFilter.hh" -//#include "BTrk/TrkBase/TrkMomCalculator.hh" - -// #include "CalPatRec/inc/CalTimePeak.hh" #include "Offline/CalPatRec/inc/CalTimePeakFinder_types.hh" // Mu2e diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 1e89c6be8a..8a26b0f131 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -9,7 +9,6 @@ // // the following has to come before other BaBar includes /////////////////////////////////////////////////////////////////////////////// -#include "BTrk/BaBar/BaBar.hh" #include "BTrk/TrkBase/HelixTraj.hh" #include "Offline/CalPatRec/inc/CalHelixFinderAlg.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" diff --git a/CalPatRec/src/ObjectDumpUtils.cc b/CalPatRec/src/ObjectDumpUtils.cc index e312e2d00c..0007aff535 100644 --- a/CalPatRec/src/ObjectDumpUtils.cc +++ b/CalPatRec/src/ObjectDumpUtils.cc @@ -1,4 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// +/* #include "Offline/CalPatRec/inc/ObjectDumpUtils.hh" #include "art/Framework/Principal/Handle.h" @@ -35,6 +36,7 @@ // #include "CalPatRec/inc/CalTimePeak.hh" //BaBar includes + #include "BTrk/BbrGeom/TrkLineTraj.hh" #include "BTrk/BbrGeom/BbrVectorErr.hh" #include "BTrk/TrkBase/TrkPoca.hh" @@ -414,3 +416,4 @@ void ObjectDumpUtils::printKalRepCollection(const art::Event* Event , } } +*/ From ed9111116e68ac8aa213f4f6d4a214d7f167e58c Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 21 Oct 2025 21:49:26 -0700 Subject: [PATCH 017/174] Removed commented out code, added a minimal version of HelixTraj to remove BTrk/TrkBase/HelixTraj.hh includes --- BTrkLegacy/HelixTraj.hh | 54 +++ CalPatRec/CMakeLists.txt | 15 - CalPatRec/inc/CalHelixFinder_module.hh | 2 +- CalPatRec/src/CalHelixFinderAlg.cc | 2 +- CalPatRec/src/MergeHelixFinder_module.cc | 369 -------------------- CalPatRec/src/ObjectDumpUtils.cc | 419 ----------------------- TrkReco/CMakeLists.txt | 22 +- 7 files changed, 67 insertions(+), 816 deletions(-) create mode 100644 BTrkLegacy/HelixTraj.hh delete mode 100644 CalPatRec/src/MergeHelixFinder_module.cc delete mode 100644 CalPatRec/src/ObjectDumpUtils.cc diff --git a/BTrkLegacy/HelixTraj.hh b/BTrkLegacy/HelixTraj.hh new file mode 100644 index 0000000000..130ba3ddbb --- /dev/null +++ b/BTrkLegacy/HelixTraj.hh @@ -0,0 +1,54 @@ +#ifndef HELIXTRAJ_HH +#define HELIXTRAJ_HH +#include "CLHEP/Matrix/Vector.h" +#include + + +class HelixParams; + +class HelixTraj{ +private: + CLHEP::HepVector pvec_; + CLHEP::HepSymMatrix pcov_; +public: + HelixTraj(const CLHEP::HepVector& pvec,const CLHEP::HepSymMatrix& pcov ) : pvec_(pvec), pcov_(pcov) + { + // Make sure the dimensions of the input matrix and vector are correct + /* + if( pvec.num_row() != NHLXPRM || pcov.num_row() != NHLXPRM ){ + ErrMsg(fatal) + << "HelixTraj: incorrect constructor vector/matrix dimension" << endmsg; + } + */ + + if (omega() == 0.0) pvec_[omegaIndex] = 1.e-9; + } + HelixTraj( const HelixTraj& h ) : pvec_(h.pvec_), pcov_(h.pcov_) + { + } + + + HelixTraj* clone() const + { + return new HelixTraj(*this); + } + + enum ParIndex {d0Index=0, phi0Index, omegaIndex, z0Index, tanDipIndex, NHLXPRM}; + double d0() const {return pvec_[d0Index];} + double phi0() const; + double omega() const {return pvec_[omegaIndex]; } + double z0() const {return pvec_[z0Index]; } + double tanDip() const { return pvec_[tanDipIndex]; } + + + double z( const double& ) const; + double zFlight(double zpos) const; + double dip() const {return atan(tanDip());} + double cosDip() const {return 1./sqrt(1.+(tanDip()*tanDip())); } + double sinDip() const {return tanDip()*cosDip(); } + double translen(const double& f) const {return cosDip()*f;} + double arc( const double& f) const {return translen(f)*omega();} + double angle(const double& f) const; +}; +#endif + diff --git a/CalPatRec/CMakeLists.txt b/CalPatRec/CMakeLists.txt index b5903db8e3..9c16505d0c 100644 --- a/CalPatRec/CMakeLists.txt +++ b/CalPatRec/CMakeLists.txt @@ -9,7 +9,6 @@ cet_make_library( src/DeltaFinder_types.cc src/DeltaSeed.cc src/HlPrint_ComboHit.cc - src/ObjectDumpUtils.cc src/ProtonCandidate.cc LIBRARIES PUBLIC @@ -111,20 +110,6 @@ cet_build_plugin(DeltaFinder art::module Offline::TrackerGeom ) -#cet_build_plugin(MergeHelixFinder art::module -# REG_SOURCE src/MergeHelixFinder_module.cc -# LIBRARIES REG -# Offline::CalPatRec -# -# Offline::BTrkData -# Offline::CalorimeterGeom -# Offline::ConfigTools -# Offline::GeometryService -# Offline::Mu2eUtilities -# Offline::RecoDataProducts -# Offline::TrkReco -#) - cet_build_plugin(PhiClusterFinder art::module REG_SOURCE src/PhiClusterFinder_module.cc LIBRARIES REG diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index 027645945e..a6c7da5318 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -20,7 +20,7 @@ #include "Offline/DataProducts/inc/Helicity.hh" // BaBar -#include "BTrk/TrkBase/HelixTraj.hh" +#include "BTrkLegacy/HelixTraj.hh" #include "Offline/BFieldGeom/inc/BFieldConfig.hh" #include "Offline/CalPatRec/inc/CalHelixFinder_types.hh" diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 8a26b0f131..2062e14586 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -9,7 +9,7 @@ // // the following has to come before other BaBar includes /////////////////////////////////////////////////////////////////////////////// -#include "BTrk/TrkBase/HelixTraj.hh" +#include "BTrkLegacy/HelixTraj.hh" #include "Offline/CalPatRec/inc/CalHelixFinderAlg.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" diff --git a/CalPatRec/src/MergeHelixFinder_module.cc b/CalPatRec/src/MergeHelixFinder_module.cc deleted file mode 100644 index a75d67399e..0000000000 --- a/CalPatRec/src/MergeHelixFinder_module.cc +++ /dev/null @@ -1,369 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// takes inputs from two helix finding algorithms, produces one helix collection -// on output to be used for the track seed-fit -// -// also use to merge collections of negative and positive helices. In this case, -// expect algorithm ID colelctions to be present -// -// Original author P. Murat -/////////////////////////////////////////////////////////////////////////////// -// framework -/* -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Core/EDProducer.h" -// BaBar -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/HelixParams.hh" - -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" - -#include "TVector2.h" - -#include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "Offline/RecoDataProducts/inc/HelixHit.hh" - -#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" - -// #include "Offline/BTrkData/inc/Doublet.hh" -// #include "Offline/TrkReco/inc/DoubletAmbigResolver.hh" - -#include "Offline/Mu2eUtilities/inc/LsqSums4.hh" -#include "Offline/CalPatRec/inc/ObjectDumpUtils.hh" - -#include "Offline/RecoDataProducts/inc/AlgorithmID.hh" - -//CLHEP -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Vector/ThreeVector.h" -// root -#include "TMath.h" -// C++ -#include -#include -#include -#include -#include -#include -#include -#include -#include -using namespace std; -using CLHEP::Hep3Vector; - -namespace mu2e { - class MergeHelixFinder : public art::EDProducer { - public: - explicit MergeHelixFinder(fhicl::ParameterSet const&); - virtual ~MergeHelixFinder(); - virtual void beginJob(); - virtual void beginRun(art::Run&); - virtual void produce(art::Event& event ); - void endJob(); - - void saveBest(HelixSeedCollection* HelixColl, const HelixSeed* Helix, - art::Event& AnEvent, const art::Provenance* Prov, - int Index, AlgorithmIDCollection* AidColl); - - void checkPresenceOfDuplicates(HelixSeedCollection* HelixColl, std::vector &IndexToSkip); - - private: - unsigned _iev; - // configuration parameters - int _diag; - int _debugLevel; - float _minTprChi2; - float _minCprChi2; - int _printfreq; - bool _addhits; - // event object labels - std::string _tprHelixCollTag; - std::string _cprHelixCollTag; - }; - - MergeHelixFinder::MergeHelixFinder(fhicl::ParameterSet const& pset) : - EDProducer{pset}, - _diag (pset.get ("diagLevel" )), - _debugLevel (pset.get ("debugLevel" )), - _tprHelixCollTag (pset.get("tprHelixCollTag")), - _cprHelixCollTag (pset.get("cprHelixCollTag")) - { - - produces (); - produces (); - - } - - MergeHelixFinder::~MergeHelixFinder() { - } - - void MergeHelixFinder::beginJob() { - } - - void MergeHelixFinder::beginRun(art::Run& ) { - } - -//----------------------------------------------------------------------------- -// search within the collection the presence of duplicates -//----------------------------------------------------------------------------- - void MergeHelixFinder::checkPresenceOfDuplicates(HelixSeedCollection* HelixColl, std::vector &IndexToSkip){ - int nHel = HelixColl->size(); - int nh1(0), nh2(0), natc(0); - - const HelixSeed *h1(0), *h2(0); - const ComboHitCollection *list1(0), *list2(0); - const mu2e::HelixHit *hitt, *hitc; - - for (int i=0; iat(i); - list1 = &h1->hits(); - nh1 = list1->size(); - natc = 0; - - for (int j=i+1; jat(j); - list2 = &h2->hits(); - nh2 = list2->size(); - - for (int k=0; kat(k); - for (int l=0; lat(l); - if (hitt->index() == hitc->index()) { - natc += 1; - break; - } - } - } -//----------------------------------------------------------------------------- -// if > 50% of the helix hits are common, it unlikely to be an "independent" object -// logic of the choice: -// 1. take the track which has more hits -// 2. if two helices have the same number of hits, pending future studies, -// the choose CalPatRec one -//----------------------------------------------------------------------------- - if ((natc > nh1/2.) || (natc > nh2/2.)) { - //----------------------------------------------------------------------------- - // for one of the two helices, the number of shared hits > 50% - //----------------------------------------------------------------------------- - if (nh2 > nh1) { - //----------------------------------------------------------------------------- - // h2 is a winner, no need to save h1 - //----------------------------------------------------------------------------- - IndexToSkip.push_back(i); - break; - } - else { - //----------------------------------------------------------------------------- - // h1 is a winner, mark h2 in hope that it will be OK, continue looping - //----------------------------------------------------------------------------- - IndexToSkip.push_back(j); - } - } - - }//end loop over j - }//end loop over i - } - -//----------------------------------------------------------------------------- -// algorithm collections are unnamed -//----------------------------------------------------------------------------- - void MergeHelixFinder::saveBest(HelixSeedCollection* HelixColl, const HelixSeed* Helix, - art::Event& AnEvent, const art::Provenance* Prov, - int Index, AlgorithmIDCollection* AidColl) { - - AlgorithmID aid; - short best(0), mask(-1); - art::Handle algH; - - HelixColl->push_back(*Helix); - - AnEvent.getByLabel(Prov->moduleLabel(),"",Prov->processName(),algH); - - if (algH.isValid()) { - mask = algH->at(Index).AlgMask(); - best = algH->at(Index).BestID(); - } - else { - if (_cprHelixCollTag.find("HelixFinder:" ) == 0) { - mask = 1 << AlgorithmID::TrkPatRecBit; - best = AlgorithmID::TrkPatRecBit; - } - else if (_cprHelixCollTag.find("CalHelixFinder") == 0) { - mask = 1 << AlgorithmID::CalPatRecBit; - best = AlgorithmID::CalPatRecBit; - } - } - - aid.Set(best,mask); - AidColl->push_back(aid); - } - - -//----------------------------------------------------------------------------- - void MergeHelixFinder::produce(art::Event& AnEvent) { - - // assume less than 100 tracks - - int nhel[2] {0,0} ; - - art::Handle hcH[2]; - - mu2e::HelixSeedCollection *hcoll[2] {nullptr,nullptr}; - - // mu2e::GeomHandle ds; - // mu2e::GeomHandle vdet; - - unique_ptr algs (new AlgorithmIDCollection ); - unique_ptr helixPtrs(new HelixSeedCollection ); - - if (_debugLevel > 0) ObjectDumpUtils::printEventHeader(&AnEvent,"MergeHelixFinder::produce"); -//----------------------------------------------------------------------------- -// internal function -//----------------------------------------------------------------------------- - art::Handle algH; - - const art::Provenance *prov[2] {nullptr,nullptr}; - - AnEvent.getByLabel(_tprHelixCollTag,hcH[0]); - AnEvent.getByLabel(_cprHelixCollTag,hcH[1]); - - for (int i=0; i<2; i++) { - if (hcH[i].isValid()) { - prov [i] = hcH[i].provenance(); - hcoll[i] = (mu2e::HelixSeedCollection*) &(*hcH[i]); - nhel [i] = hcoll[i]->size(); - } - } - - int mnhel = max(nhel[0],nhel[1]); - - vector flag[2]; - flag[0].reserve(mnhel); - flag[1].reserve(mnhel); - - for (int i=0; i helixToSkip0, helixToSkip1; - - checkPresenceOfDuplicates(hcoll[0], helixToSkip0); - checkPresenceOfDuplicates(hcoll[1], helixToSkip1); - - const HelixSeed *h1, *h2; - const ComboHitCollection *tlist, *clist; - int nh1, nh2, natc; - const mu2e::HelixHit *hitt, *hitc; - - for (int i1=0; i1::iterator it1; - it1 = find(helixToSkip0.begin(), helixToSkip0.end(), i1); - if (it1 != helixToSkip0.end()) continue; - - h1 = &hcoll[0]->at(i1); -//------------------------------------------------------------------------------ -// check if an AlgorithmID collection has been created by the process -//----------------------------------------------------------------------------- - tlist = &h1->hits(); - nh1 = tlist->size(); - natc = 0; - - for (int i2=0; i2::iterator it2; - it2 = find(helixToSkip1.begin(), helixToSkip1.end(), i2); - if (it2 != helixToSkip1.end()) continue; - - h2 = &hcoll[1]->at(i2); -//----------------------------------------------------------------------------- -// at Mu2e, 2 helices with different helicity could be duplicates of each other -//----------------------------------------------------------------------------- - clist = &h2->hits(); - nh2 = clist->size(); -//----------------------------------------------------------------------------- -// check the number of common hits: do we need to check also if they have -// close momentum? -//----------------------------------------------------------------------------- - for (int k=0; kat(k); - for (int l=0; lat(l); - if (hitt->index() == hitc->index()) { - natc += 1; - break; - } - } - } -//----------------------------------------------------------------------------- -// if > 50% of the helix hits are common, it unlikely to be an "independent" object -// logic of the choice: -// 1. take the track which has more hits -// 2. if two helices have the same number of hits, pending future studies, -// the choose CalPatRec one -//----------------------------------------------------------------------------- - if ((natc > nh1/2.) || (natc > nh2/2.)) { -//----------------------------------------------------------------------------- -// for one of the two helices, the number of shared hits > 50% -//----------------------------------------------------------------------------- - if (nh2 > nh1) { -//----------------------------------------------------------------------------- -// h2 is a winner, no need to save h1 -//----------------------------------------------------------------------------- - saveBest(helixPtrs.get(),h2,AnEvent,prov[1],i2,algs.get()); - - flag[0][i1] = 0; - flag[1][i2] = 0; - break; - } - else { -//----------------------------------------------------------------------------- -// h1 is a winner, mark h2 in hope that it will be OK, continue looping -//----------------------------------------------------------------------------- - flag[1][i2] = 0; - } - } - } - - if (flag[0][i1] == 1) { -//----------------------------------------------------------------------------- -// looped over all helices from the second coll, nothing looking like h1 -//----------------------------------------------------------------------------- - saveBest(helixPtrs.get(),h1,AnEvent,prov[0],i1,algs.get()); - } - } -//----------------------------------------------------------------------------- -// account for presence of multiple helices - loop over the 2nd collection -// and pass the unique helices to output -//----------------------------------------------------------------------------- - for (int i=0; iat(i); - saveBest(helixPtrs.get(),h2,AnEvent,prov[1],i,algs.get()); - } - } - - AnEvent.put(std::move(helixPtrs)); - AnEvent.put(std::move(algs )); - } -//----------------------------------------------------------------------------- -// end job : -//----------------------------------------------------------------------------- - void MergeHelixFinder::endJob() { - } - -} - -using mu2e::MergeHelixFinder; -DEFINE_ART_MODULE(MergeHelixFinder) -*/ diff --git a/CalPatRec/src/ObjectDumpUtils.cc b/CalPatRec/src/ObjectDumpUtils.cc deleted file mode 100644 index 0007aff535..0000000000 --- a/CalPatRec/src/ObjectDumpUtils.cc +++ /dev/null @@ -1,419 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -/* -#include "Offline/CalPatRec/inc/ObjectDumpUtils.hh" - -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" - -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" - -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/CaloProtoCluster.hh" -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" - -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StrawGasStep.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/PhysicalVolumeInfo.hh" - -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" - -// #include "CalPatRec/inc/CalTimePeak.hh" - -//BaBar includes - -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" - -namespace mu2e { - - const StrawDigiMCCollection *ObjectDumpUtils::_ListOfMCStrawHits(NULL); - std::string ObjectDumpUtils::_FlagBgrHitsModuleLabel; - -// //______________________________________________________________________________ -// ObjectDumpUtils::ObjectDumpUtils() { - -// _FlagBgrHitsModuleLabel = "FlagBkgHits"; - -// } - -// //______________________________________________________________________________ -// ObjectDumpUtils::~ObjectDumpUtils() { -// } - -//----------------------------------------------------------------------------- -void ObjectDumpUtils::printEventHeader(const art::Event* Event, const char* Message) { - - printf(" Run / Subrun / Event : %10i / %10i / %10i : %s\n", - Event->run(), - Event->subRun(), - Event->event(), - Message); -} - -//----------------------------------------------------------------------------- -void ObjectDumpUtils::printCaloProtoCluster(const mu2e::CaloProtoCluster* Cluster, const char* Opt) { - - TString opt = Opt; - - int section_id(-1), iz, ir; - - const mu2e::Calorimeter * cal(NULL); - const mu2e::Crystal *cr; - const CLHEP::Hep3Vector *pos; - - art::ServiceHandle geom; - mu2e::GeomHandle cg; - - cal = cg.get(); - - if ((opt == "") || (opt == "banner")) { - printf("-----------------------------------------------------------------------------------------------------\n"); - printf(" Address SectionID IsSplit NC Time Energy \n"); - printf("-----------------------------------------------------------------------------------------------------\n"); - } - - const mu2e::CaloHitPtrVector caloClusterHits = Cluster->caloHitsPtrVector(); - int nh = caloClusterHits.size(); - - if ((opt == "") || (opt.Index("data") >= 0)) { - - printf("%16p %3i %5i %5i %10.3f %10.3f\n", - static_cast(Cluster), - section_id, - nh, - Cluster->isSplit(), - Cluster->time(), - Cluster->energyDep() - ); - } - - if (opt.Index("hits") >= 0) { -//----------------------------------------------------------------------------- -// print individual crystals in local disk coordinate system -//----------------------------------------------------------------------------- - for (int i=0; icrystalID(); - - // pos = cg->crystalOriginInSection(id); - - cr = &cal->crystal(id); - pos = &cr->localPosition(); - - iz = -1; - ir = -1; - - printf("%6i %10.3f %5i %5i %8.3f %10.3f %10.3f %10.3f %10.3f\n", - id, - hit->time(), - iz,ir, - hit->energyDep(), - pos->x(), - pos->y(), - pos->z(), - hit->energyDepTot() - ); - } - } -} - -//----------------------------------------------------------------------------- - void ObjectDumpUtils::printCaloProtoClusterCollection(const mu2e::CaloProtoClusterCollection* Coll) { - - const mu2e::CaloProtoCluster *cluster; - - int banner_printed(0), nclusters; - - nclusters = Coll->size(); - - for (int i=0; iat(i); - if (banner_printed == 0) { - printCaloProtoCluster(cluster, "banner"); - banner_printed = 1; - } - printCaloProtoCluster(cluster,"data"); - } -} - -//----------------------------------------------------------------------------- -void ObjectDumpUtils::printKalRep(const KalRep* Krep, const char* Opt, const char* Prefix) { - - std::string opt = Opt; - - if ((opt == "") || (opt == "banner")) { - printf("-----------------------------------------------------------------------------------------------"); - printf("-----------------------------------------------------\n"); - printf("%s Address TrkID N NA P T0 MomErr T0Err pT costh Omega",Prefix); - printf(" D0 Z0 Phi0 TanDip Chi2 FCons\n"); - printf("-----------------------------------------------------------------------------------------------"); - printf("-----------------------------------------------------\n"); - } - - if ((opt == "") || (opt.find("data") != std::string::npos)) { - double chi2 = Krep->chisq(); - - int nhits(0); - - const TrkHitVector* hits = &Krep->hitVector(); - for (auto ih=hits->begin(); ih != hits->end(); ++ih) { - nhits++; - } - - int nact = Krep->nActive(); - double t0 = Krep->t0().t0(); - double t0err = Krep->t0().t0Err(); -//----------------------------------------------------------------------------- -// in all cases define momentum at lowest Z - ideally, at the tracker entrance -//----------------------------------------------------------------------------- - double s1 = Krep->firstHit()->kalHit()->hit()->fltLen(); - double s2 = Krep->lastHit ()->kalHit()->hit()->fltLen(); - double s = std::min(s1,s2); - - double d0 = Krep->helix(s).d0(); - double z0 = Krep->helix(s).z0(); - double phi0 = Krep->helix(s).phi0(); - double omega = Krep->helix(s).omega(); - double tandip = Krep->helix(s).tanDip(); - - CLHEP::Hep3Vector fitmom = Krep->momentum(s); - CLHEP::Hep3Vector momdir = fitmom.unit(); - BbrVectorErr momerr = Krep->momentumErr(s); - - HepVector momvec(3); - for (int i=0; i<3; i++) momvec[i] = momdir[i]; - - double sigp = sqrt(momerr.covMatrix().similarity(momvec)); - - double fit_consistency = Krep->chisqConsistency().consistency(); - int q = Krep->charge(); - - Hep3Vector trk_mom; - - trk_mom = Krep->momentum(s); - double mom = trk_mom.mag(); - double pt = trk_mom.perp(); - double costh = trk_mom.cosTheta(); - - char form[100]; - int nc = strlen(Prefix); - for (int i=0; i(Krep), - -1, - nhits, - nact, - q*mom,t0,sigp,t0err,pt,costh - ); - - printf(" %8.5f %8.3f %8.3f %8.4f %7.4f", - omega,d0,z0,phi0,tandip - ); - printf(" %8.3f %10.3e\n", - chi2, - fit_consistency); - } - - if (opt.find("hits") != std::string::npos) { -//----------------------------------------------------------------------------- -// print detailed information about the track hits -//----------------------------------------------------------------------------- - const TrkHitVector* hits = &Krep->hitVector(); - - printf("--------------------------------------------------------------------"); - printf("---------------------------------------------------------------"); - printf("------------------------------------------------------\n"); - // printf(" ih SInd U A len x y z HitT HitDt"); - printf(" ih SInd A len x y z HitT HitDt"); - printf(" Ch Pl L W T0 Xs Ys Zs resid sigres"); - printf(" Rdrift mcdoca totErr hitErr t0Err penErr extErr\n"); - printf("--------------------------------------------------------------------"); - printf("---------------------------------------------------------------"); - printf("------------------------------------------------------\n"); - - mu2e::TrkStrawHit* hit; - CLHEP::Hep3Vector pos; - int i = 0; - - for (auto it=hits->begin(); it!=hits->end(); it++) { - // TrkStrawHit inherits from TrkHitOnTrk - - hit = (mu2e::TrkStrawHit*) (*it); - - const mu2e::ComboHit* sh = &hit->comboHit(); - mu2e::Straw* straw = (mu2e::Straw*) &hit->straw(); - - hit->hitPosition(pos); - - double len = hit->fltLen(); - HepPoint plen = Krep->position(len); -//----------------------------------------------------------------------------- -// find MC truth DOCA in a given straw -// start from finding the right vector of StepPointMC's -//----------------------------------------------------------------------------- - int vol_id, nstraws(0); - - if (_ListOfMCStrawHits) nstraws = _ListOfMCStrawHits->size(); - - const mu2e::StrawGasStep* step(0); - - for (int i=0; iat(i); - - const mu2e::StrawGasStep *step; - if (mcdigi->wireEndTime(mu2e::StrawEnd::cal) < mcdigi->wireEndTime(mu2e::StrawEnd::hv)) { - step = mcdigi->strawGasStep(mu2e::StrawEnd::cal).get(); - } - else { - step = mcdigi->strawGasStep(mu2e::StrawEnd::hv ).get(); - } - -// vol_id = step->volumeId(); - vol_id = step->strawId().asUint16(); - if (vol_id == straw->id().asUint16()) { - // step found - use the first one in the straw - break; - } - } - - double mcdoca = -99.0; - - if (step) { - auto v1 = straw->getMidPoint(); - HepPoint p1(v1.x(),v1.y(),v1.z()); - - Hep3Vector v2 = step->position(); - HepPoint p2(v2.x(),v2.y(),v2.z()); - - TrkLineTraj trstraw(p1,straw->getDirection() ,0.,0.); - TrkLineTraj trstep (p2,GenVector::Hep3Vec(step->momentum().unit()),0.,0.); - - TrkPoca poca(trstep, 0., trstraw, 0.); - - mcdoca = poca.doca(); - } - - // printf("%3i %5i %1i %1i %9.3f %8.3f %8.3f %9.3f %8.3f %7.3f", - printf("%3i %5i %1i %9.3f %8.3f %8.3f %9.3f %8.3f %7.3f", - ++i, - straw->id().asUint16(), - // hit->isUsable(), - hit->isActive(), - len, - // hit->hitRms(), - plen.x(),plen.y(),plen.z(), - sh->time(), 0.//sh->dt()//FIXME! - ); - - printf(" %2i %2i %2i %2i", - straw->id().getPlane(), - straw->id().getPanel(), - straw->id().getLayer(), - straw->id().getStraw() - ); - - printf(" %8.3f",hit->hitT0().t0()); - - double res, sigres; - hit->resid(res, sigres, true); - - printf("%8.3f %8.3f %9.3f %7.3f %7.3f", - pos.x(), - pos.y(), - pos.z(), - res, - sigres - ); - - if (hit->isActive()) { - if (hit->ambig() == 0) printf(" * %6.3f",hit->driftRadius()); - else if (hit->ambig()*mcdoca > 0) printf(" %6.3f",hit->driftRadius()*hit->ambig()); - else printf(" ? %6.3f",hit->driftRadius()*hit->ambig()); - } - else { -//----------------------------------------------------------------------------- -// do not analyze correctness of the drift sign determination for hits not -// marked as 'active' -//----------------------------------------------------------------------------- - printf(" %6.3f",hit->driftRadius()); - } - - printf(" %7.3f",mcdoca); - printf(" %6.3f %6.3f %6.3f %6.3f %6.3f", - hit->totalErr(), - hit->hitErr(), - hit->t0Err(), - hit->penaltyErr(), - hit->temperature() - ); -//----------------------------------------------------------------------------- -// test: calculated residual in fTmp[0] -//----------------------------------------------------------------------------- -// Test_000(Krep,hit); -// printf(" %7.3f",fTmp[0]); - - printf("\n"); - } - } -} - -//----------------------------------------------------------------------------- -void ObjectDumpUtils::printKalRepCollection(const art::Event* Event , - const KalRepPtrCollection* Coll, - int PrintHits ) { - - art::Handle mcdigiH; - - Event->getByLabel("makeSD","",mcdigiH); - if (mcdigiH.isValid()) { - _ListOfMCStrawHits = (mu2e::StrawDigiMCCollection*) mcdigiH.product(); - } - else { - _ListOfMCStrawHits = NULL; - printf(">>> ERROR in ObjectDumpUtils::printKalRepCollection: failed to locate StrawDigiMCCollection by makeSD\n"); - } - - int ntrk = Coll->size(); - - const KalRep *trk; - - // int banner_printed = 0; - for (int i=0; i kptr = Coll->at(i); -// Event->get(kptr.id(), krepsHandle); -// fhicl::ParameterSet const& pset = krepsHandle.provenance()->parameterSet(); -// string module_type = pset.get("module_type"); - - trk = kptr.get(); - printKalRep(trk,"banner+data+hits",""); // module_type.data()); - } - -} - -} -*/ diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index 130923865b..fd4a9b658d 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -79,17 +79,17 @@ cet_build_plugin(SelectSameTrack art::module Offline::RecoDataProducts ) -cet_build_plugin(TrkRecoMcUtils art::tool - REG_SOURCE src/TrkRecoMcUtils_tool.cc - LIBRARIES REG - Offline::TrkReco - Offline::BTrkData - Offline::ConditionsService - Offline::MCDataProducts - Offline::Mu2eUtilities - Offline::RecoDataProducts - Offline::TrackerGeom -) +#cet_build_plugin(TrkRecoMcUtils art::tool +# REG_SOURCE src/TrkRecoMcUtils_tool.cc +# LIBRARIES REG + #Offline::TrkReco + #Offline::BTrkData + #Offline::ConditionsService + #Offline::MCDataProducts + #Offline::Mu2eUtilities + #Offline::RecoDataProducts + #Offline::TrackerGeom +#) #art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults # CLASSES_DEF_XML ${CMAKE_CURRENT_SOURCE_DIR}/src/classes_def.xml From 8693ddd95d8d8952f3bcaa513ede3a5969d74ed4 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 22 Oct 2025 14:54:06 -0700 Subject: [PATCH 018/174] Removed all BTrk uses in CalPatRec. Added needed classes from BTrk into BTrkLegacy --- BTrkLegacy/CMakeLists.txt | 10 ++ BTrkLegacy/inc/ExternalInfo.hh | 52 +++++++ BTrkLegacy/{ => inc}/HelixParams.hh | 0 BTrkLegacy/{ => inc}/HelixTraj.hh | 0 BTrkLegacy/inc/ParticleInfoInterface.hh | 30 ++++ BTrkLegacy/inc/TrkErrCode.hh | 102 +++++++++++++ BTrkLegacy/inc/TrkParticle.hh | 49 ++++++ BTrkLegacy/src/ExternalInfo.cc | 16 ++ BTrkLegacy/src/TrkParticle.cc | 156 ++++++++++++++++++++ CalPatRec/inc/CalHelixFinderData.hh | 4 +- CalPatRec/inc/CalHelixFinder_module.hh | 2 +- CalPatRec/src/CalHelixFinderAlg.cc | 2 +- CalPatRec/src/CalTimePeakFinderDiag_tool.cc | 3 - 13 files changed, 419 insertions(+), 7 deletions(-) create mode 100644 BTrkLegacy/CMakeLists.txt create mode 100644 BTrkLegacy/inc/ExternalInfo.hh rename BTrkLegacy/{ => inc}/HelixParams.hh (100%) rename BTrkLegacy/{ => inc}/HelixTraj.hh (100%) create mode 100644 BTrkLegacy/inc/ParticleInfoInterface.hh create mode 100644 BTrkLegacy/inc/TrkErrCode.hh create mode 100644 BTrkLegacy/inc/TrkParticle.hh create mode 100644 BTrkLegacy/src/ExternalInfo.cc create mode 100644 BTrkLegacy/src/TrkParticle.cc diff --git a/BTrkLegacy/CMakeLists.txt b/BTrkLegacy/CMakeLists.txt new file mode 100644 index 0000000000..298627eb8a --- /dev/null +++ b/BTrkLegacy/CMakeLists.txt @@ -0,0 +1,10 @@ +cet_make_library( + SOURCE + src/ExternalInfo.cc + src/TrkParticle.cc + LIBRARIES PUBLIC +) + +install_source(SUBDIRS src) +install_headers(USE_PROJECT_NAME SUBDIRS inc) + diff --git a/BTrkLegacy/inc/ExternalInfo.hh b/BTrkLegacy/inc/ExternalInfo.hh new file mode 100644 index 0000000000..6eb88a720d --- /dev/null +++ b/BTrkLegacy/inc/ExternalInfo.hh @@ -0,0 +1,52 @@ +#ifndef BaBar_ExternalInfo +#define BaBar_ExternalInfo + +// +// Manage access to externally supplied information. +// + +class FileFinderInterface; +class ParticleInfoInterface; + +class ExternalInfo { + +public: + + // It is not possible to make an object of this type. + // All information is accessed via static member functions. + ExternalInfo () = delete; + ~ExternalInfo () = delete; + ExternalInfo ( ExternalInfo const& ) = delete; + ExternalInfo ( ExternalInfo&& ) = delete; + ExternalInfo& operator= ( ExternalInfo const& ) = delete; + ExternalInfo& operator= ( ExternalInfo&& ) = delete; + + // Checked and unchecked accessors. + static FileFinderInterface const* fileFinderInstance(); + static FileFinderInterface const* uncheckedFileFinderInstance(){ + return _findFile; + } + + static ParticleInfoInterface const* particleInfoInstance(); + static ParticleInfoInterface const* uncheckedParticleInfoInstance(){ + return _particleInfo; + } + + // Setters + static void set ( FileFinderInterface const* findFile ){ + _findFile = findFile; + } + + static void set ( ParticleInfoInterface const* particleInfo ){ + _particleInfo = particleInfo; + } + +private: + + // Non-owning pointers to externally managed objects. + static FileFinderInterface const* _findFile; + static ParticleInfoInterface const* _particleInfo; + +}; + +#endif // end BaBar_ExternalInfo diff --git a/BTrkLegacy/HelixParams.hh b/BTrkLegacy/inc/HelixParams.hh similarity index 100% rename from BTrkLegacy/HelixParams.hh rename to BTrkLegacy/inc/HelixParams.hh diff --git a/BTrkLegacy/HelixTraj.hh b/BTrkLegacy/inc/HelixTraj.hh similarity index 100% rename from BTrkLegacy/HelixTraj.hh rename to BTrkLegacy/inc/HelixTraj.hh diff --git a/BTrkLegacy/inc/ParticleInfoInterface.hh b/BTrkLegacy/inc/ParticleInfoInterface.hh new file mode 100644 index 0000000000..d527c69dd7 --- /dev/null +++ b/BTrkLegacy/inc/ParticleInfoInterface.hh @@ -0,0 +1,30 @@ +#ifndef ParticleInfoInterface_hh +#define ParticleInfoInterface_hh + +// +// Definition of an interface for information that must be +// supplied by external code. +// + +// FIMXE: +// This generates a compile time circular dependence - it needs to know the type +// of TrkParticle::type. It does NOT generate a link time or run time circular depennndence. +#include "BTrkLegacy/inc/TrkParticle.hh" + +#include + +class ParticleInfoInterface { + +public: + + virtual double mass ( TrkParticle::type ) const = 0; + virtual double charge( TrkParticle::type ) const = 0; + virtual std::string name ( TrkParticle::type ) const = 0; + +protected: + ParticleInfoInterface(){} + virtual ~ParticleInfoInterface(){} + +}; + +#endif // end ParticleInfoInterface_hh diff --git a/BTrkLegacy/inc/TrkErrCode.hh b/BTrkLegacy/inc/TrkErrCode.hh new file mode 100644 index 0000000000..5dbda4bdbf --- /dev/null +++ b/BTrkLegacy/inc/TrkErrCode.hh @@ -0,0 +1,102 @@ +//-------------------------------------------------------------------------- +// File and Version Information: +// $Id: TrkErrCode.hh,v 1.13 2004/08/06 06:31:40 bartoldu Exp $ +// +// Description: +// Encapsulate error/success status of tracking operations. +// Either failure() or success() will be non-zero, but not both. +// Failure => no valid answer available. +// Success => a valid answer has been +// provided, even if it wasn't exactly what you asked for. The +// value of failure() or success() distinguishes different +// failure/success modes. A string describing the success/failure +// mode can also be provided, and printed by the user. +// +// Note that if this string is provided by the called function, +// it _must_ be a pointer to a statically stored string (which includes +// string literals). E.g. +// TrkErrCode err; +// err.setFailure(10,"Forgot to tie my shoelaces."); +// return err; +// is valid. +// +// Several codes have predefined meanings and strings; strings +// supplied for them will be ignored. Strings for codes >= 10 +// can be supplied by users. Predefined: +// failure = 1 -- "Arithmetic error." +// = 2 -- "Failed to converge." +// = 3 -- "Failed because parallel." +// = 4-9 -- reserved until I think of some more standard codes +// success = 1 -- "Normal completion." +// = 2 -- "Didn't converge." +// = 3 -- "Parallel" +// = 4-9 -- reserved +// +// Environment: +// Software developed for the BaBar Detector at the SLAC B-Factory. +// +// Authors: (Steve Schaffner) -- initial implementation stolen from A. Snyder +// +//------------------------------------------------------------------------ +#ifndef TRKERRCODE_HH +#define TRKERRCODE_HH + +#include +#include + +// Class interface // +class TrkErrCode { +public: + + enum TrkSuccess {fail,succeed}; + + TrkErrCode(TrkSuccess=succeed, int code=1, const char* str=0); + ~TrkErrCode(); + + // Copy constructors + TrkErrCode(const TrkErrCode&); + TrkErrCode& operator=(const TrkErrCode&); + + // access + int failure() const {return _failure;} + int success() const {return _success;} + const std::string& message() const + { + return (_string != 0) ? *_string : _nullStr; + } + void print(std::ostream& ostr) const; + + // set + void setMessage(const char* str = 0) { + if (_string != 0) delete _string; + if (str != 0) { + _string= new std::string(str); + } + else { + _string = 0; + } + } + void setFailure(int i, const char* str = 0) + { + setMessage(str); + _failure=(i==0?1:i); _success=0; + } + void setSuccess(int i, const char* str = 0) { + setMessage(str); + _success=(i==0?1:i); _failure=0; + } + + +private: + // Data + int _failure; + int _success; + std::string* _string; + static std::string _nullStr; +}; + +std::ostream& operator<<(std::ostream& os, const TrkErrCode& trkerr); + +#endif + + diff --git a/BTrkLegacy/inc/TrkParticle.hh b/BTrkLegacy/inc/TrkParticle.hh new file mode 100644 index 0000000000..3f7fd9709d --- /dev/null +++ b/BTrkLegacy/inc/TrkParticle.hh @@ -0,0 +1,49 @@ +// Class to define particle types which can be reconstructed as tracks. +// the type values are copied from the PDG codes. +#ifndef TrkParticle_hh +#define TrkParticle_hh +#include +// for now just the 5 stable 'fundamental' particles +// plus deuterons, tritons, alphas. It should include nuclear fragments, Cascade, someday + +class TrkParticle { + public: + enum type { + e_minus = 11 , + e_plus = -11 , + mu_minus = 13 , + mu_plus = -13 , + pi_plus = 211 , + pi_minus = -211 , + K_plus = 321 , + K_minus = -321 , + p_plus = 2212 , + anti_p_minus = -2212, + deuterium = 1000010020, + tritium = 1000010030, + He3 = 1000020030, + He4 = 100002004 + }; +// construct from a type + TrkParticle(type ptype=e_minus); + TrkParticle(TrkParticle const& other); + ~TrkParticle(); +// basic accessor + type particleType() const { return _type; } + bool operator == (TrkParticle const& other) const { return _type == other._type; } + bool operator != (TrkParticle const& other) const { return ! this->operator==(other); } + TrkParticle & operator =(TrkParticle const& other); +// return basic information + double mass() const; + double charge() const; + std::string const& name() const; +// basic kinematics; provide momentum in CLHEP units + double energy(double momentum) const; // return value in CLHEP units + double beta(double momentum) const; + double betagamma(double momentum) const; + double gamma(double momentum) const; + private: + type _type; +}; + +#endif \ No newline at end of file diff --git a/BTrkLegacy/src/ExternalInfo.cc b/BTrkLegacy/src/ExternalInfo.cc new file mode 100644 index 0000000000..96934af69c --- /dev/null +++ b/BTrkLegacy/src/ExternalInfo.cc @@ -0,0 +1,16 @@ +#include "BTrk/BaBar/ExternalInfo.hh" + +#include + +FileFinderInterface const* ExternalInfo::_findFile = nullptr; +ParticleInfoInterface const* ExternalInfo::_particleInfo = nullptr; + +FileFinderInterface const* ExternalInfo::fileFinderInstance(){ + if ( _findFile != nullptr ) return _findFile; + throw std::runtime_error("BaBar ExternalInfo::fileFinderInstance: instance pointer is null"); +} + +ParticleInfoInterface const* ExternalInfo::particleInfoInstance(){ + if ( _particleInfo != nullptr ) return _particleInfo; + throw std::runtime_error("BaBar ExternalInfo::particleInfoInstance: instance pointer is null"); +} diff --git a/BTrkLegacy/src/TrkParticle.cc b/BTrkLegacy/src/TrkParticle.cc new file mode 100644 index 0000000000..5a356b77bb --- /dev/null +++ b/BTrkLegacy/src/TrkParticle.cc @@ -0,0 +1,156 @@ +// particle description used for tracking +// the implementation depends on the mu2e conditions service, but +// not the interface +#include "BTrk/TrkBase/TrkParticle.hh" +#include "BTrkLegacy/inc/ExternalInfo.hh" +#include "BTrkLegacy/inc/ParticleInfoInterface.hh" + +#include + +TrkParticle::TrkParticle(TrkParticle::type ptype) : _type(ptype) +{} + +TrkParticle::TrkParticle(TrkParticle const& other) : _type(other._type) +{} + +TrkParticle::~TrkParticle() {} + +TrkParticle& +TrkParticle::operator =(TrkParticle const& other) { + if(this != &other){ + _type = other._type; + } + return *this; +} + + +double +TrkParticle::mass() const { +// avoid calling the Particle Data table on each call by buffering results in statics + double retval(-1.0); + switch (_type) { + case e_minus: case e_plus: { + static double e_mass = ExternalInfo::particleInfoInstance()->mass( e_plus ); + return e_mass; + } + + case mu_minus: case mu_plus: { + static double mu_mass = ExternalInfo::particleInfoInstance()->mass( mu_plus ); + return mu_mass; + } + + case pi_minus: case pi_plus: { + static double pi_mass = ExternalInfo::particleInfoInstance()->mass( pi_plus ); + return pi_mass; + } + + case K_minus: case K_plus: { + static double K_mass = ExternalInfo::particleInfoInstance()->mass( K_plus ); + return K_mass; + } + + case anti_p_minus: case p_plus: { + static double p_mass = ExternalInfo::particleInfoInstance()->mass( p_plus ); + return p_mass; + } + + default: { + } + } + return retval; +} + +double +TrkParticle::charge() const { +// avoid calling the Particle Data table on each call by buffering results in statics + double retval(0.0); + switch (_type) { + case e_minus: case mu_minus: case pi_minus: case K_minus: case anti_p_minus: { + static double minus_charge = ExternalInfo::particleInfoInstance()->charge( e_minus ); + return minus_charge; + } + + case e_plus: case mu_plus: case pi_plus: case K_plus: case p_plus: { + static double plus_charge = ExternalInfo::particleInfoInstance()->charge( e_plus ); + return plus_charge; + } + + default: { + } + } + return retval; +} + + +std::string const& +TrkParticle::name() const { +// I can't use HepPDT for the names as those include Latex characters and so conflict +// with many standard software lexicons (like root). + switch (_type) { + case e_minus: { + static std::string e_minus_name = "eMinus"; + return e_minus_name; + } + case e_plus: { + static std::string e_plus_name = "ePlus"; + return e_plus_name; + } + case mu_minus: { + static std::string mu_minus_name = "muMinus"; + return mu_minus_name; + } + case mu_plus: { + static std::string mu_plus_name = "muPlus"; + return mu_plus_name; + } + case pi_minus: { + static std::string pi_minus_name = "piMinus"; + return pi_minus_name; + } + case pi_plus: { + static std::string pi_plus_name = "piPlus"; + return pi_plus_name; + } + case K_minus: { + static std::string K_minus_name = "KMinus"; + return K_minus_name; + } + case K_plus: { + static std::string K_plus_name = "KPlus"; + return K_plus_name; + } + case anti_p_minus: { + static std::string anti_p_minus_name = "pMinus"; + return anti_p_minus_name; + } + case p_plus: { + static std::string p_plus_name = "pPlus"; + return p_plus_name; + } + default: { + static std::string unknown_name("unknown"); + return unknown_name; + } + } +} + +double +TrkParticle::energy(double momentum) const { + double m = mass(); + return sqrt(momentum*momentum + m*m); +} + +double +TrkParticle::beta(double momentum) const { + return fabs(momentum)/energy(momentum); +} + +double +TrkParticle::betagamma(double momentum) const { + return fabs(momentum)/mass(); +} + +double +TrkParticle::gamma(double momentum) const { + return energy(momentum)/mass(); +} \ No newline at end of file diff --git a/CalPatRec/inc/CalHelixFinderData.hh b/CalPatRec/inc/CalHelixFinderData.hh index 205b64f6a3..89e67e5d94 100644 --- a/CalPatRec/inc/CalHelixFinderData.hh +++ b/CalPatRec/inc/CalHelixFinderData.hh @@ -4,8 +4,8 @@ #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" -#include "BTrk/TrkBase/TrkErrCode.hh" -#include "BTrk/TrkBase/TrkParticle.hh" +#include "BTrkLegacy/inc/TrkErrCode.hh" +#include "BTrkLegacy/inc/TrkParticle.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" #include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index a6c7da5318..510a5b2d61 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -20,7 +20,7 @@ #include "Offline/DataProducts/inc/Helicity.hh" // BaBar -#include "BTrkLegacy/HelixTraj.hh" +#include "BTrkLegacy/inc/HelixTraj.hh" #include "Offline/BFieldGeom/inc/BFieldConfig.hh" #include "Offline/CalPatRec/inc/CalHelixFinder_types.hh" diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 2062e14586..33b6954d8e 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -9,7 +9,7 @@ // // the following has to come before other BaBar includes /////////////////////////////////////////////////////////////////////////////// -#include "BTrkLegacy/HelixTraj.hh" +#include "BTrkLegacy/inc/HelixTraj.hh" #include "Offline/CalPatRec/inc/CalHelixFinderAlg.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" diff --git a/CalPatRec/src/CalTimePeakFinderDiag_tool.cc b/CalPatRec/src/CalTimePeakFinderDiag_tool.cc index 7a82715f29..2a833b3caa 100644 --- a/CalPatRec/src/CalTimePeakFinderDiag_tool.cc +++ b/CalPatRec/src/CalTimePeakFinderDiag_tool.cc @@ -9,9 +9,6 @@ #include "CLHEP/Matrix/SymMatrix.h" #include "CLHEP/Vector/ThreeVector.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/KalmanTrack/KalRep.hh" - #include "Offline/BTrkData/inc/TrkStrawHit.hh" #include "Offline/CalPatRec/inc/CalTimePeakFinder_types.hh" From eb9782459963fb49be29c7b62300133d1b23737a Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Sun, 26 Oct 2025 20:43:47 -0700 Subject: [PATCH 019/174] bug fixes in calo digi collision resolution --- CaloMC/inc/CaloDigiWrapperCollection.hh | 2 +- CaloMC/src/CaloDigiWrapperCollection.cc | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CaloMC/inc/CaloDigiWrapperCollection.hh b/CaloMC/inc/CaloDigiWrapperCollection.hh index 1308f713cd..21d3f414b2 100644 --- a/CaloMC/inc/CaloDigiWrapperCollection.hh +++ b/CaloMC/inc/CaloDigiWrapperCollection.hh @@ -39,7 +39,7 @@ namespace mu2e{ // insertion void Append(const CaloDigiCollection&); - void Append(const CaloDigiWrapper); + void Append(const CaloDigiWrapper&); // accessor std::unique_ptr GetDigis() const; diff --git a/CaloMC/src/CaloDigiWrapperCollection.cc b/CaloMC/src/CaloDigiWrapperCollection.cc index 0ae0ae803d..23a2f4c4f4 100644 --- a/CaloMC/src/CaloDigiWrapperCollection.cc +++ b/CaloMC/src/CaloDigiWrapperCollection.cc @@ -73,7 +73,7 @@ namespace mu2e{ } } - void CaloDigiWrapperCollection::Append(const CaloDigiWrapper wrapper){ + void CaloDigiWrapperCollection::Append(const CaloDigiWrapper& wrapper){ _wrappers.push_back(wrapper); } @@ -159,12 +159,21 @@ namespace mu2e{ // if only one digi present, then nothing to do if (collided.size() < 2){ rv.Append(collided.front()); + return; } // multiple digis must be summed into a single waveform + // here we determine the length of that waveform, by finding + // how far past the end of the first it extends, if at all const auto& first = collided.front().Digi(); - const auto& last = collided.back().Digi(); - size_t length = (last.t0() - first.t0()) + last.waveform().size(); + size_t length = 0; + for (const auto& wrapper: collided){ + const auto& digi = wrapper.Digi(); + size_t proposed = (digi.t0() - first.t0()) + digi.waveform().size(); + if (length < proposed){ + length = proposed; + } + } std::vector samples(length, 0); // sum each individual waveform into the total From f4bb89206ae6e78ec33e3d3f7910a7637eb74e95 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 16 Nov 2025 17:07:44 -0800 Subject: [PATCH 020/174] removed btrk from analyses --- Analyses/CMakeLists.txt | 132 -- Analyses/src/CaloCalib_module.cc | 3 - Analyses/src/CaloTrackMatchExample_module.cc | 1 - Analyses/src/CosmicAnalysis_module.cc | 3 - Analyses/src/CosmicFilter_module.cc | 2 +- Analyses/src/KineticFracAnalysis_module.cc | 1243 ----------------- Analyses/src/PbarAnalysis2_module.cc | 1080 -------------- Analyses/src/PtrTest_module.cc | 93 -- Analyses/src/ReadCaloDigi_module.cc | 869 ------------ Analyses/src/ReadPtr_module.cc | 105 -- .../src/ReadTrackCaloMatchingMVA_module.cc | 524 ------- Analyses/src/ReadTrackCaloMatching_module.cc | 243 ---- Analyses/src/ReadTrkExtrapolMVA_module.cc | 179 --- Analyses/src/ReadTrkExtrapol_module.cc | 231 --- Analyses/src/TrackSummaryMaker_module.cc | 120 -- Analyses/src/TrackSummaryTruthMaker_module.cc | 108 -- Analyses/src/materailsPropStudy_module.cc | 184 --- 17 files changed, 1 insertion(+), 5119 deletions(-) delete mode 100644 Analyses/src/KineticFracAnalysis_module.cc delete mode 100644 Analyses/src/PbarAnalysis2_module.cc delete mode 100644 Analyses/src/PtrTest_module.cc delete mode 100644 Analyses/src/ReadCaloDigi_module.cc delete mode 100644 Analyses/src/ReadPtr_module.cc delete mode 100644 Analyses/src/ReadTrackCaloMatchingMVA_module.cc delete mode 100644 Analyses/src/ReadTrackCaloMatching_module.cc delete mode 100644 Analyses/src/ReadTrkExtrapolMVA_module.cc delete mode 100644 Analyses/src/ReadTrkExtrapol_module.cc delete mode 100644 Analyses/src/TrackSummaryMaker_module.cc delete mode 100644 Analyses/src/TrackSummaryTruthMaker_module.cc delete mode 100644 Analyses/src/materailsPropStudy_module.cc diff --git a/Analyses/CMakeLists.txt b/Analyses/CMakeLists.txt index 9230225aa3..185ab67f1a 100644 --- a/Analyses/CMakeLists.txt +++ b/Analyses/CMakeLists.txt @@ -272,31 +272,6 @@ cet_build_plugin(InteractiveRoot art::module Offline::MCDataProducts ) -cet_build_plugin(KineticFracAnalysis art::module - REG_SOURCE src/KineticFracAnalysis_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeneralUtilities - Offline::GeometryService - Offline::GlobalConstantsService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::TrackerGeom -) - -cet_build_plugin(materailsPropStudy art::module - REG_SOURCE src/materailsPropStudy_module.cc - LIBRARIES REG - art_root_io::TFileService_service - BTrk_DetectorModel - BTrk_MatEnv - BTrk_TrkBase - Offline::SeedService - ROOT::Tree -) - cet_build_plugin(MTVerification art::module REG_SOURCE src/MTVerification_module.cc LIBRARIES REG @@ -332,21 +307,6 @@ cet_build_plugin(ParticleIDScan art::module Offline::ParticleID ) -cet_build_plugin(PbarAnalysis2 art::module - REG_SOURCE src/PbarAnalysis2_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CaloCluster - Offline::CalorimeterGeom - Offline::ConditionsService - Offline::DataProducts - Offline::GeometryService - Offline::GlobalConstantsService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::TrackerGeom -) - cet_build_plugin(pbars1hist art::module REG_SOURCE src/pbars1hist_module.cc LIBRARIES REG @@ -443,14 +403,6 @@ cet_build_plugin(PtrTest0 art::module Offline::MCDataProducts ) -cet_build_plugin(PtrTest art::module - REG_SOURCE src/PtrTest_module.cc - LIBRARIES REG - - - Offline::RecoDataProducts -) - cet_build_plugin(ReadAntiProtonSteps art::module REG_SOURCE src/ReadAntiProtonSteps_module.cc LIBRARIES REG @@ -485,20 +437,6 @@ cet_build_plugin(ReadBack art::module Offline::TrackerGeom ) -cet_build_plugin(ReadCaloDigi art::module - REG_SOURCE src/ReadCaloDigi_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::ConditionsService - Offline::DataProducts - Offline::GeometryService - Offline::GlobalConstantsService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::SeedService -) - cet_build_plugin(ReadMCTrajectories art::module REG_SOURCE src/ReadMCTrajectories_module.cc LIBRARIES REG @@ -524,13 +462,6 @@ cet_build_plugin(ReadPTM art::module Offline::MCDataProducts ) -cet_build_plugin(ReadPtr art::module - REG_SOURCE src/ReadPtr_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::RecoDataProducts -) - cet_build_plugin(ReadStrawDigiReco art::module REG_SOURCE src/ReadStrawDigiReco_module.cc LIBRARIES REG @@ -549,27 +480,6 @@ cet_build_plugin(ReadStrawHitReco art::module Offline::TrackerGeom ) -cet_build_plugin(ReadTrackCaloMatching art::module - REG_SOURCE src/ReadTrackCaloMatching_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::ConditionsService - Offline::GeometryService - Offline::RecoDataProducts - Offline::TrackerGeom -) - -cet_build_plugin(ReadTrackCaloMatchingMVA art::module - REG_SOURCE src/ReadTrackCaloMatchingMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts -) - cet_build_plugin(ReadTrackerSteps art::module REG_SOURCE src/ReadTrackerSteps_module.cc LIBRARIES REG @@ -580,26 +490,6 @@ cet_build_plugin(ReadTrackerSteps art::module Offline::TrackerGeom ) -cet_build_plugin(ReadTrkExtrapol art::module - REG_SOURCE src/ReadTrkExtrapol_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::ConditionsService - Offline::GeometryService - Offline::RecoDataProducts - Offline::TrackerGeom -) - -cet_build_plugin(ReadTrkExtrapolMVA art::module - REG_SOURCE src/ReadTrkExtrapolMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::ConditionsService - Offline::GeometryService - Offline::RecoDataProducts - Offline::TrackerGeom -) - cet_build_plugin(ReadVirtualDetector art::module REG_SOURCE src/ReadVirtualDetector_module.cc LIBRARIES REG @@ -754,17 +644,6 @@ cet_build_plugin(TrackSummaryDataAnalyzer art::module Offline::RecoDataProducts ) -cet_build_plugin(TrackSummaryMaker art::module - REG_SOURCE src/TrackSummaryMaker_module.cc - LIBRARIES REG - - - Offline::DataProducts - Offline::GeometryService - Offline::Mu2eUtilities - Offline::RecoDataProducts -) - cet_build_plugin(TrackSummaryMCAnalyzer art::module REG_SOURCE src/TrackSummaryMCAnalyzer_module.cc LIBRARIES REG @@ -775,17 +654,6 @@ cet_build_plugin(TrackSummaryMCAnalyzer art::module Offline::RecoDataProducts ) -cet_build_plugin(TrackSummaryTruthMaker art::module - REG_SOURCE src/TrackSummaryTruthMaker_module.cc - LIBRARIES REG - - - Offline::BTrkData - Offline::MCDataProducts - Offline::Mu2eUtilities - Offline::RecoDataProducts -) - cet_build_plugin(TrackSummaryTruthRFSelector art::module REG_SOURCE src/TrackSummaryTruthRFSelector_module.cc LIBRARIES REG diff --git a/Analyses/src/CaloCalib_module.cc b/Analyses/src/CaloCalib_module.cc index 9a50bacb78..b4bedc5225 100644 --- a/Analyses/src/CaloCalib_module.cc +++ b/Analyses/src/CaloCalib_module.cc @@ -50,9 +50,6 @@ #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -// BaBar Kalman filter includes -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/HelixTraj.hh" #include diff --git a/Analyses/src/CaloTrackMatchExample_module.cc b/Analyses/src/CaloTrackMatchExample_module.cc index b481dd152e..35d7b372b0 100644 --- a/Analyses/src/CaloTrackMatchExample_module.cc +++ b/Analyses/src/CaloTrackMatchExample_module.cc @@ -16,7 +16,6 @@ #include "Offline/RecoDataProducts/inc/KalRepCollection.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" diff --git a/Analyses/src/CosmicAnalysis_module.cc b/Analyses/src/CosmicAnalysis_module.cc index 04ac2db004..999466462b 100644 --- a/Analyses/src/CosmicAnalysis_module.cc +++ b/Analyses/src/CosmicAnalysis_module.cc @@ -36,9 +36,6 @@ using namespace CLHEP; #include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" typedef struct { diff --git a/Analyses/src/CosmicFilter_module.cc b/Analyses/src/CosmicFilter_module.cc index 587713016b..1085c639d1 100644 --- a/Analyses/src/CosmicFilter_module.cc +++ b/Analyses/src/CosmicFilter_module.cc @@ -28,7 +28,7 @@ #include "Offline/RecoDataProducts/inc/StrawHit.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" -#include "BTrk/TrkBase/HelixParams.hh" +#include "BTrkLegacy/inc/HelixParams.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" using namespace std; diff --git a/Analyses/src/KineticFracAnalysis_module.cc b/Analyses/src/KineticFracAnalysis_module.cc deleted file mode 100644 index e631a3ca23..0000000000 --- a/Analyses/src/KineticFracAnalysis_module.cc +++ /dev/null @@ -1,1243 +0,0 @@ -// -// an EDAnalyzer module that writes out calorimeter and tracker information so that it can be used to study combined track/calo information. Largely based on Echenard's CaloExample_module.cc - -// -// Original author Robert Bernstein -// - -#include "CLHEP/Units/SystemOfUnits.h" - -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" -#include "Offline/GlobalConstantsService/inc/unknownPDGIdName.hh" -#include "art/Framework/Core/EDAnalyzer.h" - -#include "Offline/TrackerGeom/inc/Tracker.hh" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" - -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" - -#include "Offline/MCDataProducts/inc/CaloMCTruthAssns.hh" -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/GenId.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" - -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloMatch.hh" - -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/TrackCaloAssns.hh" - -// data -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/TimeCluster.hh" - -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" - -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Principal/Selector.h" -#include "art/Framework/Principal/Provenance.h" -#include "cetlib_except/exception.h" -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -#include "canvas/Utilities/InputTag.h" - -#include "TDirectory.h" -#include "TNtuple.h" -#include "TTree.h" -#include "TH2F.h" -#include "TH1F.h" -#include "TProfile.h" - -#include -#include -#include -#include -#include - -#include "Offline/GeneralUtilities/inc/sqrtOrThrow.hh" - -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; -using CLHEP::keV; - -namespace mu2e { - - class KineticFracAnalysis : public art::EDAnalyzer { - - public: - - typedef art::Ptr StepPtr; - typedef std::vector StepPtrs; - typedef std::map HitMap; - - explicit KineticFracAnalysis(fhicl::ParameterSet const& pset); - - virtual ~KineticFracAnalysis() { } - - virtual void beginJob(); - virtual void endJob(); - - // This is called for each event. - virtual void analyze(const art::Event& e); - - private: - - typedef std::vector< art::Handle > HandleVector; - typedef art::Ptr< CaloHit> CaloHitPtr; - typedef art::Ptr SimParticlePtr; - - int _diagLevel; - int _nProcess; - std::string _g4ModuleLabel; - std::string _generatorModuleLabel; - art::InputTag _simParticleTag; - std::string _caloReadoutModuleLabel; - std::string _caloCrystalModuleLabel; - std::string _caloClusterModuleLabel; - std::string _caloDigiTruthModuleLabel; - std::string _caloClusterTruthModuleLabel; - std::string _trkCaloMatchModuleLabel; - std::string _trkIntersectModuleLabel; - std::string _trkFitterModuleLabel; - std::string _virtualDetectorLabel; - std::string _stepPointMCLabel; - std::string _trkPatRecModuleLabel; - TrkParticle _tpart; - TrkFitDirection _fdir; - std::string _shLabel; - std::string _shpLabel; - std::string _shfLabel; - std::string _bkfLabel; - std::string _trkfitInstanceName; - std::string _caloClusterAlgorithm; - std::string _caloClusterSeeding; - const std::string _producerName; - std::string _instanceName; - - - const StrawHitCollection* _shcol; - const StrawHitFlagCollection* _shfcol; - const StrawHitFlagCollection* _bkfcol; - const StrawHitPositionCollection* _shpcol; - - TH1F *_hcryE,*_hcryT,*_hcryX,*_hcryY,*_hcryZ; - TH1F *_hcluE,*_hcluT,*_hcluX,*_hcluY,*_hcluZ,*_hcluE1Et,*_hcluE1E9,*_hcluE1E25; - - TH1F *_hfitstatus - ,*_htrkcon - ,*_htrkcon1 - ,*_htrkcon2 - ,*_htrkmomErr - ,*_htrkmomErr1 - ,*_htrkmomErr2 - ,*_htrkt0 - ,*_hTimeDiffBest1st - ,*_hTimeDiffBest2nd - ,*_htrkt0Err - ,*_htrkt0Err1 - ,*_htrkt0Err2 - ,*_hfitpar_d0 - ,*_hfitpar_z0 - ,*_hfitpar_td - ,*_hfitpar_om - ,*_hfitpar_d0omega - ,*_hPhi0 - ,*_hnactive - ,*_hfitmom - ,*_hevtwt - ,*_hfitmomCutSetC - ,*_hfitmomFinal - ,*_hClusterEnergy - ,*_hNumberOfClusters - ,*_hClusterEnergyInWindow - ,*_hNumberOfClustersInWindow - ,*_hTimeOfCluster - ,*_hHighestEnergyCluster - ,*_hNumberOfTracks - ,*_hMomentumOfTrackForCal - ,*_hTotalEnergyInWindow - ,*_hDistX - ,*_hDistY - ,*_htime - ,*_hShortestDistance, *_hShortestFirst - ,*_hClusterRadius - ,*_hEnergyAtLargeRadius - ,*_hNumberAtLargeRadius - ,*_hTotalEnergyAtLargeRadius - ,*_hPdgIdOfAllClustersAtLargeRadius - ,*_hCloseDeltasMean - ,*_hCloseDeltasSigma - ,*_hCloseDeltasAmplitude - ,*_hTimeOfDeltaWrtT0Zoom - ,*_hEnergyAtSmallRadius - ,*_hNumberAtSmallRadius - ,*_hTotalEnergyAtSmallRadius - ,*_hPdgIdOfAllClustersAtSmallRadius; - - TH1F - *_hPdgId - ,*_hCluConv - ,*_hEoverP1st - ,*_hEoverP2nd - ,*_hEOverPZoom - ,*_hDistToTrack - ,*_hDistToTrackGoodCutC - ,*_hNumberOfHits - ,*_hNumberOfHitsAfter650Nsec - ,*_hTimeDiff - ,*_hNHitsInTime - ,*_hZOfHit - ,*_hEnergyDeposit - ,*_hEnergyDepositFront - ,*_hNumberOfDeltas - ,*_hTimeOfDeltaWrtT0 - ,*_hCloseDeltas - ,*_hMuonSampleMomentum - ,*_hMuonFrac - ,*_hPionFrac - ,*_hMuonFracCutMomentum - ,*_hPionFracCutMomentum - ,*_hWeirdFracCutMomentum - ,*_hWeirdFracCluster - ,*_hMuonFracCluster - ,*_hPionFracCluster - ,*_hNumberOfCrystalsMedFrac - ,*_hNumberOfCrystalsLowFrac - ,*_hNumberOfCrystalsHighFrac - ,*_hSingleCrystalFrac - ,*_hDoubleCrystalFrac - ,*_hTripleCrystalFrac - ,*_hCascade - ,*_hShortestDistanceClusterTime; - - TH1F* _hZinter; - TH1F* _hChisqDisk1GoodZ; - TH1F* _hChisqDisk1BadZ; - TH1F* _hDisk1GoodRadius; - TH1F* _hDisk1BadRadius; - TH1F* _hAngGood; - TH1F* _hAngBad; - TH1F* _hZForBadDisk1; - - TH1F* _hFracOnFrontFace; - TH1F* _hFracOnEdgeFace; - TH1F* _hFracOnEdgeFaceAndClusterInFront; - TH1F* _hFracOnEdgeFaceAndClusterInBack; - - TProfile - *_hErrVsMomMuon - ,*_hErrVsD0Muon - ,*_hErrVsOmegaMuon - ,*_hErrVsTanDipMuon - ,*_hErrVsMomPion - ,*_hErrVsD0Pion - ,*_hErrVsOmegaPion - ,*_hErrVsTanDipPion; - TH2F *_hTanDipVsMomentumPion; - TH2F *_hTanDipVsMomentumMuon; - - TProfile - *_hErrVsMomHiFrac - ,*_hErrVsD0HiFrac - ,*_hErrVsOmegaHiFrac - ,*_hErrVsTanDipHiFrac; - - TH2F *_hTanDipVsMomentumHiFrac, *_hTanDipVsMomentumLoFrac; - - TProfile *_hErrVsMomLoFrac, *_hErrVsD0LoFrac, *_hErrVsOmegaLoFrac, - *_hErrVsTanDipLoFrac; - - TH2F *_hFracVsTime, *_hRadiusVsTime, *_hFracVsRadius, *_hFracVsLocation, - *_hMuonFracVsLocation, *_hFracVsP; - - int _timeDiff; - - TTree* _Ntup; - - int _evt,_run; - - int _nGen,_genPdgId[16384],_genCrCode[16384]; - float _genmomX[16384],_genmomY[16384],_genmomZ[16384],_genStartX[16384],_genStartY[16384],_genStartZ[16384],_genStartT[16384]; - - int _nHits,_cryId[16384],_crySectionId[16384],_crySimIdx[16384],_crySimLen[16384]; - float _cryEtot,_cryTime[16384],_cryEdep[16384],_cryDose[16384],_cryPosX[16384],_cryPosY[16384],_cryPosZ[16384],_cryLeak[16384]; - - int _nSim,_motId[16384],_motPdgId[16384],_motcrCode[16384],_motGenIdx[16384]; - float _motmom[16384],_motStartX[16384],_motStartY[16384],_motStartZ[16384],_motStartT[16384]; - float _motTime[16384],_motEdep[16348],_motPosX[16384],_motPosY[16384],_motPosZ[16384]; - - int _nCluster,_nCluSim,_cluNcrys[16384]; - float _cluEnergy[16384],_cluTime[16384],_cluCogX[16384],_cluCogY[16384],_cluCogZ[16384]; - int _cluConv[16384],_cluSimIdx[16384],_cluSimLen[16384]; - std::vector > _cluList; - - int _clusimId[16384],_clusimPdgId[16384],_clusimGenIdx[16384]; - float _clusimMom[16384],_clusimPosX[16384],_clusimPosY[16384],_clusimPosZ[16384],_clusimTime[16384],_clusimEdep[16384]; - - int _nVd,_vdId[16384],_vdPdgId[16384],_vdenIdx[16384]; - float _vdTime[16384],_vdPosX[16384],_vdPosY[16384],_vdPosZ[16384],_vdMom[16384]; - - int _nTrkOk,_nTrk,_trkOk[8192],_trkstat[8192],_trknHit[8192]; - float _trkDip[8192],_trkpt[8192],_trkcon[8192],_trkmomErr[8192]; - - float _trkt0[8192],_trkMom[8192], _trkd0[8192],_trkz0[8192],_trkOmega[8192],_trkPhi0[8192],_trkt0Err[8192]; //rhb added - - float _hitTime[32768]; - float _hitEnergy[32768]; - float _hitZ[32768]; - int _hitIsDelta[32768]; - int _nTrackerHits; - int _nGoodHits; - int _nDeltas; - - - int _nMatch, _mTrkId[1024],_mCluId[1024]; - float _mChi2[1024],_mChi2Pos[1024],_mChi2Time[1024]; - int _nTrkHel,_trknHitHel[1024],_trkStatHel[1024],_trkCluIdxHel[1024]; - float _trkx[1024],_trky[1024],_trkz[1024],_trkFFx[1024],_trkFFy[1024],_trkFFz[1024],_trke[1024],_trkt[1024]; - float _trkpx[1024],_trkpy[1024],_trkpz[1024],_trkprob[1024]; - float _trkphi0[1024],_trkomega[1024],_trkcdip[1024],_trkdlen[1024]; - - int _goodKfrac; - // CLHEP::Hep3Vector _firstDiskLoc; - //CLHEP::Hep3Vector _secondDiskLoc; - double _firstDiskZ; - double _secondDiskZ; - double _tol = 1.0*CLHEP::mm; // for comparisons, slight differences in computations at 1e-9 level - }; - - KineticFracAnalysis::KineticFracAnalysis(fhicl::ParameterSet const& pset) : - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel",0)), - _nProcess(0), - _g4ModuleLabel(pset.get("g4ModuleLabel")), - _generatorModuleLabel(pset.get("generatorModuleLabel")), - _simParticleTag(pset.get("simParticleTag")), - _caloReadoutModuleLabel(pset.get("caloReadoutModuleLabel")), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel")), - _caloClusterModuleLabel(pset.get("caloClusterModuleLabel")), - _caloDigiTruthModuleLabel(pset.get("caloHitTruthModuleLabel")), - _caloClusterTruthModuleLabel(pset.get("caloClusterTruthModuleLabel")), - _trkCaloMatchModuleLabel(pset.get("trkCaloMatchModuleLabel")), - _trkIntersectModuleLabel(pset.get("trkIntersectModuleLabel")), - _trkFitterModuleLabel(pset.get("fitterModuleLabel")), - _virtualDetectorLabel(pset.get("virtualDetectorName")), - _stepPointMCLabel(pset.get("stepPointMCLabel")), - _trkPatRecModuleLabel(pset.get("trkPatRecModuleLabel")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _shLabel(pset.get("StrawHitCollectionLabel","makeSH")), - _shpLabel(pset.get("StrawHitPositionCollectionLabel","MakeStereoHits")), - _shfLabel (pset.get("StrawHitFlagCollectionLabel" ,"FlagStrawHits" )), - _bkfLabel (pset.get("StrawHitBkgFlagCollectionLabel" ,"FlagBkgHits" )), - _timeDiff(pset.get("timeDifference",15)), - _Ntup(0) - { - _instanceName = _fdir.name() + _tpart.name(); - _trkfitInstanceName = _fdir.name() + _tpart.name(); - - } - - /* art::EDAnalyzer(pset), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel")), - _caloClusterModuleLabel(pset.get("caloClusterModuleLabel")), - _trkCaloMatchModuleLabel(pset.get("trkCaloMatchModuleLabel")), - _trkIntersectModuleLabel(pset.get("trkIntersectModuleLabel")), - _trkFitterModuleLabel(pset.get("fitterModuleLabel")), - _tpart((TrkParticle::type)(pset.get("fitparticle"))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - _g4ModuleLabel(pset.get("g4ModuleLabel")), - _virtualDetectorLabel(pset.get("virtualDetectorName")), - _Ntup(0) - { - _trkfitInstanceName = _fdir.name() + _tpart.name(); - } - */ - void KineticFracAnalysis::beginJob(){ - - art::ServiceHandle tfs; - - _Ntup = tfs->make("KineticFrac", "KineticFrac"); - - _Ntup->Branch("evt", &_evt , "evt/I"); - _Ntup->Branch("run", &_run , "run/I"); - _Ntup->Branch("cryEtot", &_cryEtot , "cryEtot/F"); - - _Ntup->Branch("nMatch", &_nMatch , "nMatch/I"); - _Ntup->Branch("mTrkId", &_mTrkId, "mTrkId[nMatch]/I"); - _Ntup->Branch("mCluId", &_mCluId, "mCluId[nMatch]/I"); - _Ntup->Branch("mChi2", &_mChi2, "mChi2[nMatch]/F"); - _Ntup->Branch("mChi2Pos", &_mChi2Pos, "mChi2Pos[nMatch]/F"); - _Ntup->Branch("mChi2Time", &_mChi2Time, "mChi2Time[nMatch]/F"); - - _Ntup->Branch("nGen", &_nGen , "nGen/I"); - _Ntup->Branch("genId", &_genPdgId, "genId[nGen]/I"); - _Ntup->Branch("genCrCode", &_genCrCode, "genCrCode[nGen]/I"); - _Ntup->Branch("genMomX", &_genmomX, "genMomX[nGen]/F"); - _Ntup->Branch("genMomY", &_genmomY, "genMomY[nGen]/F"); - _Ntup->Branch("genMomZ", &_genmomZ, "genMomZ[nGen]/F"); - _Ntup->Branch("genStartX", &_genStartX, "genStartX[nGen]/F"); - _Ntup->Branch("genStartY", &_genStartY, "genStartY[nGen]/F"); - _Ntup->Branch("genStartZ", &_genStartZ, "genStartZ[nGen]/F"); - _Ntup->Branch("genStartT", &_genStartT, "genStartT[nGen]/F"); - - _Ntup->Branch("nCry", &_nHits , "nCry/I"); - _Ntup->Branch("cryId", &_cryId , "cryId[nCry]/I"); - _Ntup->Branch("crySectionId", &_crySectionId, "crySectionId[nCry]/I"); - _Ntup->Branch("cryPosX", &_cryPosX , "cryPosX[nCry]/F"); - _Ntup->Branch("cryPosY", &_cryPosY , "cryPosY[nCry]/F"); - _Ntup->Branch("cryPosZ", &_cryPosZ , "cryPosZ[nCry]/F"); - _Ntup->Branch("cryEdep", &_cryEdep , "cryEdep[nCry]/F"); - _Ntup->Branch("cryTime", &_cryTime , "cryTime[nCry]/F"); - _Ntup->Branch("cryDose", &_cryDose , "cryDose[nCry]/F"); - _Ntup->Branch("crySimIdx", &_crySimIdx , "crySimIdx[nCry]/I"); - _Ntup->Branch("crySimLen", &_crySimLen , "crySimLen[nCry]/I"); - - _Ntup->Branch("nSim", &_nSim , "nSim/I"); - _Ntup->Branch("simId", &_motId , "simId[nSim]/I"); - _Ntup->Branch("simPdgId", &_motPdgId , "simPdgId[nSim]/I"); - _Ntup->Branch("simCrCode", &_motcrCode , "simCrCode[nSim]/I"); - _Ntup->Branch("simMom", &_motmom , "simMom[nSim]/F"); - _Ntup->Branch("simStartX", &_motStartX , "simStartX[nSim]/F"); - _Ntup->Branch("simStartY", &_motStartY , "simStartY[nSim]/F"); - _Ntup->Branch("simStartZ", &_motStartZ , "simStartZ[nSim]/F"); - _Ntup->Branch("simStartT", &_motStartT , "simStartT[nSim]/F"); - _Ntup->Branch("simPosX", &_motPosX , "simPosX[nSim]/F"); - _Ntup->Branch("simPosY", &_motPosY , "simPosY[nSim]/F"); - _Ntup->Branch("simPosZ", &_motPosZ , "simPosZ[nSim]/F"); - _Ntup->Branch("simTime", &_motTime , "simTime[nSim]/F"); - _Ntup->Branch("simEdep", &_motEdep , "simEdep[nSim]/F"); - _Ntup->Branch("simGenIdx", &_motGenIdx , "simGenIdx[nSim]/I"); - - _Ntup->Branch("nCluster", &_nCluster , "nCluster/I"); - _Ntup->Branch("cluEnergy", &_cluEnergy , "cluEnergy[nCluster]/F"); - _Ntup->Branch("cluTime", &_cluTime , "cluTime[nCluster]/F"); - _Ntup->Branch("cluCogX", &_cluCogX , "cluCogX[nCluster]/F"); - _Ntup->Branch("cluCogY", &_cluCogY , "cluCogY[nCluster]/F"); - _Ntup->Branch("cluCogZ", &_cluCogZ , "cluCogZ[nCluster]/F"); - _Ntup->Branch("cluNcrys", &_cluNcrys , "cluNcrys[nCluster]/I"); - _Ntup->Branch("cluConv", &_cluConv , "cluConv[nCluster]/I"); - _Ntup->Branch("cluSimIdx", &_cluSimIdx , "cluSimIdx[nCluster]/I"); - _Ntup->Branch("cluSimLen", &_cluSimLen , "cluSimLen[nCluster]/I"); - _Ntup->Branch("cluList", &_cluList); - - _Ntup->Branch("nCluSim", &_nCluSim , "nCluSim/I"); - _Ntup->Branch("clusimId", &_clusimId , "clusimId[nCluSim]/I"); - _Ntup->Branch("clusimPdgId", &_clusimPdgId , "clusimPdgId[nCluSim]/I"); - _Ntup->Branch("clusimGenIdx", &_clusimGenIdx ,"clusimGenIdx[nCluSim]/I"); - _Ntup->Branch("clusimMom", &_clusimMom , "clusimMom[nCluSim]/F"); - _Ntup->Branch("clusimPosX", &_clusimPosX , "clusimPosX[nCluSim]/F"); - _Ntup->Branch("clusimPosY", &_clusimPosY , "clusimPosY[nCluSim]/F"); - _Ntup->Branch("clusimPosZ", &_clusimPosZ , "clusimPosZ[nCluSim]/F"); - _Ntup->Branch("clusimTime", &_clusimTime , "clusimTime[nCluSim]/F"); - _Ntup->Branch("clusimEdep", &_clusimEdep , "clusimEdep[nCluSim]/F"); - - _Ntup->Branch("nVd", &_nVd , "nVd/I"); - _Ntup->Branch("vdId", &_vdId , "vdId[nVd]/I"); - _Ntup->Branch("vdPdgId", &_vdPdgId , "vdPdgId[nVd]/I"); - _Ntup->Branch("vdMom", &_vdMom , "vdMom[nVd]/F"); - _Ntup->Branch("vdPosX", &_vdPosX , "vdPosX[nVd]/F"); - _Ntup->Branch("vdPosY", &_vdPosY , "vdPosY[nVd]/F"); - _Ntup->Branch("vdPosZ", &_vdPosZ , "vdPosZ[nVd]/F"); - _Ntup->Branch("vdTime", &_vdTime , "vdTime[nVd]/F"); - _Ntup->Branch("vdGenIdx", &_vdenIdx , "vdGenIdx[nVd]/I"); - - _Ntup->Branch("nTrkOk", &_nTrkOk , "nTrkOk/I"); - _Ntup->Branch("nTrk", &_nTrk , "nTrk/I"); - _Ntup->Branch("trkDip", &_trkDip , "trkDip[nTrk]/F"); - _Ntup->Branch("trkOk", &_trkOk , "trkOk[nTrk]/I"); - _Ntup->Branch("trkpt", &_trkpt , "trkpt[nTrk]/F"); - _Ntup->Branch("trkstat", &_trkstat , "trkstat[nTrk]/I"); - _Ntup->Branch("trkcon", &_trkcon , "trkcon[nTrk]/F"); - _Ntup->Branch("trknHit", &_trknHit , "trknHit[nTrk]/I"); - _Ntup->Branch("trkmomErr", &_trkmomErr , "trkmomErr[nTrk]/F"); - _Ntup->Branch("trkt0", &_trkt0 , "trkt0[nTrk]/F"); - _Ntup->Branch("trkt0Err", &_trkt0Err, "trkt0Err[nTrk]/F"); - - _Ntup->Branch("trkMom", &_trkMom , "trkMom[nTrk]/F"); - _Ntup->Branch("trkd0", &_trkd0 , "trkd0[nTrk]/F"); - _Ntup->Branch("trkz0", &_trkz0 , "trkz0[nTrk]/F"); - _Ntup->Branch("trkOmega", &_trkOmega , "trkOmega[nTrk]/F"); - _Ntup->Branch("trkPhi0", &_trkPhi0 , "trkPhi0[nTrk]/F"); - - _hcryE = tfs->make("cryEdep","Energy deposited / crystal",100,0.,50.); - _hcryT = tfs->make("cryTime","Time of crystal hit",100,0.,2000.); - _hcryX = tfs->make("cryX","X coord of crystal hit",100,300.,700.); - _hcryY = tfs->make("cryY","Y coord of crystal hit",100,300.,700.); - _hcryZ = tfs->make("cryZ","Z coord of crystal hit",100,11000.,13000.); - - _hcluE = tfs->make("cluEdep","Energy deposited / clustal",150,0.,150.); - _hcluT = tfs->make("cluTime","Time of clustal hit",100,0.,2000.); - _hcluX = tfs->make("cluX","X coord of clustal hit",100,300.,700.); - _hcluY = tfs->make("cluY","Y coord of clustal hit",100,300.,700.); - _hcluZ = tfs->make("cluZ","Z coord of clustal hit",100,11000.,13000.); - _hcluE1Et = tfs->make("cluE1Et","E1/Etot",100,0,1.1); - _hcluE1E9 = tfs->make("cluE1E9","E1/E9",100,0,1.1); - _hcluE1E25 = tfs->make("cluE1E25","E1/E25",100,0,1.1); - - _hPdgId = tfs->make("_hpdgId","pdg Id for cluster associated with fitted track",100,-50.,50.); - _hfitstatus = tfs->make("_hfitstatus","fitstatus",20,0.,20.); - _hnactive = tfs->make("_hnactive","trknHit[ithtrk]",100,0.,100.); - _htrkcon = tfs->make("_htrkcon","trkcon",100,0.,1.); - _htrkcon1 = tfs->make("_htrkcon1","trkcon2",100,0.,1.); - _htrkcon2 = tfs->make("_htrkcon2","trkcon2",100,0.,1.); - _htrkmomErr = tfs->make("_htrkmomErr","trkmomErr",100,0.,2.); - _htrkmomErr1 = tfs->make("_htrkmomErr1","trkmomErr1",100,0.,2.); - _htrkmomErr2 = tfs->make("_htrkmomErr2","trkmomErr2",100,0.,2.); - _htrkt0 = tfs->make("_htrkt0","trkt0",170,0.,1700.); - _htrkt0Err = tfs->make("_htrkt0Err","trkt0Err",100,0.,10.); - _htrkt0Err1 = tfs->make("_htrkt0Err1","trkt0Err1",100,0.,10.); - _htrkt0Err2 = tfs->make("_htrkt0Err2","trkt0Err2",100,0.,10.); - _hfitpar_om = tfs->make("_hfitpar_om","om",100,0.,0.02); - _hfitpar_d0 = tfs->make("_hfitpar_d0","d0",100,-200.,500.); - _hfitpar_z0 = tfs->make("_hfitpar_z0","z0",1000,-1000.,1000.); - _hfitpar_d0omega = tfs->make("_hfitpar_d0omega","d0 + 2/om",120,-200.,1000.); - _hfitpar_td = tfs->make("_hfitpar_td","tandip",100,0.,3.); - _hfitmom = tfs->make("_hfitmom","fitmom",300,0.,300.); - _hevtwt = tfs->make("_hevtwt","event weight",300,0.,.035); - _hfitmomCutSetC = tfs->make("_hfitmomCutSetC","fitmom",300,0.,150.); - _hfitmomFinal = tfs->make("_hfitmomFinal","fitmom",10,103.5,105.); - _hNumberOfTracks = tfs->make("_hNumberOfTracks", "Number of Tracks", 5,0.,5.); - _hTimeOfCluster = tfs->make("_hTimeOfCluster", "Time Of Cluster", 1700,0.,1700.); - _hNumberOfClusters = tfs->make("_hNumberOfClusters","Number Of Clusters", 100,0.,100.); - _hNumberOfClustersInWindow = tfs->make("_hNumberOfClustersInWindow","Number Of Clusters In Window", 20,0.,20.); - _hClusterEnergy = tfs->make("_hClusterEnergy","Energy Of Clusters", 60,0.,300.); - _hClusterEnergyInWindow = tfs->make("_hClusterEnergyInWindow","Energy Of Clusters In Window", 60,0.,300.); - _hHighestEnergyCluster = tfs->make("_hHighestEnergyCluster", "Highest Energy Cluster", 60,0.,300.); - _hMomentumOfTrackForCal = tfs->make("_hMomentumOfTrackForCal","Momentum of Track Defining Cluster Window", 300,0.,150.); - _hTotalEnergyInWindow = tfs->make("_hTotalEnergyInWindow","Total Energy In Window", 300,0.,300.); - _hDistX = tfs->make("_hDistX","Distance from Track to Highest Energy Cluster, X", 100,-1000.,1000.); - _hDistY = tfs->make("_hDistY","Distance from Track to Highest Energy Cluster, Y", 100,-1000.,1000.); - _htime = tfs->make("_htime","Time of Cluster - Time of Track at Calorimeter CoGZ",40, -20.,20.); - _hPhi0 = tfs->make("_hPhi0","Phi0",64, -3.2,3.2); - _hShortestDistance = tfs->make("_hShortestDistance","Shortest Distance Cluster",100,0.,500.); - _hShortestFirst = tfs->make("_hShortestFirst","Shortest Distance First Disk Cluster",100,0.,500.); - _hShortestDistanceClusterTime = tfs->make("_hShortestDistanceClusterTime","Shortest Distance Cluster Time - Track at Disk",50,-25.,25.); - _hClusterRadius = tfs->make("_hClusterRadius","Radius of Clusters", 100,0.,1000.); - _hEnergyAtLargeRadius = tfs->make("_hEnergyAtLargeRadius","Cluster Energy at Large Radius (get rid of DIO and track)",60,0.,300.); - _hTotalEnergyAtLargeRadius = tfs->make("_hTotalEnergyAtLargeRadius","Summed Energy at Large Radius (get rid of DIO and track)",60,0.,300.); - _hNumberAtLargeRadius = tfs->make("_hNumberAtLargeRadius","Number at Large Radius (get rid of DIO and track)",20,0.,20.); - _hPdgIdOfAllClustersAtLargeRadius = tfs->make("_hPdgIdOfAllClustersAtLargeRadius","PDGId of Clusters at Large Radius",5000,-2500.,2500.); - - _hEnergyAtSmallRadius = tfs->make("_hEnergyAtSmallRadius","Cluster Energy at Small Radius (get rid of DIO and track)",60,0.,300.); - _hTotalEnergyAtSmallRadius = tfs->make("_hTotalEnergyAtSmallRadius","Summed Energy at Small Radius (get rid of DIO and track)",60,0.,300.); - _hNumberAtSmallRadius = tfs->make("_hNumberAtSmallRadius","Number at Small Radius (get rid of DIO and track)",20,0.,20.); - _hPdgIdOfAllClustersAtSmallRadius = tfs->make("_hPdgIdOfAllClustersAtSmallRadius","PDGId of Clusters at Small Radius",5000,-2500.,2500.); - - _hCluConv = tfs->make("_hCluConv","CluConv", 10,-5.,5.); - _hEoverP1st = tfs->make("_hEoverP1st","E/p for shortest distance cluster disk 1", 150,0.,1.5); - _hEoverP2nd = tfs->make("_hEoverP2nd","E/p for shortest distance cluster disk 2", 150,0.,1.5); - _hEOverPZoom = tfs->make("_hEOverPZoom","E/p for shortest distance cluster", 50,0.8,1.3); - _hDistToTrack = tfs->make("_hDistToTrack","Distance of Cluster to Track at first disk",100,0.,1000.); - _hDistToTrackGoodCutC = tfs->make("_hDistToTrackGoodCutC","Good Cut C, Distance of Cluster to Track at first disk",100,0.,1000.); - - _hFracOnFrontFace = tfs->make("_hFracOnFrontFace","E/p for front face hits disk 1", 150,0.,1.5); - _hFracOnEdgeFace = tfs->make("_hFracOnEdgeFace","E/p for edge face hits disk 1", 150,0.,1.5); - _hFracOnEdgeFaceAndClusterInFront = tfs->make("_hFracOnEdgeFaceAndClusterInFront","E/p for edge face hits disk 1, cluster front", 150,0.,1.5); - _hFracOnEdgeFaceAndClusterInBack = tfs->make("_hFracOnEdgeFaceAndClusterInBack", "E/p for edge face hits disk 1, cluster back", 150,0.,1.5); - - _hNumberOfHits = tfs->make("_hNumberOfHits","Total Number of Hits",100,0.,5000.); - _hNumberOfHitsAfter650Nsec = tfs->make("_hNumberOfHitsAfter650Nsec","Total Number of Hits After 650 nsec",100,0.,5000.); - _hTimeDiffBest1st = tfs->make("_hTimeDiffBest1st","time diff to t0, 1st disk",20, -20.,20.); - _hTimeDiffBest2nd = tfs->make("_hTimeDiffBest2nd","time diff to t0, 2nd disk",20, -20.,20.); - - _hNHitsInTime = tfs->make("_hNHitsInTime","number of hits in time", 1000,0.,1000.); - _hZOfHit = tfs->make("_hZOfHit","Z of intime hit", 150,-1500,1500.); - _hEnergyDeposit = tfs->make("_hEnergyDeposit","Enegy Deposit of Hits",500, 0.,.025); - _hEnergyDepositFront = tfs->make("_hEnergyDepositFront","Energy Deposit of Hits, Front 10",500, 0.,.025); - _hNumberOfDeltas = tfs->make("_hNumberOfDeltas","Number of Deltas in Time",1000,0.,1000.); - _hTimeOfDeltaWrtT0 = tfs->make("_hTimeOfDeltaWrtT0","Time of Delta wrt T0",100,-50.,50.); - _hTimeOfDeltaWrtT0Zoom = tfs->make("_hTimeOfDeltaWrtT0Zoom","Time of Delta wrt T0 Zoom",100,0.,50.); - _hCloseDeltas = tfs->make("_hCloseDeltas","CloseInTime Deltas", 50,0.,1.); - _hCloseDeltasMean = tfs->make("_hCloseDeltasMean","CloseInTime Deltas Mean", 10,0.,50.); - _hCloseDeltasSigma = tfs->make("_hCloseDeltasSigma","CloseInTime Deltas Sigma", 50,0.,50.); - _hCloseDeltasAmplitude = tfs->make("_hCloseDeltasAmplitude","CloseInTime Deltas Amplitude", 100,0.,1000.); - _hMuonSampleMomentum = tfs->make("_hMuonSampleMomentum","Muons with Cut Set C , 8 Active, T>500 nsec",100,0.,200.); - _hMuonFracCutMomentum = tfs->make("_hMuonFracCutMomentum","Muons with Cut Set C , kFrac>0.7 and < 1 , 8 Active, T>500 nsec",100,0.,200.); - _hPionFracCutMomentum = tfs->make("_hPionFracCutMomentum","Muons with Cut Set C , kFrac<0.85, 8 Active, T>500 nsec",100,0.,200.); - _hWeirdFracCutMomentum = tfs->make("_hWeirdFracCutMomentum","Muons with Cut Set C , kFrac>0.85 to 0.9, 8 Active, T>500 nsec",100,0.,200.); - _hFracVsTime = tfs->make("_hFracVsTime"," E/p vs time diff", 50, -25.,25.,50,0.,1.25); - _hRadiusVsTime = tfs->make("_hRadiusVsTime"," track to cluster dist vs time diff", 50,0.,250.,50,-25.,25.); - _hFracVsRadius = tfs->make("_hFracVsRadius"," E/p vs track to cluster dist", 50,0.,250.,50,0.,1.25); - _hFracVsLocation = tfs->make("_hFracVsLocation"," E/p vs r2 for cluster", 50,0.,1000,50,0.,1.25); - _hMuonFracVsLocation = tfs->make("_hMuonFracVsLocation"," MuonFrac vs r2 for cluster", 50,0.,1000,50,0.75,1.25); - - _hFracVsP = tfs->make("_hFracVsP","E/p vs p",30,60.,120.,100,0.,1.); - _hMuonFrac = tfs->make("_hMuonFrac","ClusterEnergy/KE assuming Muon",100,0.5,1.5); - _hPionFrac = tfs->make("_hPionFrac","ClusterEnergy/KE assuming Pion, Muon Frac lt 0.85",100,0.5,1.5); - _hWeirdFracCluster = tfs->make("_hWeirdFracCluster","Cluster Energy for frac 0.85 to 0.9",100,0.,100.); - _hMuonFracCluster = tfs->make("_hMuonFracCluster","Cluster Energy for frac gt 0.85",100,0.,100.); - _hPionFracCluster = tfs->make("_hPionFracCluster","Cluster Energy for frac lt 0.85",100,0.,100.); - _hNumberOfCrystalsHighFrac = tfs->make("_hNumberOfCrystalsHighFrac","Number of Crystals, Frac 0.96 to 0.98",10,0.,10.); - _hNumberOfCrystalsLowFrac = tfs->make("_hNumberOfCrystalsLowFrac","Number of Crystals, Frac 0.86 to 0.88",10,0.,10.); - _hNumberOfCrystalsMedFrac = tfs->make("_hNumberOfCrystalsMedFrac","Number of Crystals, Frac gt 0.85 and < 0.9",10,0.,10.); - _hSingleCrystalFrac = tfs->make("_hSingleCrystalFrac","Frac for Clusters With Single Crystals",100,0.5,1.5); - _hDoubleCrystalFrac = tfs->make("_hDoubleCrystalFrac","Frac for Clusters With Two Crystals",100,0.5,1.5); - _hTripleCrystalFrac = tfs->make("_hTripleCrystalFrac","Frac for Clusters With Three Crystals",100,0.5,1.5); - _hCascade = tfs->make("_hCascade","Building up Track Cuts",10, 0.,10.); - _hZinter = tfs->make("_hZinter","Intersection Z",350,1400.,2800.); - _hChisqDisk1GoodZ = tfs->make("_hChisqDisk1GoodZ","Chisq for Hits on face of Front Disk",100,0.,100.); - _hZForBadDisk1 = tfs->make("_hZForBadDisk1","Z of Best Cluster For Disk1 on inside",350,1400.,2800.); - _hDisk1GoodRadius = tfs->make("_hDisk1GoodRadius","Radius for Hits on face of Front Disk",100,0.,1000.); - //_hChisqDisk2GoodZ = tfs->make("_hChisqDisk2GoodZ",100,0.,100.); - _hChisqDisk1BadZ = tfs->make("_hChisqDisk1BadZ","Chisq for hits on inside of Front Disk",100,0.,100.); - _hDisk1BadRadius = tfs->make("_hDisk1BadRadius","Radius for Hits on inside of Front Disk",100,0.,1000.); - - _hAngGood = tfs->make("_hAngGood", "Angle wrt z at Front Face",20,0.,90.); - _hAngBad = tfs->make("_hAngBad", "Angle wrt z at Inside Face",20,0.,90.); - //_hChisqDisk2BadZ = tfs->make("_hChisqDisk2BadZ",100,0.,100.); - // TF1* func = new TF1("timeFit",timeFit,0.,50.,3); - - _hErrVsMomHiFrac = tfs->make("_hErrVsMomHiFrac","Err vs Momentum HiFrac Profile",300,0.,300.); - _hErrVsD0HiFrac = tfs->make("_hErrVsD0HiFrac","Err vs D0 HiFrac Profile",300,-100,500.); - _hErrVsOmegaHiFrac = tfs->make("_hErrVsOmegaHiFrac","Err vs Omega HiFrac Profile",100,0.,.01); - _hErrVsTanDipHiFrac = tfs->make("_hErrVsTanDipHiFrac","Err vs TanDip HiFrac Profile",300,0.,3.); - _hTanDipVsMomentumHiFrac = tfs->make("_hTanDipVsMomentumHiFrac","Tan Dip vs Momentum HiFrac",300,0.,300.,100,0.,3.); - - _hErrVsMomLoFrac = tfs->make("_hErrVsMomLoFrac","Err vs Momentum LoFrac Profile",300,0.,300.); - _hErrVsD0LoFrac = tfs->make("_hErrVsD0LoFrac","Err vs D0 LoFrac Profile",300,-100,500.); - _hErrVsOmegaLoFrac = tfs->make("_hErrVsOmegaLoFrac","Err vs Omega LoFrac Profile",100,0.,.01); - _hErrVsTanDipLoFrac = tfs->make("_hErrVsTanDipLoFrac","Err vs TanDip LoFrac Profile",300,0.,3.); - _hTanDipVsMomentumLoFrac = new TH2F("_hTanDipVsMomentumLoFrac","Tan Dip vs Momentum LoFrac",300,0.,300.,100,0.,3.); - - _hErrVsMomMuon = tfs->make("_hErrVsMomMuon","Err vs Momentum Muon Profile",300,0.,300.); - _hErrVsD0Muon = tfs->make("_hErrVsD0Muon","Err vs D0 Muon Profile",300,-100,500.); - _hErrVsOmegaMuon = tfs->make("_hErrVsOmegaMuon","Err vs Omega Muon Profile",100,0.,.01); - _hErrVsTanDipMuon = tfs->make("_hErrVsTanDipMuon","Err vs TanDip Muon Profile",300,0.,3.); - _hTanDipVsMomentumMuon = new TH2F("_hTanDipVsMomentumMuon","Tan Dip vs Momentum Muon",300,0.,300.,100,0.,3.); - - _hErrVsMomPion = tfs->make("_hErrVsMomPion","Err vs Momentum Pion Profile",300,0.,300.); - _hErrVsD0Pion = tfs->make("_hErrVsD0Pion","Err vs D0 Pion Profile",300,-100,500.); - _hErrVsOmegaPion = tfs->make("_hErrVsOmegaPion","Err vs Omega Pion Profile",100,0.,.01); - _hErrVsTanDipPion = tfs->make("_hErrVsTanDipPion","Err vs TanDip Pion Profile",300,0.,3.); - _hTanDipVsMomentumPion = tfs->make("_hTanDipVsMomentumPion","Tan Dip vs Momentum Pion",300,0.,300.,100,0.,3.); - - //set up some constants - - } - - void KineticFracAnalysis::endJob(){ - - } - - void KineticFracAnalysis::analyze(const art::Event& event) { - - ++_nProcess; - if (_nProcess%10==0 && _diagLevel > 0) std::cout<<"Processing event from KineticFracAnalysis = "<<_nProcess << " with instance name " << _instanceName < 0){std::cout << "******************new event in KineticFracAnalysis*******************" << std::endl;} - - //Get handle to the calorimeter - art::ServiceHandle geom; - if( ! geom->hasElement() ) return; - Calorimeter const & cal = *(GeomHandle()); - - _firstDiskZ = cal.geomUtil().mu2eToTracker(cal.disk(0).geomInfo().frontFaceCenter()).z(); - _secondDiskZ = cal.geomUtil().mu2eToTracker(cal.disk(1).geomInfo().frontFaceCenter()).z(); - - if (_diagLevel > 2){ std::cout << "checking disk locations " << _firstDiskZ << " " << _secondDiskZ << std::endl;} - - //Get handle to the tracker - if( ! geom->hasElement() ) return; - - art::Handle trkCaloMatchHandle; - event.getByLabel(_trkCaloMatchModuleLabel, trkCaloMatchHandle); - TrkCaloMatchCollection const& trkCaloMatches(*trkCaloMatchHandle); - - art::Handle trjIntersectHandle; - event.getByLabel(_trkIntersectModuleLabel, trjIntersectHandle); - TrkCaloIntersectCollection const& trkIntersect(*trjIntersectHandle); - - //Get generated particles - art::Handle gensHandle; - event.getByLabel(_generatorModuleLabel, gensHandle); - //GenParticleCollection const& genParticles(*gensHandle); - - //Calorimeter crystal hits (average from readouts) - art::Handle CaloHitsHandle; - event.getByLabel(_caloCrystalModuleLabel, CaloHitsHandle); - CaloHitCollection const& CaloHits(*CaloHitsHandle); - - //Calorimeter clusters - art::Handle caloClustersHandle; - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - CaloClusterCollection const& caloClusters(*caloClustersHandle); - - //Calo digi truth assignment - art::Handle caloDigiTruthHandle; - event.getByLabel(_caloDigiTruthModuleLabel, caloDigiTruthHandle); - const CaloHitMCTruthAssn& caloDigiTruth(*caloDigiTruthHandle); - - //Calo cluster truth assignment - art::Handle caloClusterTruthHandle; - event.getByLabel(_caloClusterTruthModuleLabel, caloClusterTruthHandle); - const CaloClusterMCTruthAssn& caloClusterTruth(*caloClusterTruthHandle); - - //Get virtual detector hits - art::Handle vdhits; - event.getByLabel(_g4ModuleLabel,_virtualDetectorLabel,vdhits); - - //Get tracks - art::Handle krepsHandle; - event.getByLabel(_trkPatRecModuleLabel,_instanceName,krepsHandle); - KalRepCollection const& kreps = *krepsHandle; - - // - // handle to PDG - // GlobalConstantsHandle pdt; - //ParticleDataList const & pdt_ = *pdt; - - - // const double CrDensity = 4.9*(CLHEP::g/CLHEP::cm3); - //const double CrMass = CrDensity*cal.caloInfo().crystalVolume(); - - double numberOfTracks = 0; - double numberOfClusters = 0; - - //-------------------------- Do generated particles -------------------------------- - - _evt = event.id().event(); - _run = event.run(); - - if (_diagLevel > 2){std::cout << "processing event in Kinetic_Frac " << _nProcess << " run and event = " << _run << " " << _evt << " with instance name = " << _instanceName << std::endl;} - - //-------------------------- Do calorimeter hits -------------------------------- - - _nHits = _nSim = 0; - _cryEtot = 0.0; - - for (unsigned int ic=0; icfirst.get() == &hit) break; ++itMC;} - unsigned nCrySims = (itMC != caloDigiTruth.end()) ? itMC->second->nParticles() : 0; - - _cryEtot += hit.energyDep(); - _cryTime[_nHits] = hit.time(); - _cryEdep[_nHits] = hit.energyDep(); - _cryPosX[_nHits] = crystalPos.x(); - _cryPosY[_nHits] = crystalPos.y(); - _cryPosZ[_nHits] = crystalPos.z(); - _cryId[_nHits] = hit.crystalID(); - _crySectionId[_nHits] = diskId; - - _crySimIdx[_nCluster] = _nCluSim; - _crySimLen[_nCluster] = nCrySims; - - for (unsigned i=0;i< nCrySims;++i) - { - - const auto& eDepMC = itMC->second->energyDeposit(i); - - _motId[_nSim] = eDepMC.sim()->id().asInt(); - _motPdgId[_nSim] = eDepMC.sim()->pdgId(); - _motmom[_nSim] = eDepMC.momentumIn(); - _motcrCode[_nSim] = eDepMC.sim()->creationCode(); - _motTime[_nSim] = eDepMC.time(); - _motEdep[_nSim] = eDepMC.energyDep(); - ++_nSim; - } - ++_nHits; - } - - //-------------------------- Do clusters -------------------------------- - - _nCluster = _nCluSim = 0; - _cluList.clear(); - for (unsigned int ic=0; ic cryList; - for (auto cryPtr : cluster.caloHitsPtrVector()) cryList.push_back(int(cryPtr.get()- &CaloHits.at(0))); - - auto itMC = caloClusterTruth.begin(); - while (itMC != caloClusterTruth.end()) {if (itMC->first.get() == &cluster) break; ++itMC;} - const auto eDepMCs = (itMC != caloClusterTruth.end()) ? itMC->second->energyDeposits() : std::vector{}; - - bool isConversion(false); - if (itMC != caloClusterTruth.end()) - { - for (auto& edep : eDepMCs) - { - auto parent(edep.sim()); - while (parent->hasParent()) parent = parent->parent(); - if (parent->genParticle() && parent->genParticle()->generatorId().isConversion() ) isConversion=true; - } - } - - - _cluEnergy[_nCluster] = cluster.energyDep(); - _cluTime[_nCluster] = cluster.time(); - _cluNcrys[_nCluster] = cluster.size(); - _cluCogX[_nCluster] = cluster.cog3Vector().x(); //in disk FF frame - _cluCogY[_nCluster] = cluster.cog3Vector().y(); - _cluCogZ[_nCluster] = cluster.cog3Vector().z(); - _cluConv[_nCluster] = isConversion; - _cluList.push_back(cryList); - - _cluSimIdx[_nCluster] = _nCluSim; - _cluSimLen[_nCluster] = eDepMCs.size(); - - for (unsigned i=0;i< eDepMCs.size();++i) - { - const auto& eDepMC = eDepMCs[i]; - art::Ptr sim = eDepMC.sim(); - - art::Ptr smother(sim); - while (smother->hasParent()) smother = smother->parent(); - int genIdx=-1; - if (smother->genParticle()) genIdx = smother->genParticle()->generatorId().id(); - - _clusimId[_nCluSim] = sim->id().asInt(); - _clusimPdgId[_nCluSim] = sim->pdgId(); - _clusimGenIdx[_nCluSim] = genIdx; - _clusimTime[_nCluSim] = eDepMC.time(); - _clusimEdep[_nCluSim] = eDepMC.energyDep(); - _clusimMom[_nCluSim] = eDepMC.momentumIn(); - ++_nCluSim; - } - ++_nCluster; - } - - numberOfClusters = _nCluster; - - // - // for matching tracks to clusters - int _numberOfTracks = kreps.size(); - std::vector bestChi2(_numberOfTracks,-1.); - std::vector bestChi2Pos(_numberOfTracks,-1.); - std::vector bestChi2Time(_numberOfTracks,-1.); - std::vector bestCluster(_numberOfTracks,-1); - std::vector bestMatch(_numberOfTracks,-1); - - for (int ithTrack = 0; ithTrack < _numberOfTracks; ++ithTrack) - { - double minChi2 = -1.; int minMatch = -1; int minCluster = -1; double minChi2Pos = -1.; double minChi2Time = -1.; - int _nMatch(0); - for (auto const& trkCaloMatch: trkCaloMatches) - { - // - // match this track only - if (trkCaloMatch.trkId() == ithTrack) - { - _mTrkId[_nMatch] = trkCaloMatch.trkId(); - _mCluId[_nMatch] = trkCaloMatch.cluId(); - _mChi2[_nMatch] = trkCaloMatch.chi2(); - _mChi2Pos[_nMatch] = trkCaloMatch.chi2Pos(); - _mChi2Time[_nMatch] = trkCaloMatch.chi2Time(); - if (trkCaloMatch.chi2() < minChi2 || minChi2 == -1) - { - minCluster = trkCaloMatch.cluId(); - minChi2 = trkCaloMatch.chi2(); - minChi2Pos = trkCaloMatch.chi2Pos(); - minChi2Time = trkCaloMatch.chi2Time(); - minMatch = _nMatch; - } - if (_diagLevel > 3) - {std::cout << "nmatch, track ID, cluster ID, chi2, cluster time " << _nMatch << " " << _mTrkId[_nMatch] << " " - << _mCluId[_nMatch] << " " << _mChi2[_nMatch] << " " << _cluTime[_mCluId[_nMatch]] << std::endl; - } - ++_nMatch; - } - } - bestChi2[ithTrack] = minChi2; - bestChi2Pos[ithTrack] = minChi2Pos; - bestChi2Time[ithTrack] = minChi2Time; - bestCluster[ithTrack] = minCluster; - bestMatch[ithTrack] = minMatch; - if (_diagLevel > 2) - {std::cout << "for track " << ithTrack << " nmatch, track ID, cluster ID, chi2, cluster time " << minMatch << " " << _mTrkId[minMatch] << " " - << _mCluId[minMatch] << " " << _mChi2[minMatch] << " " << _cluTime[_mCluId[minMatch]] << std::endl; - } - if (_diagLevel > 2){std::cout << "number of clusters = " << numberOfClusters << " number of matches = " << _nMatch << std::endl;} - - // - // there is (2/23/2016) a code infelicity in TrackCaloMatchingBis. If the track hits the first disk, the intersection module - // still propagates the track to the second disk. In that case the matching module matches - // clusters to each intersection, and you get the same matches twice: _nCluster for the first disk, then the cluster list repeated - // for the second disk. Vice-versa for upstream tracks. In either case, take the first set and just use that. The algorithm will be upgraded. - // perhaps then there can be more than two intersections (one per disk) per track but the throw will warn we need a code upgrade. - // - // and then sometimes you find more than one track (as of this writing the tracks are found in order of time, but that can't be assumed) - // - // hence I put in: - if (_diagLevel > 2) - { - std::cout << " _nMatch = " << _nMatch << std::endl; - std::cout << " _nCluster = " << _nCluster << std::endl; - std::cout << " kreps.size() = " << kreps.size() << std::endl; - } - if (_nMatch > 2*_nCluster*static_cast(kreps.size()) ) - { throw cet::exception("RANGE") << " _nMatch and _nCluster mismatch, from KineticFracAnalysis. Call Bob ...nmatch and ncluster are " << _nMatch << " " << _nCluster << std::endl;} - - } - - _nTrk=0; - - - if (_diagLevel > 3) - { - std::cout << "number of tracks = "<< kreps.size() << std::endl; - std::cout << "size of intersection collection = " << trkIntersect.size() << std::endl; - } - if (trkIntersect.size() == 0 ) return; // code purists look the other way - if (trkIntersect.size() > 2*kreps.size()) // can't have more than two intersections per track - { - throw cet::exception("RANGE") << " more than two intersections for track and calorimeter, from KineticFracAnalysis. Call Bob or Bertrand..." << std::endl; - } - - // - // we now have matches to each track. Have to line these up with TrackIntersectionCollection. Trivial if one track - // but some events (small to be sure) have multiple tracks. Therefore loop over TrackIntersectionCollections and see which track - // a given intersection goes with, then analyze that. - - int ithInt(0); - for (auto const& trackCaloIntersect: trkIntersect) - { - if (ithInt > 0) {break;} - ++ithInt; - int trackNumber = trackCaloIntersect.trkId(); - KalRep const &trk = *(trackCaloIntersect.trk()); - double pathLength = trackCaloIntersect.pathLengthEntrance(); - HepPoint point = trk.position(pathLength); - std::cout << "path length = " << pathLength << std::endl; - double trkArrivalTime = trk.arrivalTime(pathLength); - if (_cluCogZ[bestCluster[trackNumber]] > 1800.) {break;} - double deltaTime = _cluTime[bestCluster[trackNumber]] - trkArrivalTime; - - // - // this is for comparing to clusters - - HelixTraj trkHel(trk.helix(pathLength).params(),trk.helix(pathLength).covariance()); - double trkTime = trk.arrivalTime(pathLength); - double tPhi = trkHel.phi0(); - double td0 = trkHel.d0(); - double tz0 = trkHel.z0(); - double tOmega = trkHel.omega(); - double tCosDip = trkHel.cosDip(); - double tProb = trk.chisqConsistency().significanceLevel(); - int tNhits = trk.nActive(); - int tStatus = trk.fitStatus().success(); - CLHEP::Hep3Vector trkMomentum = trk.momentum(pathLength); - HepVector momvec(3);//establshing dimension for next line - momvec = trkMomentum.unit(); - BbrVectorErr momCov = trk.momentumErr(0); - double fitMomErr = sqrt(momCov.covMatrix().similarity(momvec)); - - double tanDip = sqrt( 1. - tCosDip*tCosDip)/tCosDip; - - - double angleWrtZ = acos(trkMomentum.z()/trkMomentum.mag())*(180/M_PI); - - std::cout << "delta time = " << _cluTime[bestCluster[trackNumber]] << " " << trkArrivalTime << " " << deltaTime << std::endl; - // if (deltaTime > -4){break;} - if (_diagLevel > 2) - { - std::cout << "*****ith Int = " << ithInt << "**********" << std::endl; - std::cout << "trackID, pathLengthEntrance, point: " << trackNumber << " " << pathLength << " " << point << std::endl; - } - - // - // only plot these for the disk that goes with the best match cluster - - double bestZ = _cluCogZ[bestCluster[trackNumber]]; - - if (_diagLevel > 2){std::cout << " best Z is " << bestZ << " and point z = " << point.z() << std::endl;} - - _hZinter->Fill(point.z()); - double rad1 = sqrt(point.x()*point.x() + point.y()*point.y()); - - // - //just look at front disk - if (point.z() < 1800.) - { - // double rad2 = sqrt(pointFront.x()*pointBack.x() + pointFront.y()*pointBack.y()); - if (abs(point.z() - bestZ) < 1) { - if (_diagLevel > 2) - { - std::cout << "in good rad, chi2 = " << rad1 << " " << bestChi2[trackNumber] - << std::endl; - } - _hChisqDisk1GoodZ->Fill(bestChi2Time[trackNumber]); _hDisk1GoodRadius->Fill(rad1); - _hFracOnFrontFace->Fill(_cluEnergy[bestCluster[trackNumber]]/trk.momentum(pathLength).mag()); - _hAngGood->Fill(angleWrtZ); - } - if (abs(point.z() - bestZ) > 30) - { - if (_diagLevel > 2) - { - std::cout << "in bad rad, chi2 = " << rad1 << " " << bestChi2[trackNumber] << std::endl; - std::cout << "path lengths bad rad = " << trackCaloIntersect.pathLengthEntrance() << std::endl; - std::cout << "point bad rad = " << point << std::endl; - std::cout << " energy of best cluster match = " << _cluEnergy[bestCluster[trackNumber]] << " and momentum = " << trk.momentum(pathLength).mag() << std::endl; - } - _hAngBad->Fill(angleWrtZ); - _hChisqDisk1BadZ->Fill(bestChi2Time[trackNumber]); - _hDisk1BadRadius->Fill(rad1); - _hZForBadDisk1->Fill(_cluCogZ[bestCluster[trackNumber]]); - _hFracOnEdgeFace->Fill(_cluEnergy[bestCluster[trackNumber]]/trk.momentum(pathLength).mag()); - if (bestZ < 2000.){_hFracOnEdgeFaceAndClusterInFront->Fill(_cluEnergy[bestCluster[trackNumber]]/trk.momentum(pathLength).mag());} - if (bestZ > 2000.){_hFracOnEdgeFaceAndClusterInBack->Fill(_cluEnergy[bestCluster[trackNumber]]/trk.momentum(pathLength).mag()); - } - } - } - - if (_diagLevel > 2) - { - std::cout << "path lengths = " << trackCaloIntersect.pathLengthEntrance() << std::endl; - std::cout << "point = " << point << std::endl; - } - - // - // these are for cut set c comparisons; numbers aren't identical to Dave Brown's but are very close. Not worth going back into kreps - // - //after extendvalidrange is incorporated this fudge will be unnecessary. Right now Bertrand has cast away original krep constancy so who knows - //what we have. - HelixTraj trkHel0(trk.helix(0).params(),trk.helix(0).covariance()); - - - int tNHits0 = trk.nActive(); - double tPhi0 = trkHel0.phi0(); - double td00 = trkHel0.d0(); - double tz00 = trkHel0.z0(); - double tOmega0 = trkHel0.omega(); - double tCosDip0 = trkHel0.cosDip(); - int tStatus0 = trk.fitStatus().success(); - double tProb0 = trk.chisqConsistency().significanceLevel(); //is this right? - double trkTime0 = trk.arrivalTime(0); - CLHEP::Hep3Vector trkMomentum0 = trk.momentum(0); - HepVector momvec0(3); - momvec0 = trkMomentum0.unit(); - BbrVectorErr momCov0 = trk.momentumErr(0); - double fitMomErr0 = sqrt(momCov0.covMatrix().similarity(momvec0)); - - if (tCosDip0 == 0) - { throw cet::exception("RANGE") << " cosDip = 0 for track, which makes no sense, from KineticFracAnalysis...it's Bobs fault" << std::endl;} - - double tanDip0 = sqrt( 1. - tCosDip0*tCosDip0)/tCosDip0; - CLHEP::Hep3Vector momVec0 = trk.momentum(0); - - // Does this fit pass cut set C? - bool cutC = ( tStatus0 >0) - && ( tProb0 > 2.e-3 ) - && ( tNHits0 >= 20 ) - && ( fitMomErr0 < 0.25 ) - // && ( trkTime0 > 700 && trkTime0 < 1695) - ; - // if (! cutC) return; - // - // look at clusters to see if any match - - //double timeDiff = 1696; - _htime->Fill(_cluTime[bestCluster[trackNumber]] - trkTime); - if (_diagLevel > 2) {std::cout << " cluster - track time = " << _cluTime[bestCluster[trackNumber]] << " " << trkTime<< " " << _cluTime[bestCluster[trackNumber]] - trkTime << std::endl;} - - // - // what's the distance for this cluster? - - double _dist = sqrt(pow( _cluCogX[bestCluster[trackNumber]] - point.x() ,2) + pow(_cluCogY[bestCluster[trackNumber]] - point.y(),2) ); - _hDistToTrack->Fill(_dist); - if (! cutC){_hDistToTrackGoodCutC->Fill(_dist);} - - HepPoint point0 = trk.position(0); - - if (_diagLevel >2 ) - { - std::cout << "and the cluster match: best cluster = " << bestCluster[trackNumber] << " for track " << trackNumber << " \n" - "cluCogX = " << _cluCogX[bestCluster[trackNumber]] << " cluCogY = " << _cluCogY[bestCluster[trackNumber]] << " cluCogZ " << _cluCogZ[bestCluster[trackNumber]] << " \n" - " point is " << point << std::endl; - } - - if (_diagLevel > 2 && _dist > 350) - { - std::cout << " big distance comparisons: dist = " << _dist << "\n" - << " tStatus = " << tStatus << " " << tStatus0 << " \n" - << " tProb = " << tProb << " " << tProb0 << " \n" - << " nhits = " << tNhits << " " << tNHits0 << " \n" - << " track time = " << trkTime << " " << trkTime0 << " \n" - << " omega = " << tOmega << " " << tOmega0 << " \n" - << " phi = " << tPhi << " " << tPhi0 << " \n" - << " d0 = " << td0 << " " << td00 << " \n" - << " z0 = " << tz0 << " " << tz00 << " \n" - << " tandip = " << tanDip << " " << tanDip0 << " \n" - << " momentum = " << trkMomentum << " " << trkMomentum0 << " \n" - << " magnitude = " << trkMomentum.mag() << " " << trkMomentum0.mag() << "\n" - << " mom err = " << fitMomErr << " " << fitMomErr0 << "\n" - << " cut set C = " << cutC - << std::endl; - - } - } - - - - - - - //-------------------------- Do tracks -------------------------------- - _nTrkOk = 0; - _nTrk = 0; - - for ( KalRepCollection::const_iterator i=kreps.begin(); i != kreps.end(); ++i ){ - - KalRep const& krep = **i; - - // Arc length from center of tracker to the most upstream point on the fitted track. - - double s0 = krep.startValidRange(); // worst possible place to use, should start at tracker. Dave has upgraded code - //to extend track valid range all the way through calorimeter. If you want to get track at s0 at intersection, have - // to set valid range parameter in .fcl. DOn't know s0 though until we've gotten the intersection!! so - // probably setting this to 0 at center of tracker and then extrapolating from there is good enough. Use Bertrand's extrapolation - //since he does it all... - s0= 0.; - // Momentum and position at s0. - CLHEP::Hep3Vector p0 = krep.momentum(s0); - HepPoint pos0 = krep.position(s0); - - // Some other properties at s0. - double loclen(0.); - const TrkSimpTraj* ltraj = krep.localTrajectory(s0,loclen); - HepVector momvec(3); - momvec = p0.unit(); - BbrVectorErr momCov = krep.momentumErr(s0); - double fitMomErr = sqrt(momCov.covMatrix().similarity(momvec)); - double tanDip = ltraj->parameters()->parameter()[HelixTraj::tanDipIndex]; - double omega = ltraj->parameters()->parameter()[HelixTraj::omegaIndex]; - double d0 = ltraj->parameters()->parameter()[HelixTraj::d0Index]; - double z0 = ltraj->parameters()->parameter()[HelixTraj::z0Index]; - double trkPhi0 = ltraj->parameters()->parameter()[HelixTraj::phi0Index]; - double fitCon = krep.chisqConsistency().significanceLevel(); - double trkt0Err = krep.t0().t0Err(); - double fitmompt = p0.mag()*(1.0-p0.cosTheta()*p0.cosTheta()); - - // Does this fit pass cut set C? - bool cutC = ( krep.fitStatus().success() >0) - && ( fitCon > 2.e-3 ) - && ( krep.nActive() >= 20 ) - && ( fitMomErr < 0.25 ) - // ( krep.t0().t0() > 700 && krep.t0().t0() < 1695) - ; - - if (!cutC && _diagLevel>2) {std::cout << "failed cutset" << std::endl;} - - // cutC = true; - - _trkDip[_nTrk] = tanDip; - _trkOk[_nTrk] = cutC? 1 : 0; - _trkpt[_nTrk] = fitmompt; - _trkstat[_nTrk] = krep.fitStatus().success(); - _trkcon[_nTrk] = fitCon; - _trknHit[_nTrk] = krep.nActive(); - _trkmomErr[_nTrk] = fitMomErr ; - _trkt0[_nTrk] = krep.t0().t0(); - _trkMom[_nTrk] = p0.mag(); - _trkd0[_nTrk] = d0; - _trkz0[_nTrk] = z0; - _trkOmega[_nTrk] = omega; - _trkPhi0[_nTrk] = trkPhi0; - _trkt0Err[_nTrk] = trkt0Err; - ++_nTrk; - - if (_diagLevel > 4) - { - std:: cout << "KineticFracAnalysis _nTrk, t0 = " << _nTrk << " " << krep.t0().t0() << " and momentum " << p0.mag() << std::endl; - std:: cout << "KineticFracAnalysis fitstatus = " << krep.fitStatus().success() << std::endl; - } - - if (cutC) ++_nTrkOk; - } - numberOfTracks = _nTrk; - if (_diagLevel>3){std::cout << "ntracks = " << _nTrk << std::endl;} - //-------------------------- Do tracker hits -------------------------------- - - art::Handle strawhitsH; - if (event.getByLabel(_shLabel,strawhitsH)) { - _shcol = strawhitsH.product(); - } - else { - _shcol = 0; - printf(" >>> ERROR in KineticFracAnalysis::findData: StrawHitCollection with label=%s not found.\n", - _shLabel.data()); - } - - art::Handle shposH; - if (event.getByLabel(_shpLabel,shposH)) { - _shpcol = shposH.product(); - } - else { - _shpcol = 0; - printf(" >>> ERROR in KineticFracAnalysis::findData: StrawHitPositionCollection with label=%s not found.\n", - _shpLabel.data()); - } - - art::Handle shflagH; - if (event.getByLabel(_shfLabel,shflagH)) { - _shfcol = shflagH.product(); - } - else { - _shfcol = 0; - printf(" >>> ERROR in KineticFracAnalysis::findData: StrawHitFlagCollection with label=%s not found.\n", - _shfLabel.data()); - } - - art::Handle bkflagH; - if (event.getByLabel(_bkfLabel,bkflagH)) { - _bkfcol = bkflagH.product(); - } - else { - _bkfcol = 0; - printf(" >>> ERROR in KineticFracAnalysis::findData: StrawHitFlagCollection with label=%s not found.\n", - _bkfLabel.data()); - } - - _nTrackerHits = _shcol->size(); - _nGoodHits = 0; - _nDeltas = 0; - - // std::cout << "size of flag collection = " << _shfcol->size() << std::endl; - //std::cout << "_ntrackerHits = " << _nTrackerHits << std::endl; - - _goodKfrac = 0; - - if (numberOfTracks == 0){_goodKfrac =1;} - if (numberOfClusters == 0 && numberOfTracks > 0){_goodKfrac = 2;} - if (numberOfClusters > 0 && numberOfTracks == 0){_goodKfrac = 3;} - std::cout << "number of tracks = " << numberOfTracks << std::endl; - for (int ithtrk = 0; ithtrk < numberOfTracks; ++ithtrk) { - } - // _Ntup->Fill(); - } -}// end namespace mu2e -DEFINE_ART_MODULE(mu2e::KineticFracAnalysis) - diff --git a/Analyses/src/PbarAnalysis2_module.cc b/Analyses/src/PbarAnalysis2_module.cc deleted file mode 100644 index 7026247615..0000000000 --- a/Analyses/src/PbarAnalysis2_module.cc +++ /dev/null @@ -1,1080 +0,0 @@ -// -// An EDAnalyzer module that reads back the hits created by the calorimeter and produces an ntuple -// -// Original author Bertrand Echenard -// - -#include "CLHEP/Units/SystemOfUnits.h" - -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" -#include "Offline/GlobalConstantsService/inc/unknownPDGIdName.hh" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" - -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - - -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/GenId.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/CaloMCTruthAssns.hh" - -#include "Offline/RecoDataProducts/inc/TrkCaloMatch.hh" -// data -#include "Offline/CaloCluster/inc/ClusterUtils.hh" -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" - -#include "Offline/DataProducts/inc/PDGCode.hh" - -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Principal/Selector.h" -#include "art/Framework/Principal/Provenance.h" -#include "cetlib_except/exception.h" -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -#include "canvas/Utilities/InputTag.h" - - -#include "TDirectory.h" -#include "TNtuple.h" -#include "TTree.h" -#include "TH2F.h" -#include "TH1F.h" - -#include -#include -#include -#include -#include - - - -namespace mu2e { - - - class PbarAnalysis2 : public art::EDAnalyzer { - - public: - - typedef art::Ptr StepPtr; - typedef std::vector StepPtrs; - typedef std::map HitMap; - - - - explicit PbarAnalysis2(fhicl::ParameterSet const& pset); - virtual ~PbarAnalysis2() { } - - virtual void beginJob(); - virtual void endJob(); - - // This is called for each event. - virtual void analyze(const art::Event& e); - - - - - - private: - - - int findBestCluster(TrackClusterMatchCollection const& trackClusterMatches, int trkId, double maxChi2); - int findBestTrack (TrackClusterMatchCollection const& trackClusterMatches, int cluId, double maxChi2); - float findBestChi2 (TrackClusterMatchCollection const& trackClusterMatches, int cluId, double maxChi2); - - - int _diagLevel; - bool _doGenerated; - int _nProcess; - - std::string _g4ModuleLabel; - std::string _psVacuumStepPoints; - std::string _generatorModuleLabel; - art::InputTag _simParticleTag; - std::string _simParticleModuleLabel; - // Name of the tracker StepPoint collection - std::string _trackerStepPoints; - std::string _trackerHitsModuleLabel; - std::string _trackerHitsInstanceLabel; - - std::string _shLabel; - std::string _shpLabel; - std::string _shfLabel; - std::string _bkfLabel; - - const StrawHitCollection* _shcol; - const StrawHitFlagCollection* _shfcol; - const StrawHitFlagCollection* _bkfcol; - StrawHitFlagCollection* _flags; - const StrawHitPositionCollection* _shpcol; - - std::string _caloCrystalModuleLabel; - std::string _caloClusterModuleLabel; - std::string _caloDigiTruthModuleLabel; - std::string _caloClusterTruthModuleLabel; - std::string _caloClusterAlgorithm; - std::string _caloClusterSeeding; - const std::string _producerName; - std::string _virtualDetectorLabel; - std::string _stepPointMCLabel; - std::string _trkFitterModuleLabel; - std::string _trackClusterMatchModuleLabel; - - double _maxChi2Match; - bool _writeVertexFile; - std::string _pbarVertexOutName; - std::ofstream _pbarVertexOut; - TTree* _Ntup; - - - TH1F *_hcryE,*_hcryT,*_hcryX,*_hcryY,*_hcryZ; - TH1F *_hcluE,*_hcluT,*_hcluX,*_hcluY,*_hcluZ,*_hcluE1Et,*_hcluE1E9,*_hcluE1E25; - - TH2F *_hxy; - - - int _evt,_run; - - int _nGen,_genPdgId[16384],_genCrCode[16384]; - float _genmomX[16384],_genmomY[16384],_genmomZ[16384],_genStartX[16384],_genStartY[16384],_genStartZ[16384],_genStartT[16384]; - - int _nHits,_cryId[163840],_crySectionId[163840],_crySimIdx[163840],_crySimLen[163840]; - float _cryEtot,_cryTime[163840],_cryEdep[163840],_cryPosX[163840],_cryPosY[163840],_cryPosZ[163840],_cryLeak[163840]; - - int _nSim,_motId[500000],_motPdgId[500000],_motcrCode[500000],_motGenIdx[500000]; - float _motmom[500000],_motStartX[500000],_motStartY[500000],_motStartZ[500000],_motStartT[500000]; - float _motTime[500000],_motEdep[16348],_motPosX[500000],_motPosY[500000],_motPosZ[500000]; - - int _nCluster,_nCluSim,_cluNcrys[16384]; - float _cluEnergy[16384],_cluTime[16384],_cluCogX[16384],_cluCogY[16384],_cluCogZ[16384],_cluE1[16384],_cluE9[16384],_cluE25[16384],_cluSecMom[16384]; - int _cluSplit[16384],_cluConv[16384],_cluSimIdx[16384],_cluSimLen[16384]; - std::vector > _cluList; - - int _clusimId[16384],_clusimPdgId[16384],_clusimGenId[16384],_clusimGenPdg[16384],_clusimCrCode[16384]; - float _clusimMom[16384],_clusimMom2[16384],_clusimPosX[16384],_clusimPosY[16384],_clusimPosZ[16384],_clusimStartX[16384], - _clusimStartY[16384],_clusimStartZ[16384],_clusimTime[16384],_clusimEdep[16384]; - - int _nVd,_vdId[16384],_vdPdgId[16384],_vdenIdx[16384]; - float _vdTime[16384],_vdPosX[16384],_vdPosY[16384],_vdPosZ[16384],_vdMom[16384],_vdMomX[16384],_vdMomY[16384],_vdMomZ[16384]; - - int _nTrk,_trkstat[8192],_trknHit[8192]; - float _trkDip[8192],_trkpt[8192],_trkcon[8192],_trkmomErr[8192]; - - float _trkt0[8192],_trkMom[8192], _trkd0[8192],_trkz0[8192],_trkOmega[8192],_trkPhi0[8192],_trkt0Err[8192]; //rhb added - - - float _hitTime[32768]; - float _hitEnergy[32768]; - float _hitZ[32768]; - int _hitIsDelta[32768]; - int _nTrackerHits; - int _nGoodHits; - int _nDeltas; - float _bestCluster[8192]; - float _bestChi2[8192]; - int _nTrackClusterMatches; - - float _xStart; - float _yStart; - float _zStart; - float _pxStart; - float _pyStart; - float _pzStart; - - float _pxIncomingProton; - float _pyIncomingProton; - float _pzIncomingProton; - - float _pxInitialAntiProton; - float _pyInitialAntiProton; - float _pzInitialAntiProton; - - float _endGlobalTime; - - - }; - - - PbarAnalysis2::PbarAnalysis2(fhicl::ParameterSet const& pset) : - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel",0)), - _doGenerated(pset.get("doGenerated",false)), - _nProcess(pset.get("nProcess",0)), - _g4ModuleLabel(pset.get("g4ModuleLabel")), - _psVacuumStepPoints(pset.get("psVacuumStepPoints","AntiProtonSteps")), - _generatorModuleLabel(pset.get("generatorModuleLabel")), - _simParticleTag(pset.get("simParticleTag")), - _simParticleModuleLabel(pset.get("simParticleModuleLabel")), - // _trackerHitsModuleLabel(pset.get("trackerHitsModuleLabel")), - //_trackerHitsInstanceLabel(pset.get("trackerHitsInstanceLabel")), - _shLabel(pset.get("StrawHitCollectionLabel","makeSH")), - _shpLabel(pset.get("StrawHitPositionCollectionLabel","MakeStereoHits")), - _shfLabel (pset.get("StrawHitFlagCollectionLabel" ,"FlagStrawHits" )), - _bkfLabel (pset.get("StrawHitFlagCollectionLabel" ,"FlagBkgHits" )), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel")), - _caloClusterModuleLabel(pset.get("caloClusterModuleLabel")), - _caloDigiTruthModuleLabel(pset.get("caloHitTruthModuleLabel")), - _caloClusterTruthModuleLabel(pset.get("caloClusterTruthModuleLabel")), - _virtualDetectorLabel(pset.get("virtualDetectorName")), - _stepPointMCLabel(pset.get("stepPointMCLabel")), - _trkFitterModuleLabel(pset.get("trkFitterModuleLabel")), - _trackClusterMatchModuleLabel(pset.get("trackClusterMatchModuleLabel")), - _maxChi2Match(pset.get("maxChi2Match")), - _writeVertexFile(pset.get("writeVertexFile")), - _pbarVertexOutName(pset.get("pbarVertexOut")), - _Ntup(0) - { - } - - void PbarAnalysis2::beginJob(){ - - art::ServiceHandle tfs; - if (_writeVertexFile){ - _pbarVertexOut.open(_pbarVertexOutName.c_str()); - } - _Ntup = tfs->make("PbarOut2", "PbarOut2"); - - - - _Ntup->Branch("evt", &_evt , "evt/I"); - _Ntup->Branch("run", &_run , "run/I"); - _Ntup->Branch("cryEtot", &_cryEtot , "cryEtot/F"); - - _Ntup->Branch("nGen", &_nGen , "nGen/I"); - _Ntup->Branch("genId", &_genPdgId, "genId[nGen]/I"); - _Ntup->Branch("genCrCode", &_genCrCode, "genCrCode[nGen]/I"); - _Ntup->Branch("genMomX", &_genmomX, "genMomX[nGen]/F"); - _Ntup->Branch("genMomY", &_genmomY, "genMomY[nGen]/F"); - _Ntup->Branch("genMomZ", &_genmomZ, "genMomZ[nGen]/F"); - _Ntup->Branch("genStartX", &_genStartX, "genStartX[nGen]/F"); - _Ntup->Branch("genStartY", &_genStartY, "genStartY[nGen]/F"); - _Ntup->Branch("genStartZ", &_genStartZ, "genStartZ[nGen]/F"); - _Ntup->Branch("genStartT", &_genStartT, "genStartT[nGen]/F"); - - _Ntup->Branch("nCry", &_nHits , "nCry/I"); - _Ntup->Branch("cryId", &_cryId , "cryId[nCry]/I"); - _Ntup->Branch("crySectionId", &_crySectionId, "crySectionId[nCry]/I"); - _Ntup->Branch("cryPosX", &_cryPosX , "cryPosX[nCry]/F"); - _Ntup->Branch("cryPosY", &_cryPosY , "cryPosY[nCry]/F"); - _Ntup->Branch("cryPosZ", &_cryPosZ , "cryPosZ[nCry]/F"); - _Ntup->Branch("cryEdep", &_cryEdep , "cryEdep[nCry]/F"); - _Ntup->Branch("cryTime", &_cryTime , "cryTime[nCry]/F"); - _Ntup->Branch("crySimIdx", &_crySimIdx , "crySimIdx[nCry]/I"); - _Ntup->Branch("crySimLen", &_crySimLen , "crySimLen[nCry]/I"); - - _Ntup->Branch("nSim", &_nSim , "nSim/I"); - _Ntup->Branch("simId", &_motId , "simId[nSim]/I"); - _Ntup->Branch("simPdgId", &_motPdgId , "simPdgId[nSim]/I"); - _Ntup->Branch("simCrCode", &_motcrCode , "simCrCode[nSim]/I"); - _Ntup->Branch("simMom", &_motmom , "simMom[nSim]/F"); - _Ntup->Branch("simStartX", &_motStartX , "simStartX[nSim]/F"); - _Ntup->Branch("simStartY", &_motStartY , "simStartY[nSim]/F"); - _Ntup->Branch("simStartZ", &_motStartZ , "simStartZ[nSim]/F"); - _Ntup->Branch("simStartT", &_motStartT , "simStartT[nSim]/F"); - _Ntup->Branch("simPosX", &_motPosX , "simPosX[nSim]/F"); - _Ntup->Branch("simPosY", &_motPosY , "simPosY[nSim]/F"); - _Ntup->Branch("simPosZ", &_motPosZ , "simPosZ[nSim]/F"); - _Ntup->Branch("simTime", &_motTime , "simTime[nSim]/F"); - _Ntup->Branch("simEdep", &_motEdep , "simEdep[nSim]/F"); - _Ntup->Branch("simGenIdx", &_motGenIdx , "simGenIdx[nSim]/I"); - - - _Ntup->Branch("nCluster", &_nCluster , "nCluster/I"); - _Ntup->Branch("cluEnergy", &_cluEnergy , "cluEnergy[nCluster]/F"); - _Ntup->Branch("cluTime", &_cluTime , "cluTime[nCluster]/F"); - _Ntup->Branch("cluCogX", &_cluCogX , "cluCogX[nCluster]/F"); - _Ntup->Branch("cluCogY", &_cluCogY , "cluCogY[nCluster]/F"); - _Ntup->Branch("cluCogZ", &_cluCogZ , "cluCogZ[nCluster]/F"); - _Ntup->Branch("cluNcrys", &_cluNcrys , "cluNcrys[nCluster]/I"); - _Ntup->Branch("cluE1", &_cluE1 , "cluE1[nCluster]/F"); - _Ntup->Branch("cluE9", &_cluE9 , "cluE9[nCluster]/F"); - _Ntup->Branch("cluE25", &_cluE25 , "cluE25[nCluster]/F"); - _Ntup->Branch("cluSecMom", &_cluSecMom , "cluSecMom[nCluster]/F"); - _Ntup->Branch("cluSplit", &_cluSplit , "cluSplit[nCluster]/I"); - _Ntup->Branch("cluConv", &_cluConv , "cluConv[nCluster]/I"); - _Ntup->Branch("cluSimIdx", &_cluSimIdx , "cluSimIdx[nCluster]/I"); - _Ntup->Branch("cluSimLen", &_cluSimLen , "cluSimLen[nCluster]/I"); - _Ntup->Branch("cluList", &_cluList); - - _Ntup->Branch("nCluSim", &_nCluSim , "nCluSim/I"); - _Ntup->Branch("clusimId", &_clusimId , "clusimId[nCluSim]/I"); - _Ntup->Branch("clusimPdgId", &_clusimPdgId , "clusimPdgId[nCluSim]/I"); - _Ntup->Branch("clusimGenId", &_clusimGenId , "clusimGenId[nCluSim]/I"); - _Ntup->Branch("clusimGenPdg", &_clusimGenPdg, "clusimGenPdg[nCluSim]/I"); - _Ntup->Branch("clusimCrCode", &_clusimCrCode ,"clusimCrCode[nCluSim]/I"); - _Ntup->Branch("clusimMom", &_clusimMom , "clusimMom[nCluSim]/F"); - _Ntup->Branch("clusimMom2", &_clusimMom2 , "clusimMom2[nCluSim]/F"); - _Ntup->Branch("clusimPosX", &_clusimPosX , "clusimPosX[nCluSim]/F"); - _Ntup->Branch("clusimPosY", &_clusimPosY , "clusimPosY[nCluSim]/F"); - _Ntup->Branch("clusimPosZ", &_clusimPosZ , "clusimPosZ[nCluSim]/F"); - _Ntup->Branch("clusimStartX", &_clusimStartX ,"clusimStartX[nCluSim]/F"); - _Ntup->Branch("clusimStartY", &_clusimStartY ,"clusimStartY[nCluSim]/F"); - _Ntup->Branch("clusimStartZ", &_clusimStartZ ,"clusimStartZ[nCluSim]/F"); - _Ntup->Branch("clusimTime", &_clusimTime , "clusimTime[nCluSim]/F"); - _Ntup->Branch("clusimEdep", &_clusimEdep , "clusimEdep[nCluSim]/F"); - - _Ntup->Branch("nVd", &_nVd , "nVd/I"); - _Ntup->Branch("vdId", &_vdId , "vdId[nVd]/I"); - _Ntup->Branch("vdPdgId", &_vdPdgId , "vdPdgId[nVd]/I"); - _Ntup->Branch("vdMom", &_vdMom , "vdMom[nVd]/F"); - _Ntup->Branch("vdMomX", &_vdMomX , "vdMomX[nVd]/F"); - _Ntup->Branch("vdMomY", &_vdMomY , "vdMomY[nVd]/F"); - _Ntup->Branch("vdMomZ", &_vdMomZ , "vdMomZ[nVd]/F"); - _Ntup->Branch("vdPosX", &_vdPosX , "vdPosX[nVd]/F"); - _Ntup->Branch("vdPosY", &_vdPosY , "vdPosY[nVd]/F"); - _Ntup->Branch("vdPosZ", &_vdPosZ , "vdPosZ[nVd]/F"); - _Ntup->Branch("vdTime", &_vdTime , "vdTime[nVd]/F"); - _Ntup->Branch("vdGenIdx", &_vdenIdx , "vdGenIdx[nVd]/I"); - - _Ntup->Branch("nTrk", &_nTrk , "nTrk/I"); - _Ntup->Branch("trkDip", &_trkDip , "trkDip[nTrk]/F"); - _Ntup->Branch("trkpt", &_trkpt , "trkpt[nTrk]/F"); - _Ntup->Branch("trkstat", &_trkstat , "trkstat[nTrk]/I"); - _Ntup->Branch("trkcon", &_trkcon , "trkcon[nTrk]/F"); - _Ntup->Branch("trknHit", &_trknHit , "trknHit[nTrk]/I"); - _Ntup->Branch("trkmomErr", &_trkmomErr , "trkmomErr[nTrk]/F"); - _Ntup->Branch("trkt0", &_trkt0 , "trkt0[nTrk]/F"); - _Ntup->Branch("trkt0Err", &_trkt0Err, "trkt0Err[nTrk]/F"); - - _Ntup->Branch("trkMom", &_trkMom , "trkMom[nTrk]/F"); - _Ntup->Branch("trkd0", &_trkd0 , "trkd0[nTrk]/F"); - _Ntup->Branch("trkz0", &_trkz0 , "trkz0[nTrk]/F"); - _Ntup->Branch("trkOmega", &_trkOmega , "trkOmega[nTrk]/F"); - _Ntup->Branch("trkPhi0", &_trkPhi0 , "trkPhi0[nTrk]/F"); - _Ntup->Branch("bestCluster", &_bestCluster , "bestCluster[nTrk]/I"); - _Ntup->Branch("bestChi2", &_bestChi2 , "bestChi2[nTrk]/F"); - - _Ntup->Branch("nTrackerHits", &_nTrackerHits, "nTrackerHits/I"); - _Ntup->Branch("nTrackClusterMatches", &_nTrackClusterMatches, "nTrackClusterMatches/I"); - _Ntup->Branch("nGoodHits", &_nGoodHits, "nGoodHits/I"); - _Ntup->Branch("nDeltas", &_nDeltas, "nDeltas/I"); - _Ntup->Branch("hitTime", &_hitTime, "hitTime[nGoodHits]/F"); - _Ntup->Branch("hitEnergy", &_hitEnergy, "hitEnergy[nGoodHits]/F"); - _Ntup->Branch("hitZ", &_hitZ, "hitZ[nGoodHits]/F"); - _Ntup->Branch("hitIsDelta", &_hitIsDelta, "hitIsDelta[nGoodHits]/I"); - - _Ntup->Branch("pxPbar", &_pxStart, "pxPbar/F"); - _Ntup->Branch("pyPbar", &_pyStart, "pyPbar/F"); - _Ntup->Branch("pzPbar", &_pzStart, "pzPbar/F"); - - _Ntup->Branch("xPbar", &_xStart, "xPbar/F"); - _Ntup->Branch("yPbar", &_yStart, "yPbar/F"); - _Ntup->Branch("zPbar", &_zStart, "zPbar/F"); - - _Ntup->Branch("pxIncomingProton", &_pxIncomingProton, "pxIncomingProton/F"); - _Ntup->Branch("pyIncomingProton", &_pyIncomingProton, "pyIncomingProton/F"); - _Ntup->Branch("pzIncomingProton", &_pzIncomingProton, "pzIncomingProton/F"); - - _Ntup->Branch("pxInitialAntiProton", &_pxInitialAntiProton, "pxInitialAntiProton/F"); - _Ntup->Branch("pyInitialAntiProton", &_pyInitialAntiProton, "pyInitialAntiProton/F"); - _Ntup->Branch("pzInitialAntiProton", &_pzInitialAntiProton, "pzInitialAntiProton/F"); - - - _hcryE = tfs->make("cryEdep", "Energy deposited / crystal", 100, 0., 50. ); - _hcryT = tfs->make("cryTime", "Time of crystal hit", 100, 0., 2000. ); - _hcryX = tfs->make("cryX", "X coord of crystal hit", 100, 300., 700. ); - _hcryY = tfs->make("cryY", "Y coord of crystal hit", 100, 300., 700. ); - _hcryZ = tfs->make("cryZ", "Z coord of crystal hit", 100,11000., 13000.); - _hcluE = tfs->make("cluEdep", "Energy deposited / clustal", 150, 0., 150. ); - _hcluT = tfs->make("cluTime", "Time of clustal hit", 100, 0., 2000. ); - _hcluX = tfs->make("cluX", "X coord of clustal hit", 100, 300., 700. ); - _hcluY = tfs->make("cluY", "Y coord of clustal hit", 100, 300., 700. ); - _hcluZ = tfs->make("cluZ", "Z coord of clustal hit", 100,11000., 13000.); - _hcluE1Et = tfs->make("cluE1Et", "E1/Etot", 100, 0., 1.1 ); - _hcluE1E9 = tfs->make("cluE1E9", "E1/E9", 100, 0., 1.1 ); - _hcluE1E25 = tfs->make("cluE1E25", "E1/E25", 100, 0., 1.1 ); - _hxy = tfs->make("cryxy", "cryxy", 350,-700,700,350,-700,700 ); - - } - - - - void PbarAnalysis2::endJob(){ - } - - - - - void PbarAnalysis2::analyze(const art::Event& event) { - - ++_nProcess; - if (_nProcess%10==0 && _diagLevel > 0) std::cout<<"Processing event from PbarAnalysis2 = "<<_nProcess <()->getNominalDRPeriod(); - - - //Handle to the calorimeter - art::ServiceHandle geom; - if( ! geom->hasElement() ) return; - Calorimeter const & cal = *(GeomHandle()); - - //Calorimeter crystal hits (average from readouts) - art::Handle CaloHitsHandle; - event.getByLabel(_caloCrystalModuleLabel, CaloHitsHandle); - CaloHitCollection const& CaloHits(*CaloHitsHandle); - - //Calorimeter clusters - art::Handle caloClustersHandle; - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - CaloClusterCollection const& caloClusters(*caloClustersHandle); - - //Virtual detector hits - art::Handle vdhits; - event.getByLabel(_g4ModuleLabel,_virtualDetectorLabel,vdhits); - - //Calo digi truth assignment - art::Handle caloDigiTruthHandle; - event.getByLabel(_caloDigiTruthModuleLabel, caloDigiTruthHandle); - const CaloHitMCTruthAssn& caloDigiTruth(*caloDigiTruthHandle); - - //Calo cluster truth assignment - art::Handle caloClusterTruthHandle; - event.getByLabel(_caloClusterTruthModuleLabel, caloClusterTruthHandle); - const CaloClusterMCTruthAssn& caloClusterTruth(*caloClusterTruthHandle); - - // Get tracks - art::Handle trksHandle; - event.getByLabel(_trkFitterModuleLabel,trksHandle); - KalRepPtrCollection const& trksPtrColl(*trksHandle); - - // Get track calorimeter matches - // art::Handle trkCaloMatchHandle; - //event.getByLabel(_trkCaloMatchModuleLabel, trkCaloMatchHandle); - //TrkCaloMatchCollection const& trkCaloMatches(*trkCaloMatchHandle); - art::Handle trackClusterMatchHandle; - event.getByLabel(_trackClusterMatchModuleLabel, trackClusterMatchHandle); - TrackClusterMatchCollection const& trackClusterMatches(*trackClusterMatchHandle); - - - std::map, const StepPointMC*> vdMap; - if (vdhits.isValid()) - { - for (auto iter=vdhits->begin(), ie=vdhits->end(); iter!=ie; ++iter) - { - const StepPointMC& hit = *iter; - if (hit.volumeId()VirtualDetectorId::EMC_Disk_1_EdgeOut) continue; - vdMap[hit.simParticle()] = &hit; - } - } - - art::Handle simParticleHandle; - event.getByLabel(_simParticleModuleLabel,simParticleHandle); - bool haveSimPart = simParticleHandle.isValid(); - SimParticleCollection const& simParticles(*simParticleHandle); - if (haveSimPart) haveSimPart = !(simParticles.empty()); - - if (_diagLevel > 1){ - std::cout << "haveSimPart = " << haveSimPart << std::endl; - } - if (_writeVertexFile){ - if (haveSimPart){ - for (auto iSim : simParticles){ - // mu2e::SimParticle& obj = iSim; - const auto& p = iSim.second; - // - // check this is the initial pbar and add what I need to the ntuple. - // very unfortunately implementation dependent: how many stages - // - // set these now, write them and initial proton momentum vector later - if (p.id().asInt() == 2000001 && p.pdgId() == PDGCode::anti_proton){ - // if (p.pdgId() == PDGCode::anti_proton){ - _xStart = p.startPosition().x(); - _yStart = p.startPosition().y(); - _zStart = p.startPosition().z(); - _pxStart = p.startMomentum().x(); - _pyStart = p.startMomentum().y(); - _pzStart = p.startMomentum().z(); - _endGlobalTime = p.endGlobalTime(); - } - - if (_diagLevel > 2 && p.id().asInt() == 1000001 && p.pdgId() == PDGCode::anti_proton){ - std::cout<<" id = "< 1000. ){ - _xStart = iGen.position().x(); - _yStart = iGen.position().y(); - _zStart = iGen.position().z(); - _pxStart = iGen.momentum().x(); - _pyStart = iGen.momentum().y(); - _pzStart = iGen.momentum().z(); - if (_diagLevel > 2){ - std::cout << "initial pbar pos at stopping target = " << _xStart << " " << _yStart << " " << _zStart << std::endl; - std::cout << "initial pbar mom at stopping target = " << _pxStart << " " << _pyStart << " " << _pzStart << std::endl; - } - } - if (iGen.pdgId() == PDGCode::anti_proton && iGen.position().z() < 1000.){ - initialAntiProtonFourMomentum = iGen.momentum(); - _pxInitialAntiProton = iGen.momentum().x(); - _pyInitialAntiProton = iGen.momentum().y(); - _pzInitialAntiProton = iGen.momentum().z(); - if (_diagLevel > 2){ - std::cout << "pos and momentum of initial pbar = " << iGen.momentum() - << " " << iGen.position() << std::endl; - - } - } - // - // the predecessor put the proton back into the event as a genParticle after reading from file - // - // protons are a delta fcn at t=0 now. Can spread these later in later stage job - // huh? how can this ever worked, pdgid was zero. also why is genid = 38? 4/13/2018 was checking pdgcode pdg code for proton?? - if (iGen.pdgId() == 0){ - initialProtonFourMomentum = iGen.momentum(); - _pxIncomingProton = iGen.momentum().x(); - _pyIncomingProton = iGen.momentum().y(); - _pzIncomingProton = iGen.momentum().z(); - if (_diagLevel > 2){ - std::cout << "initial beam proton momentum = " << _pxIncomingProton << " " << _pyIncomingProton << " " << _pzIncomingProton << std::endl; - } - } - - } - - if (_writeVertexFile){ - _pbarVertexOut << _xStart << " " - << _yStart << " " - << _zStart << " " - << _pxStart << " " - << _pyStart << " " - << _pzStart << " " - << _endGlobalTime << " " - << _pxInitialAntiProton << " " - << _pyInitialAntiProton << " " - << _pzInitialAntiProton << " " - << _pxIncomingProton << " " - << _pyIncomingProton << " " - << _pzIncomingProton << std::endl; - } - } - - - - - - //-------------------------- Do generated particles -------------------------------- - - - _evt = event.id().event(); - _run = event.run(); - - if (_diagLevel == 3){std::cout << "processing event in calo_example " << _nProcess << " run and event = " << _run << " " << _evt << std::endl;} - - - - if (_doGenerated) - { - //Get generated particles - art::Handle gensHandle; - event.getByLabel(_generatorModuleLabel, gensHandle); - GenParticleCollection const& genParticles(*gensHandle); - - _nGen = genParticles.size(); - - if (_diagLevel > 2){ - std::cout << "number of generated particles = " << _nGen << std::endl; - } - for (unsigned int i=0; i < genParticles.size(); ++i) - { - GenParticle const* gen = &genParticles[i]; - _genPdgId[i] = gen->pdgId(); - _genCrCode[i] = gen->generatorId().id(); - _genmomX[i] = gen->momentum().vect().x(); - _genmomY[i] = gen->momentum().vect().y(); - _genmomZ[i] = gen->momentum().vect().z(); - _genStartX[i] = gen->position().x(); - _genStartY[i] = gen->position().y(); - _genStartZ[i] = gen->position().z(); - _genStartT[i] = gen->time(); - if (_diagLevel > 2){ - std::cout << "pdgId = " << gen->pdgId() << " " - << "generator Id = " << gen->generatorId().id() << "\n " - << "momentum = " << gen->momentum() << "\n " - << "position = " << gen->position() << "\n " - << "time = " << gen->time() - << std::endl; - } - } - } else {_nGen=0;} - - - //-------------------------- Do calorimeter hits -------------------------------- - - _nHits = _nSim = 0; - _cryEtot = 0.0; - - for (unsigned int ic=0; icfirst.get() == &hit) break; ++itMC;} - unsigned nCrySims = (itMC != caloDigiTruth.end()) ? itMC->second->nParticles() : 0; - - _cryEtot += hit.energyDep(); - _cryTime[_nHits] = hit.time(); - _cryEdep[_nHits] = hit.energyDep(); - _cryPosX[_nHits] = crystalPos.x(); - _cryPosY[_nHits] = crystalPos.y(); - _cryPosZ[_nHits] = crystalPos.z(); - _cryId[_nHits] = hit.crystalID(); - _crySectionId[_nHits] = diskId; - - _crySimIdx[_nHits] = _nSim; - _crySimLen[_nHits] = nCrySims; - - for (unsigned i=0;i< nCrySims;++i) - { - const auto& eDepMC = itMC->second->energyDeposit(i); - - auto parent(eDepMC.sim()); - while ( parent->hasParent()) parent = parent->parent(); - - _motId[_nSim] = eDepMC.sim()->id().asInt(); - _motPdgId[_nSim] = eDepMC.sim()->pdgId(); - _motmom[_nSim] = eDepMC.momentumIn(); - _motcrCode[_nSim] = eDepMC.sim()->creationCode(); - _motTime[_nSim] = eDepMC.time(); - _motEdep[_nSim] = eDepMC.energyDep(); - - _motStartX[_nSim] = parent->startPosition().x(); - _motStartY[_nSim] = parent->startPosition().y(); - _motStartZ[_nSim] = parent->startPosition().z(); - - ++_nSim; - } - - - _hcryE->Fill(hit.energyDep()); - _hcryT->Fill(hit.time()); - _hcryX->Fill(crystalPos.x()); - _hcryY->Fill(crystalPos.y()); - _hcryZ->Fill(crystalPos.z()); - _hxy->Fill(crystalPos.x(),crystalPos.y(),hit.energyDep()); - ++_nHits; - } - - - // do tracks, old school - //-------------------------- Do tracks -------------------------------- - - _nTrk = 0; - - // std::cout << "size of trks collection = " << trksPtrColl.size() << std::endl; - for ( size_t itrk=0; itrk< trksPtrColl.size(); ++itrk ) - { - KalRep const* krep = trksPtrColl.at(itrk).get(); - - // Arc length from center of tracker to the most upstream point on the fitted track. - double s0 = krep->startValidRange(); - - // Momentum and position at s0. - CLHEP::Hep3Vector p0 = krep->momentum(s0); - HepPoint pos0 = krep->position(s0); - - // Some other properties at s0. - double loclen(0.); - const TrkSimpTraj* ltraj = krep->localTrajectory(s0,loclen); - HepVector momvec(3); - momvec = p0.unit(); - BbrVectorErr momCov = krep->momentumErr(s0); - double fitMomErr = sqrt(momCov.covMatrix().similarity(momvec)); - double tanDip = ltraj->parameters()->parameter()[HelixTraj::tanDipIndex]; - double omega = ltraj->parameters()->parameter()[HelixTraj::omegaIndex]; - double d0 = ltraj->parameters()->parameter()[HelixTraj::d0Index]; - double z0 = ltraj->parameters()->parameter()[HelixTraj::z0Index]; - double trkPhi0 = ltraj->parameters()->parameter()[HelixTraj::phi0Index]; - double fitCon = krep->chisqConsistency().significanceLevel(); - double trkt0Err = krep->t0().t0Err(); - double fitmompt = p0.mag()*(1.0-p0.cosTheta()*p0.cosTheta()); - - _trkDip[_nTrk] = tanDip; - _trkpt[_nTrk] = fitmompt; - _trkstat[_nTrk] = krep->fitStatus().success(); - _trkcon[_nTrk] = fitCon; - _trknHit[_nTrk] = krep->nActive(); - _trkmomErr[_nTrk] = fitMomErr ; - _trkt0[_nTrk] = krep->t0().t0(); - _trkMom[_nTrk] = p0.mag(); - _trkd0[_nTrk] = d0; - _trkz0[_nTrk] = z0; - _trkOmega[_nTrk] = omega; - _trkPhi0[_nTrk] = trkPhi0; - _trkt0Err[_nTrk] = trkt0Err; - ++_nTrk; - - } - - - - - //-------------------------- Do tracks -------------------------------- - // we just want the cluster that matches the track. - // For information about the track at the entrance of the calorimeter, look at the - // Analysis/src/ReadTrackCaloMatching_module.cc mdoule - - //giani promises this index goes with the track index - - if (_diagLevel > 0) {std::cout << "size of match collection = " << trackClusterMatches.size() << std::endl;} - _nTrackClusterMatches = trackClusterMatches.size(); - for (unsigned int i=0;i< trackClusterMatches.size(); ++i) - { - //KalRepPtr const& tkrPtr = trksPtrColl.at(i); - _bestCluster[i] = findBestCluster(trackClusterMatches,i,_maxChi2Match); - _bestChi2 [i] = findBestChi2 (trackClusterMatches,i,_maxChi2Match); - } - - - - //-------------------------- Do clusters -------------------------------- - _nCluster = _nCluSim = 0; - _cluList.clear(); - for (unsigned int ic=0; ic cryList; - for (auto cryPtr : cluster.caloHitsPtrVector()) cryList.push_back(int(cryPtr.get()- &CaloHits.at(0))); - - //Find the caloDigiMC in the truth map - auto itMC = caloClusterTruth.begin(); - while (itMC != caloClusterTruth.end()) {if (itMC->first.get() == &cluster) break; ++itMC;} - const auto eDepMCs = (itMC != caloClusterTruth.end()) ? itMC->second->energyDeposits() : std::vector{}; - - bool isConversion(false); - if (itMC != caloClusterTruth.end()) - { - for (auto& edep : eDepMCs) - { - auto parent(edep.sim()); - while (parent->hasParent()) parent = parent->parent(); - if (parent->genParticle() && parent->genParticle()->generatorId().isConversion() ) isConversion=true; - } - } - ClusterUtils cluUtil(cal, cluster); - - _cluEnergy[_nCluster] = cluster.energyDep(); - _cluTime[_nCluster] = cluster.time(); - _cluNcrys[_nCluster] = cluster.size(); - _cluCogX[_nCluster] = cluster.cog3Vector().x(); //in disk FF frame - _cluCogY[_nCluster] = cluster.cog3Vector().y(); - - //FF as in CaloExample isn't really useful; replace with diskId - _cluCogZ[_nCluster] = cluster.diskID(); - _cluE1[_nCluster] = cluUtil.e1(); - _cluE9[_nCluster] = cluUtil.e9(); - _cluE25[_nCluster] = cluUtil.e25(); - _cluSecMom[_nCluster] = cluUtil.secondMoment(); - _cluSplit[_nCluster] = cluster.isSplit(); - _cluConv[_nCluster] = isConversion; - _cluList.push_back(cryList); - - _cluSimIdx[_nCluster] = _nCluSim; - _cluSimLen[_nCluster] = eDepMCs.size(); - - for (unsigned i=0;i< eDepMCs.size();++i) - { - const auto& eDepMC = eDepMCs[i]; - art::Ptr sim = eDepMC.sim(); - - art::Ptr smother(sim); - while (smother->hasParent() && !smother->genParticle() ) smother = smother->parent(); - int genId=-1; - if (smother->genParticle()) genId = smother->genParticle()->generatorId().id(); - int genPdg=-1; - if (smother->genParticle()) genPdg = smother->genParticle()->pdgId(); - - - double simMom(-1); - CLHEP::Hep3Vector simPos(0,0,0); - auto vdMapEntry = vdMap.find(sim); - if (vdMapEntry != vdMap.end()) - { - simMom = vdMapEntry->second->momentum().mag(); - CLHEP::Hep3Vector simPos = cal.geomUtil().mu2eToDiskFF(cluster.diskID(), vdMapEntry->second->position()); - } - - _clusimId[_nCluSim] = sim->id().asInt(); - _clusimPdgId[_nCluSim] = sim->pdgId(); - _clusimGenId[_nCluSim] = genId; - _clusimGenPdg[_nCluSim] = genPdg; - _clusimCrCode[_nCluSim] = sim->creationCode(); - _clusimTime[_nCluSim] = eDepMC.time(); - _clusimEdep[_nCluSim] = eDepMC.energyDep(); - _clusimMom[_nCluSim] = eDepMC.momentumIn(); - _clusimMom2[_nCluSim] = simMom; - _clusimPosX[_nCluSim] = simPos.x(); // in disk FF frame - _clusimPosY[_nCluSim] = simPos.y(); - _clusimPosZ[_nCluSim] = simPos.z(); - _clusimStartX[_nCluSim] = sim->startPosition().x(); // in disk FF frame - _clusimStartY[_nCluSim] = sim->startPosition().y(); - _clusimStartZ[_nCluSim] = sim->startPosition().z(); - - ++_nCluSim; - } - - _hcluE->Fill(cluster.energyDep()); - _hcluT->Fill(cluster.time()); - _hcluX->Fill(cluster.cog3Vector().x()); - _hcluY->Fill(cluster.cog3Vector().y()); - _hcluZ->Fill(cluster.cog3Vector().z()); - - - ++_nCluster; - } - - - - - //-------------------------- Do virtual detectors -------------------------------- - //73/74/77/78 front back inner outer edges disk 0 - //75/76/79/80 front back inner outer edges disk 1 - _nVd = 0; - if (vdhits.isValid()) - { - for (auto iter=vdhits->begin(), ie=vdhits->end(); iter!=ie; ++iter) - { - const StepPointMC& hit = *iter; - - if (hit.volumeId()VirtualDetectorId::EMC_Disk_1_EdgeOut) continue; - - double hitTime = fmod(hit.time(),_mbtime); - - CLHEP::Hep3Vector VDPos = cal.geomUtil().mu2eToTracker(hit.position()); - - _vdId[_nVd] = hit.volumeId(); - _vdPdgId[_nVd] = hit.simParticle()->pdgId(); - _vdTime[_nVd] = hitTime; - _vdPosX[_nVd] = VDPos.x(); //tracker frame - _vdPosY[_nVd] = VDPos.y(); - _vdPosZ[_nVd] = VDPos.z(); - _vdMomX[_nVd] = hit.momentum().x(); - _vdMomY[_nVd] = hit.momentum().y(); - _vdMomZ[_nVd] = hit.momentum().z(); - _vdenIdx[_nVd] = hit.simParticle()->generatorIndex(); - ++_nVd; - } - } - - - - //-------------------------- Do tracker hits -------------------------------- - - art::Handle strawhitsH; - if (event.getByLabel(_shLabel,strawhitsH)) { - _shcol = strawhitsH.product(); - } - else { - _shcol = 0; - printf(" >>> ERROR in CaloExample::findData: StrawHitCollection with label=%s not found.\n", - _shLabel.data()); - } - - art::Handle shposH; - if (event.getByLabel(_shpLabel,shposH)) { - _shpcol = shposH.product(); - } - else { - _shpcol = 0; - printf(" >>> ERROR in CaloExample::findData: StrawHitPositionCollection with label=%s not found.\n", - _shpLabel.data()); - } - - art::Handle shflagH; - if (event.getByLabel(_shfLabel,shflagH)) { - _shfcol = shflagH.product(); - } - else { - _shfcol = 0; - printf(" >>> ERROR in CaloExample::findData: StrawHitFlagCollection with label=%s not found.\n", - _shfLabel.data()); - } - - art::Handle bkflagH; - if (event.getByLabel(_bkfLabel,bkflagH)) { - _bkfcol = bkflagH.product(); - } - else { - _bkfcol = 0; - printf(" >>> ERROR in CaloExample::findData: StrawHitFlagCollection with label=%s not found.\n", - _bkfLabel.data()); - } - - - _nTrackerHits = _shcol->size(); - _nGoodHits = 0; - _nDeltas = 0; - - // std::cout << "size of flag collection = " << _shfcol->size() << std::endl; - //std::cout << "_ntrackerHits = " << _nTrackerHits << std::endl; - - - for (int ithHit =0; ithHit<_nTrackerHits; ++ithHit) - { - // std::cout << "inside hit loop " << _shcol->at(ithHit).time() << std::endl; - - if (_shcol->at(ithHit).time() > 650. && _nGoodHits< 32767) - { - _hitTime[_nGoodHits] = _shcol->at(ithHit).time(); - _hitEnergy[_nGoodHits] = _shcol->at(ithHit).energyDep(); - _hitZ[_nGoodHits] = _shpcol->at(ithHit).pos().z(); - // bool deltaRay = _bkfcol->at(ithHit).hasAllProperties(StrawHitFlag::delta); - // bool deltaRay = _shpcol->at(ithHit).flag().hasAllProperties(StrawHitFlag::delta); - // if (deltaRay){ - // _hitIsDelta[_nGoodHits] = 1; - // ++_nDeltas; - // } else{_hitIsDelta[_nGoodHits] = 0;} - //if (deltaRay){std::cout << "found a delta" << std::endl;} - //std::cout << "time, energy,z " << _shcol->at(ithHit).time() << " " << _shcol->at(ithHit).energyDep() << " " << - // _shpcol->at(ithHit).pos().z() - // << std::endl; - ++_nGoodHits; - } - } - - //std::cout << " number of good hits = " << _nGoodHits << std::endl; - - - - - _Ntup->Fill(); - } - - int PbarAnalysis2::findBestCluster(TrackClusterMatchCollection const& trackClusterMatches, int trkId, double maxChi2) - { - double chi2Best(maxChi2); - int cluBest(-1); - if (_diagLevel>0){std::cout << "\n \n " < 0) { - std::cout << " chi2Best, chi2, cluBest = " << chi2Best << " " << trkClusterMatch.chi2() << " " << cluBest << std::endl; - std::cout << " and the du,dv = " << trkClusterMatch.du() << " " << trkClusterMatch.dv() << std::endl; - } - chi2Best= trkClusterMatch.chi2(); - cluBest = trkClusterMatch.icl(); - } - } - if (_diagLevel>0){std::cout << "best chi2 = " << chi2Best <0){std::cout << "\n \n " < 0) { - std::cout << " chi2Best, chi2, cluBest = " << chi2Best << " " << trkClusterMatch.chi2() << " " << cluBest << std::endl; - std::cout << " and the du,dv = " << trkClusterMatch.du() << " " << trkClusterMatch.dv() << std::endl; - } - chi2Best= trkClusterMatch.chi2(); - cluBest = trkClusterMatch.icl(); - } - } - if (_diagLevel>0){std::cout << "best chi2 = " << chi2Best <(chi2Best); - } - - int PbarAnalysis2::findBestTrack(TrackClusterMatchCollection const& trackClusterMatches, int cluId, double maxChi2) - { - double chi2Best(maxChi2), trkBest(-1); - for (auto const& trkClusterMatch: trackClusterMatches) - { - if (trkClusterMatch.icl()==cluId && trkClusterMatch.chi2() < chi2Best) - { - chi2Best= trkClusterMatch.chi2(); - trkBest = trkClusterMatch.iex(); - } - } - return trkBest; - } - - -} - -DEFINE_ART_MODULE(mu2e::PbarAnalysis2) diff --git a/Analyses/src/PtrTest_module.cc b/Analyses/src/PtrTest_module.cc deleted file mode 100644 index b8a91bb0bf..0000000000 --- a/Analyses/src/PtrTest_module.cc +++ /dev/null @@ -1,93 +0,0 @@ -// -// Example of how to read a KalRepCollection and create a matching KalRepPtrCollection. -// This can be used as a model for writing a module that merges two KalRepCollections. -// -// -// Original author Rob Kutschke -// - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" -#include "canvas/Utilities/InputTag.h" - -// Need this for the BaBar headers. -using namespace CLHEP; - -// BaBar includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkParticle.hh" - -// mu2e tracking -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -// C++ includes. -#include -#include - -// This is fragile and needs to be last until CLHEP is -// properly qualified and included in the BaBar classes. -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -using namespace std; - -namespace mu2e { - - class PtrTest : public art::EDProducer { - public: - - explicit PtrTest(fhicl::ParameterSet const& pset); - void produce( art::Event& e) override; - - private: - - // Information about the data product that contains the fitted tracks. - // The instance name is also used as the instance name of the output data product. - TrkParticle _tpart; - TrkFitDirection _fdir; - std::string _instanceName; - art::InputTag _inputTag; - - }; - -} // end namespace mu2e - -mu2e::PtrTest::PtrTest(fhicl::ParameterSet const& pset): - EDProducer{pset}, - _tpart((TrkParticle::type)(pset.get("fitparticle"))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - _instanceName( _fdir.name() + _tpart.name()), - _inputTag( pset.get("inputModuleLabel"), _instanceName) -{ - produces(_instanceName); -} - -void mu2e::PtrTest::produce(art::Event& event) -{ - - // Access the input data product. - auto trksHandle = event.getValidHandle(_inputTag); - auto const& inputTracks = *trksHandle; - - // Create an empty output data product. - unique_ptr outputTracks(new KalRepPtrCollection ); - outputTracks->reserve(inputTracks.size()); - - // Populate the output data product. - for ( size_t i=0; iemplace_back(trksHandle,i); - } - - // Add the output data product to the event. - event.put(std::move(outputTracks),_instanceName); - -} - -DEFINE_ART_MODULE(mu2e::PtrTest) diff --git a/Analyses/src/ReadCaloDigi_module.cc b/Analyses/src/ReadCaloDigi_module.cc deleted file mode 100644 index 7a1e4d1530..0000000000 --- a/Analyses/src/ReadCaloDigi_module.cc +++ /dev/null @@ -1,869 +0,0 @@ -// -// An EDAnalyzer module that reads back the hits created by the Calorimeter Digitization chain -// -// Original author - -// ROOT includes -#include "TH1F.h" -#include "TF1.h" -#include "TSpline.h" -#include "TFile.h" -// #include "CalPatRec/inc/THackData.hh" -#include "TROOT.h" -#include "TFolder.h" -#include "TTree.h" -#include "TH2F.h" - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art_root_io/TFileDirectory.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -#include "art/Framework/Services/Optional/RandomNumberGenerator.h" -#include "art/Framework/Services/Registry/ServiceDefinitionMacros.h" - -// Mu2e includes. -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" -#include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" -#include "Offline/DataProducts/inc/CaloSiPMId.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/SeedService/inc/SeedService.hh" - -#include "Offline/RecoDataProducts/inc/CaloRecoDigi.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StatusG4.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/GenId.hh" -#include "Offline/MCDataProducts/inc/CaloHitMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" - -#include "Offline/DataProducts/inc/PDGCode.hh" - -#include "CLHEP/Random/RandPoisson.h" -#include "CLHEP/Random/RandGaussQ.h" - -#include -#include -#include -#include -#include -#include - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkRep.hh" - -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalHit.hh" - -//#include "TrkReco/inc/TrkStrawHit.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/HelixTraj.hh" - -using namespace std; - -using CLHEP::Hep3Vector; -using CLHEP::keV; - -namespace mu2e { - struct DAQ_t { - TH1F* _hNCaloDigi [10]; - TH1F* _hNSamplesPerDigi [10]; - TH1F* _hNSamplesPerEvent[10]; - - TH2F* _hNSamplesVsRadius[10]; - TH2F* _hNHitsVsRadius [10]; - }; - - class ReadCaloDigi : public art::EDAnalyzer { - - public: - - explicit ReadCaloDigi(fhicl::ParameterSet const& pset); - virtual ~ReadCaloDigi() { } - - virtual void beginRun(art::Run const& ) override; - - virtual void beginJob() override; - virtual void endJob() override ; - - // This is called for each event. - virtual void analyze(const art::Event& e) override; - - private: - - typedef std::vector< art::Handle > StepMCHandleVector; - typedef art::Ptr CaloHitPtr; - - void initVHits (); - - int _diagLevel; - - std::string _caloDigisModuleLabel; - std::string _caloCrystalModuleLabel; - std::string _stepPoints; - std::string _rostepPoints; - std::string _caloClusterModuleLabel; - std::string _vdStepPoints; - std::string _trackModuleLabel; - - std::string _instanceName; - TrkParticle _tpart; - TrkFitDirection _fdir; - - double _mbtime; - double _mbbuffer; - double _blindTime; - - int _fillWaveforms; - double _psdThreshold; - double _caloRmin; - - TTree* _Ntup; - DAQ_t _histDisk0; - DAQ_t _histDisk1; - TH2F* _hNSamplesVsCrysId[10]; - - int _nProcess; - - int _evt,_run,_caloCrystals,_caloDisk0Crystals,_caloDisk1Crystals,_nHits,_nCluster, _nCryRO; - - int _nRecoDigi, _recoDigiSamples[16384]; - float _recoDigiAmp[16384], _recoDigiEnergy[16384], _recoDigiTime[16384]; - - int _recoDigiId[16384]; - float _recoDigiT0[16384]; - float _recoDigiX[16384], _recoDigiY[16384], _recoDigiZ[16384]; - float _recoDigiPulse[10000][350]; - - int _cryId[16384],_crySectionId[16384]; - - int _cluNcrys[204828]; - - float _caloVolume, _crystalVolume; - - float _cryEtot,_cryTime[16384],_cryEdep[16384], _cryAmp[16384], _cryDose[16384]; - float _cryMCTime [16384]; - float _cryMCEdep [16384]; - int _cryNParticles[16384]; - float _cryPsd [16384]; - float _cryIsConv [16384]; - - float _cryPosX[16384],_cryPosY[16384],_cryPosZ[16384], _cryPosR[16384]; - - float _cluEnergy[2048], _cluCrysE[2048], _cluMeanTime[2048],_cluTime[2048], _cluMCTime[2048], _cluMCMeanTime[2048]; - float _cluCogX[2048],_cluCogY[2048],_cluCogZ[2048], _cluCogR[2048]; - - int _cluConv[2048]; - - Int_t _vNHits; - Float_t _vP[2048], _vPx[2048], _vPy[2048], _vPz[2048], _vPt[2048]; - Float_t _vE[2048], _vEKin[2048], _vM[2048]; - Float_t _vT[2048]; - Float_t _vX[2048], _vY[2048], _vZ[2048], _vR[2048]; - Float_t _vCosth[2048], _vRadius[2048]; - Int_t _vId[2048]; - Int_t _vPdgId[2048]; - - Int_t _nTrkGood; - - //some histograms for DAQ analyses purposes - - const Calorimeter* _calorimeter; // cached pointer to the calorimeter geometry - - }; - - void ReadCaloDigi::initVHits(){ - - _vNHits = 0; - - // _vP = 0.; - // _vPx = 0.; - // _vPy = 0.; - // _vPz = 0.; - // _vPt = 0.; - // _vPdgId = 0.; - // _vM = 0.; - // _vE = 0.; - // _vEKin = 0.; - // _vT = 0.; - // _vX = 0.; - // _vY = 0.; - // _vZ = 0.; - // _vR = 0.; - - // _vCosth = 0.; - // _vRadius = 0.; - // _vId = 0.; - } - - ReadCaloDigi::ReadCaloDigi(fhicl::ParameterSet const& pset) : - art::EDAnalyzer(pset), - _diagLevel (pset.get ("diagLevel")), - _caloDigisModuleLabel (pset.get("caloDigisModuleLabel")), - _caloCrystalModuleLabel (pset.get("caloCrystalModuleLabel")), - _stepPoints (pset.get("calorimeterStepPoints")), - _rostepPoints (pset.get("calorimeterROStepPoints")), - _caloClusterModuleLabel (pset.get("caloClusterModuleLabel")), - _vdStepPoints (pset.get("vdStepPoints")), - _trackModuleLabel (pset.get("trackModuleLabel")), - _tpart ((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _mbbuffer (pset.get ("TimeFoldingBuffer")), // ns - _blindTime (pset.get ("blindTime" )), // ns - _fillWaveforms (pset.get ("fillWaveforms" )), - _psdThreshold (pset.get("psdThreshold")), - _caloRmin (pset.get("caloRmin" )), - _Ntup(0),_nProcess(0) - { - _instanceName = _fdir.name() + _tpart.name(); - } - - void ReadCaloDigi::beginRun(art::Run const& ){ - mu2e::GeomHandle ch; - _calorimeter = ch.get(); - } - void ReadCaloDigi::beginJob(){ - - art::ServiceHandle tfs; - art::TFileDirectory tfdir = tfs->mkdir("diag"); - - for (int i=0; i<10; ++i){ - _histDisk0._hNCaloDigi [i] = tfdir.make(Form("hNHitsDisk0%i",i) , - Form("Disk0: N caloDigis @ %i MeV threshold",i+1), 1e4, 0, 1e4); - _histDisk0._hNSamplesPerDigi [i] = tfdir.make(Form("hNSampleHitsDisk0%i",i), - Form("Disk0: N of words per caloDigi @ %i MeV threshold",i+1), - 1e4, 0, 1e4); - _histDisk0._hNSamplesPerEvent [i] = tfdir.make(Form("hNSampleDisk0%i",i), - Form("Disk0: N of words per event @ %i MeV threshold",i+1), - 5e4, 0, 5e4); - _histDisk1._hNCaloDigi [i] = tfdir.make(Form("hNHitsDisk1%i",i) , - Form("Disk1: N caloDigis @ %i MeV threshold",i+1), 1e4, 0, 1e4); - _histDisk1._hNSamplesPerDigi [i] = tfdir.make(Form("hNSampleHitsDisk1%i",i), - Form("Disk1: N of words per caloDigi @ %i MeV threshold",i+1), - 1e4, 0, 1e4); - _histDisk1._hNSamplesPerEvent [i] = tfdir.make(Form("hNSampleDisk1%i",i), - Form("Disk1: N of words per event @ %i MeV threshold",i+1), - 5e4, 0, 5e4); - _hNSamplesVsCrysId [i] = tfdir.make(Form("hNSamplesVsCrysId%i",i), - Form("N of words per event vs crystal Id @ %i MeV threshold",i+1), - 2000, 0, 2e3, 600, 0, 600); - - _histDisk0._hNSamplesVsRadius [i] = tfdir.make(Form("hNSamplesVsRadiusDisk0%i",i), - "N of words per event vs radius on disk 0", - 80, 300, 700, 300, 0, 300); - _histDisk0._hNHitsVsRadius [i] = tfdir.make(Form("hNHitsVsRadiusDisk0%i",i), - "N of hits per event vs radius on disk 0", - 80, 300, 700, 2000, 0, 2000); - - _histDisk1._hNSamplesVsRadius [i] = tfdir.make(Form("hNSamplesVsRadiusDisk1%i", i), - "N of words per event vs radius on disk 0", - 80, 300, 700, 300, 0, 300); - _histDisk1._hNHitsVsRadius [i] = tfdir.make(Form("hNHitsVsRadiusDisk1%i", i), - "N of hits per event vs radius on disk 0", - 80, 300, 700, 2000, 0, 2000); - } - - _Ntup = tfs->make("Calo", "Calo"); - - _Ntup->Branch("evt", &_evt , "evt/I"); - _Ntup->Branch("run", &_run , "run/I"); - _Ntup->Branch("caloCrystals", &_caloCrystals ,"caloCrystals/I"); - _Ntup->Branch("caloDisk0Crystals", &_caloDisk0Crystals ,"caloDisk0Crystals/I"); - _Ntup->Branch("caloDisk1Crystals", &_caloDisk1Crystals ,"caloDisk1Crystals/I"); - - _Ntup->Branch("nRecoDigi", &_nRecoDigi , "nRecoDigi/I"); - _Ntup->Branch("recoDigiEnergy", &_recoDigiEnergy , "recoDigiEnergy[nRecoDigi]/F"); - _Ntup->Branch("recoDigiAmp", &_recoDigiAmp, "recoDigiAmp[nRecoDigi]/F"); - _Ntup->Branch("recoDigiTime" , &_recoDigiTime, "recoDigiTime[nRecoDigi]/F"); - _Ntup->Branch("recoDigiSamples", &_recoDigiSamples, "recoDigiSamples[nRecoDigi]/I"); - _Ntup->Branch("recoDigiId" , &_recoDigiId , "recoDigiId[nRecoDigi]/I"); - _Ntup->Branch("recoDigiT0" , &_recoDigiT0 , "recoDigiT0[nRecoDigi]/F"); - _Ntup->Branch("recoDigiX" , &_recoDigiX , "recoDigiX[nRecoDigi]/F"); - _Ntup->Branch("recoDigiY" , &_recoDigiY , "recoDigiY[nRecoDigi]/F"); - _Ntup->Branch("recoDigiZ" , &_recoDigiZ , "recoDigiZ[nRecoDigi]/F"); - _Ntup->Branch("recoDigiPulse" , &_recoDigiPulse , "recoDigiPulse[nRecoDigi][350]/F"); - - _Ntup->Branch("cryEtot", &_cryEtot , "cryEtot/F"); - - _Ntup->Branch("nCry", &_nHits , "nCry/I"); - _Ntup->Branch("cryId", &_cryId , "cryId[nCry]/I"); - _Ntup->Branch("crySectionId", &_crySectionId, "crySectionId[nCry]/I"); - _Ntup->Branch("cryPosX", &_cryPosX , "cryPosX[nCry]/F"); - _Ntup->Branch("cryPosY", &_cryPosY , "cryPosY[nCry]/F"); - _Ntup->Branch("cryPosZ", &_cryPosZ , "cryPosZ[nCry]/F"); - _Ntup->Branch("cryPosR", &_cryPosR , "cryPosR[nCry]/F"); - _Ntup->Branch("cryEdep", &_cryEdep , "cryEdep[nCry]/F"); - _Ntup->Branch("cryAmp", &_cryAmp , "cryAmp[nCry]/F"); - _Ntup->Branch("cryTime", &_cryTime , "cryTime[nCry]/F"); - _Ntup->Branch("cryMCTime", &_cryMCTime ,"cryMCTime[nCry]/F"); - _Ntup->Branch("cryMCEdep", &_cryMCEdep ,"cryMCEdep[nCry]/F"); - _Ntup->Branch("cryNParticles",&_cryNParticles,"cryNParticles[nCry]/I"); - _Ntup->Branch("cryPsd", &_cryPsd ,"cryPsd[nCry]/F"); - _Ntup->Branch("cryIsConv", &_cryIsConv ,"cryIsConv[nCry]/I"); - _Ntup->Branch("nCluster", &_nCluster , "nCluster/I"); - _Ntup->Branch("cluEnergy", &_cluEnergy , "cluEnergy[nCluster]/F"); - _Ntup->Branch("cluCrysE", &_cluCrysE , "cluCrysE[nCluster]/F"); - _Ntup->Branch("cluTime", &_cluTime , "cluTime[nCluster]/F"); - _Ntup->Branch("cluMeanTime", &_cluMeanTime , "cluMeanTime[nCluster]/F"); - _Ntup->Branch("cluMCTime", &_cluMCTime , "cluMCTime[nCluster]/F"); - _Ntup->Branch("cluMCMeanTime", &_cluMCMeanTime , "cluMCMeanTime[nCluster]/F"); - _Ntup->Branch("cluCogX", &_cluCogX , "cluCogX[nCluster]/F"); - _Ntup->Branch("cluCogY", &_cluCogY , "cluCogY[nCluster]/F"); - _Ntup->Branch("cluCogZ", &_cluCogZ , "cluCogZ[nCluster]/F"); - _Ntup->Branch("cluCogR", &_cluCogR , "cluCogR[nCluster]/F"); - _Ntup->Branch("cluNcrys", &_cluNcrys , "cluNCrys[nCluster]/I"); - _Ntup->Branch("cluConv", &_cluConv , "cluConv[nCluster]/I"); - - _Ntup->Branch("vNHits", &_vNHits , "vNHits/I"); - _Ntup->Branch("vId" , &_vId , "vId[vNHits]/I"); - _Ntup->Branch("vPdgId", &_vPdgId , "vPdgId[vNHits]/I"); - _Ntup->Branch("vP" , &_vP , "vP[vNHits]/F"); - _Ntup->Branch("vPx", &_vPx , "vPx[vNHits]/F"); - _Ntup->Branch("vPy", &_vPy , "vPy[vNHits]/F"); - _Ntup->Branch("vPz", &_vPz , "vPz[vNHits]/F"); - _Ntup->Branch("vE" , &_vE , "vE[vNHits]/F"); - _Ntup->Branch("vEKin", &_vEKin , "vEKin[vNHits]/F"); - _Ntup->Branch("vM", &_vM , "vM[vNHits]/F"); - _Ntup->Branch("vT", &_vT , "vT[vNHits]/F"); - _Ntup->Branch("vX", &_vX , "vX[vNHits]/F"); - _Ntup->Branch("vY", &_vY , "vY[vNHits]/F"); - _Ntup->Branch("vZ", &_vZ , "vZ[vNHits]/F"); - _Ntup->Branch("vR", &_vR , "vR[vNHits]/F"); - _Ntup->Branch("vCosth", &_vCosth , "vCosth[vNHits]/F"); - _Ntup->Branch("vRadius", &_vRadius, "vRadius[vNHits]/F"); - - _Ntup->Branch("nTrkGood",&_nTrkGood , "nTrkGood/I"); - - } - - void ReadCaloDigi::endJob(){ - } - - void ReadCaloDigi::analyze(const art::Event& event) { - // if (_nProcess == 0){ - mu2e::GeomHandle ch; - _calorimeter = ch.get(); - // } - - ++_nProcess; - - //load the timeoffset - _mbtime = GlobalConstantsHandle()->getNominalDRPeriod(); - - //data about hits in the calorimeter crystals - art::Handle caloDigiMCHandle; - event.getByLabel(_caloDigisModuleLabel, caloDigiMCHandle); - - const CaloHitMCCollection* caloDigiMCCol(0); - int nCaloHitMC(0); - if (caloDigiMCHandle.isValid()){ - caloDigiMCCol = caloDigiMCHandle.product(); - nCaloHitMC = caloDigiMCCol->size(); - } - - art::Handle recoCaloDigiHandle; - event.getByLabel(_caloDigisModuleLabel, recoCaloDigiHandle); - - const CaloRecoDigiCollection* recoCaloDigiCol(0); - int nCaloRecoDigi(0); - if (recoCaloDigiHandle.isValid()){ - recoCaloDigiCol = recoCaloDigiHandle.product(); - nCaloRecoDigi = recoCaloDigiCol->size(); - } - - int nCaloCrystals(0); - const CaloHitCollection* CaloHits(0); - art::Handle CaloHitsHandle; - event.getByLabel(_caloCrystalModuleLabel, CaloHitsHandle); - if (!CaloHitsHandle.isValid()){ - // printf("[ReadCaloDigi::analyze] no CaloHitCollection: BAILS OUT \n"); - nCaloCrystals = 0; - }else { - CaloHits = CaloHitsHandle.product(); - nCaloCrystals = CaloHits->size(); - } - - //data about clusters - art::Handle caloClustersHandle; - const CaloClusterCollection* caloClusters(0); - int nCaloClusters(0); - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - if (caloClustersHandle.isValid()){ - caloClusters = caloClustersHandle.product(); - nCaloClusters = caloClusters->size(); - } - - //Handle to VD steps - art::ProductInstanceNameSelector selector_vdhits("virtualdetector"); - art::Handle *vdStepsHandle; - const StepPointMCCollection *vdHits; - StepMCHandleVector vdStepsHandleVec = event.getMany(selector_vdhits); - - //Handle to tracks collection - art::Handle dem_handle; - // art::Selector s_dem(art::ProcessNameSelector("") && - // art::ModuleLabelSelector(_trackModuleLabel) ); - // art::Selector s_dem (art::ProductInstanceNameSelector("") && - // art::ProcessNameSelector("") && - // art::ModuleLabelSelector(_trackModuleLabel) ); - // fEvent->get(selector,krepsHandle); - event.getByLabel(_trackModuleLabel, _instanceName, dem_handle); - // event.get(s_dem,dem_handle); - - int nTraks(0); - const mu2e::KalRepCollection* list_of_ele_tracks = nullptr; - - if (dem_handle.isValid()) { - list_of_ele_tracks = dem_handle.product(); - nTraks = list_of_ele_tracks->size(); - } - - GlobalConstantsHandle pdt; - - _evt = event.id().event(); - _run = event.run(); - _caloCrystals = _calorimeter->nCrystals(); - _caloDisk0Crystals = _calorimeter->disk(0).nCrystals(); - _caloDisk1Crystals = _calorimeter->disk(1).nCrystals(); - _nTrkGood = 0; - - //-------------------------------------------------------------------------------- - if (nTraks>0){ - double fMinFitCons = 2.e-3; - double fMinNActive = 25; - double fMaxT0Err = 0.9; // in ns - double fMaxFitMomErr = 0.25; // in MeV - double fMinTanDip = tan(M_PI/6.); // 0.5773 - double fMaxTanDip = 1.0; - double fMinD1 = -80.; // in mm - double fMaxD1 = 105.; - double fTrkMomCut = 100.; //MeV/c - - KalRep *trk; - - trk = (KalRep*) &list_of_ele_tracks->at(0); - CLHEP::Hep3Vector mom = trk->momentum(0); - - BbrVectorErr momerr = trk->momentumErr(0); - - CLHEP::Hep3Vector momdir = trk->momentum(0).unit(); - CLHEP::HepVector momvec(3); - for (int i=0; i<3; i++) momvec[i] = momdir[i]; - - double fitmom_err = sqrt(momerr.covMatrix().similarity(momvec)); - - if ( (trk->chisqConsistency().consistency() > fMinFitCons ) && - (trk->nActive() > fMinNActive ) && - (trk->t0().t0Err() < fMaxT0Err ) && - (fitmom_err < fMaxFitMomErr) && - (trk->helix(0).tanDip() > fMinTanDip ) && - (trk->helix(0).tanDip() < fMaxTanDip ) && - (trk->helix(0).d0() < fMaxD1 ) && - (trk->helix(0).d0() > fMinD1 ) && - (mom.mag() > fTrkMomCut )){ - - _nTrkGood = 1; - } - } - //-------------------------------------------------------------------------------- - - int vdVecSize = vdStepsHandleVec.size(); - initVHits(); - - // double timeLastHit(1e10); - // double timeLastHit(0); - - for (int j=0; j< vdVecSize; ++j){ - vdStepsHandle = & vdStepsHandleVec[j]; - if (vdStepsHandle->isValid()) { - vdHits = vdStepsHandle->operator->(); - - for (size_t i=0; isize(); ++i) { - StepPointMC hit = vdHits->at(i); - - if (hit.simParticle()->fromGenerator()) { - int id = hit.volumeId(); - - if (id == VirtualDetectorId::EMC_Disk_0_SurfIn || - id == VirtualDetectorId::EMC_Disk_1_SurfIn || - id == VirtualDetectorId::EMC_Disk_0_EdgeIn || - id == VirtualDetectorId::EMC_Disk_1_EdgeIn ) { - - art::Ptr const& simptr = hit.simParticle(); - //2016-01-10 G. PEzzullo temporary comment for using - // a custom made gen particle - - SimParticle const& sim = *simptr; - - if ( sim.fromGenerator() ){ - - GenParticle* gen = (GenParticle*) &(*sim.genParticle()); - if ( gen->generatorId().isConversion() ){ - continue; - } - } - if ( !sim.fromGenerator() ) continue; - - double hitTime = fmod(hit.time(), _mbtime); - if (hitTime < _mbbuffer) { - if (hitTime+_mbtime > _blindTime) { - hitTime = hitTime + _mbtime; - } - } - else { - if (hitTime > (_mbtime - _mbbuffer)) { - if (hitTime - _mbtime > _blindTime) { - hitTime = hitTime - _mbtime; - } - } - } - - // if (hitTime > timeLastHit) continue; - // if (hitTime < timeLastHit) continue; - - // timeLastHit = hitTime; - - _vT [_vNHits] = hitTime; - - _vP [_vNHits] = hit.momentum().mag(); - _vPx [_vNHits] = hit.momentum().x(); - _vPy [_vNHits] = hit.momentum().y(); - _vPz [_vNHits] = hit.momentum().z(); - _vPt [_vNHits] = std::sqrt( std::pow(_vPx[_vNHits],2.)+std::pow(_vPy[_vNHits],2.) ); - _vPdgId[_vNHits] = hit.simParticle()->pdgId(); - _vM [_vNHits] = pdt->particle(_vPdgId[_vNHits]).mass(); - _vE [_vNHits] = sqrt(_vP[_vNHits]*_vP[_vNHits] + _vM[_vNHits]*_vM[_vNHits]); - _vEKin [_vNHits] = _vE[_vNHits] - _vM[_vNHits]; - - _vX [_vNHits] = hit.position().x()+3904.; - _vY [_vNHits] = hit.position().y(); - _vZ [_vNHits] = hit.position().z(); - _vR [_vNHits] = sqrt(_vX[_vNHits]*_vX[_vNHits] + _vY[_vNHits]*_vY[_vNHits]); - - _vCosth [_vNHits] = _vPz[_vNHits]/_vP[_vNHits]; - _vRadius[_vNHits] = std::sqrt(_vX[_vNHits]*_vX[_vNHits]+_vY[_vNHits]*_vY[_vNHits]); - _vId [_vNHits] = id; - - ++_vNHits; - } - } - } - } - } - - _nHits = 0; - _cryEtot = 0.0; - - //some helper variables - const CaloCluster *cluster; - const std::vector *crystals; - const CaloHit *crystalHit; - const CaloRecoDigi *recoDigi; - // const CaloDigi *caloDigi; - const CaloHitMC *caloDigiMC(0); - const SimParticle *sim; - - //fill DAQ histograms - double amplitude(0); - int roId(0), crystalID(0), diskId(0); - - int nThresholds(10), nWords(0); - int disk0NCaloDigi [10] = {0}; - int disk1NCaloDigi [10] = {0}; - int disk0NSamplesPerEvent[10] = {0}; - int disk1NSamplesPerEvent[10] = {0}; - double thresholds [10] = {1., 2., 3, 4., 5., 6, 7, 8, 9, 10}; - // double ADC2mV = 2000./pow(2.,12); - double radius(0); - - //2016-01-27 G. Pezzullo conversion from thresholds given in MeV to mV - double p1(21.65);//for the pulse wfInput =2 - // double p1(14.76);//for the pulse wfInput =3 - - for(int i=0; i nWordsCrystals(ncrystals,0); - - std::vector pulse; - CLHEP::Hep3Vector crystalPos(0); - int nROs = _caloCrystals*2; - - double nWorsRO [10][4000]; - double radiusRO [10][4000]; - double diskIdRO [10][4000]; - int nHitsRO [10][4000]; - for (int i=0;iat(i); - //amplitude = recoDigi->amplitude()*ADC2mV; - roId = recoDigi->SiPMID(); - crystalID = CaloSiPMId(roId).crystal().id(); - diskId = _calorimeter->crystal(crystalID).diskID(); - - crystalPos = _calorimeter->geomUtil().mu2eToDiskFF(diskId,_calorimeter->crystal(crystalID).position()); - radius = sqrt(crystalPos.x()*crystalPos.x() + crystalPos.y()*crystalPos.y()); - - if (radius < _caloRmin) continue; - - _recoDigiEnergy[i] = recoDigi->energyDep(); - - const CaloDigi& caloDigi = *recoDigi->caloDigiPtr(); - - pulse = caloDigi.waveform(); - nWords = pulse.size(); - //get the amplitude - for (int j=0; j amplitude) amplitude = content; - } - _recoDigiAmp [i] = amplitude; - - _recoDigiSamples [i] = nWords; - _recoDigiId [i] = roId; - _recoDigiT0 [i] = caloDigi.t0(); - _recoDigiX [i] = crystalPos.x(); - _recoDigiY [i] = crystalPos.y(); - _recoDigiZ [i] = diskId; - _recoDigiTime [i] = recoDigi->time(); - - if (_fillWaveforms == 1){ - for (int j=0; j thresholds[k]){ - nWorsRO [k][roId] += nWords; - radiusRO [k][roId] = radius; - diskIdRO [k][roId] = diskId; - nHitsRO [k][roId] += 1; - - if (diskId ==0){ - disk0NCaloDigi[k] = disk0NCaloDigi[k] + 1; - disk0NSamplesPerEvent[k] = disk0NSamplesPerEvent[k] + nWords ; - _histDisk0._hNSamplesPerDigi [k]->Fill(nWords); - }else if (diskId == 1){ - disk1NCaloDigi[k] = disk1NCaloDigi[k] + 1; - disk1NSamplesPerEvent[k] = disk1NSamplesPerEvent[k] + nWords ; - _histDisk1._hNSamplesPerDigi [k]->Fill(nWords); - } - } - }//end loop on the thresholds - - } - - for (int k=0; kFill(disk0NCaloDigi [k]); - _histDisk0._hNSamplesPerEvent[k]->Fill(disk0NSamplesPerEvent[k]); - - _histDisk1._hNCaloDigi [k]->Fill(disk1NCaloDigi [k]); - _histDisk1._hNSamplesPerEvent[k]->Fill(disk1NSamplesPerEvent[k]); - - double content(0); - - for (int i=0; i 0){ - if ( diskIdRO[k][i] == 0){ - _histDisk0._hNSamplesVsRadius[k]->Fill(radius, content); - _histDisk0._hNHitsVsRadius [k]->Fill(radius, nHitsRO[k][i]); - }else { - _histDisk1._hNSamplesVsRadius[k]->Fill(radius, content); - _histDisk1._hNHitsVsRadius [k]->Fill(radius, nHitsRO[k][i]); - } - } - } - - for (int j=0; j 0){ - _hNSamplesVsCrysId[k]->Fill(j, nWordsCrystals[j]); - } - } - - } - - for (int ic=0; icat(ic); - CLHEP::Hep3Vector crystalPos = _calorimeter->geomUtil().mu2eToDiskFF(diskId,_calorimeter->crystal(crystalID).position()); - - _cryEtot += hit.energyDep(); - _cryTime[_nHits] = hit.time(); - _cryEdep[_nHits] = hit.energyDep(); - - _cryPosX[_nHits] = crystalPos.x(); - _cryPosY[_nHits] = crystalPos.y(); - _cryPosZ[_nHits] = crystalPos.z(); - _cryPosR[_nHits] = sqrt( _cryPosX[_nHits]*_cryPosX[_nHits] + crystalPos.y()*crystalPos.y() ); - _cryId[_nHits] = hit.crystalID(); - _crySectionId[_nHits] = _calorimeter->crystal(hit.crystalID()).diskID(); - - int indexMC, nParticles(0); - int isConversion(0); - - recoDigi = hit.recoCaloDigis().at(0).operator ->(); - //_cryAmp [_nHits] = recoDigi->amplitude(); - - indexMC = 0;//caloDigi.index(); - - if (nCaloHitMC > 0) { - caloDigiMC = &caloDigiMCCol->at(indexMC); - - for (unsigned k=0; knParticles(); ++k){ - sim = caloDigiMC->energyDeposit(k).sim().operator ->(); - // if ( sim->fromGenerator() ){ - const CLHEP::Hep3Vector genPos = sim->startPosition(); - - // if (!_calorimeter->isInsideCalorimeter(genPos)){ - // ++nParticles; - - // int pdgId = sim->pdgId(); - // double ceEnergy = 104.9; - // double startEnergy = sim->startMomentum().e(); - // if ( (pdgId == 11) && (startEnergy>ceEnergy)) - // { - // isConversion = 1; - // } - // } - }//end loop on the particles inside the crystalHit - - _cryMCTime [_nHits] = caloDigiMC->time(); - _cryMCEdep [_nHits] = caloDigiMC->totalEnergyDep(); - } else { - _cryMCTime [_nHits] = 0; - _cryMCEdep [_nHits] = 0; - } - _cryNParticles[_nHits] = nParticles; - //_cryPsd [_nHits] = recoDigi->psd(); - _cryIsConv [_nHits] = isConversion; - - ++_nHits; - } - - _nCluster = nCaloClusters;//caloClusters->size(); - - for (int i=0; i<_nCluster; ++i){ - cluster = &caloClusters->at(i); - - crystals = &cluster->caloHitsPtrVector(); - - int nCrystals = crystals->size(); - int indexMC; - int isConversion(0); - - double energyMax(0), eMeanTot(0), clusterTime(0), clusterMCMeanTime(0), clusterMeanTime(0), clusterMCTime(0), eDep, psd, crystalTime(0); - - for (int j=0; jat(j).operator ->(); - recoDigi = crystalHit->recoCaloDigis().at(0).operator ->(); - - indexMC = 0;//caloDigi.index(); - - eDep = crystalHit->energyDep(); - psd = 0;//recoDigi ->psd(); - - if (psd >= _psdThreshold){ - crystalTime = crystalHit->time(); - - if (eDep> 10.){ - eMeanTot += eDep; - clusterMeanTime += crystalTime*eDep; - } - - if (eDep > energyMax){ - clusterTime = crystalTime; - energyMax = eDep; - - if (nCaloHitMC > 0) { - caloDigiMC = &caloDigiMCCol->at(indexMC); - clusterMCMeanTime = caloDigiMC->time(); - clusterMCTime = caloDigiMC->time(); - } - } - } - - if (nCaloHitMC > 0) { - - for (unsigned k=0; knParticles(); ++k){ - sim = caloDigiMC->energyDeposit(k).sim().operator ->(); - int pdgId = sim->pdgId(); - double ceEnergy = 104.9; - double startEnergy = sim->startMomentum().e(); - if ( (pdgId == PDGCode::e_minus) && (startEnergy>ceEnergy)) - { - isConversion = 1; - } - // if ( sim->fromGenerator() ){ - // GenParticle* gen = (GenParticle*) &(sim->genParticle()); - // if ( gen->generatorId().isConversion() ){ - // isConversion = 1; - // } - // } - }//end loop on the particles inside the crystalHit - } - } - if (eMeanTot>0){ - clusterMeanTime /= eMeanTot; - } - - _cluEnergy [i] = cluster->energyDep(); - _cluTime [i] = clusterTime; - _cluMeanTime [i] = clusterMeanTime; - _cluMCTime [i] = clusterMCTime; - _cluMCMeanTime[i] = clusterMCMeanTime; - _cluCrysE [i] = energyMax; - _cluNcrys [i] = nCrystals; - _cluCogX [i] = cluster->cog3Vector().x(); - _cluCogY [i] = cluster->cog3Vector().y(); - _cluCogR [i] = sqrt(_cluCogX[i]*_cluCogX[i] + _cluCogY[i]*_cluCogY[i]); - _cluCogZ [i] = cluster->diskID();//cog3Vector().z(); - _cluConv [i] = isConversion; - - }//end filling calo clusters info - - _Ntup->Fill(); - } -} // end namespace mu2e - -DEFINE_ART_MODULE(mu2e::ReadCaloDigi) diff --git a/Analyses/src/ReadPtr_module.cc b/Analyses/src/ReadPtr_module.cc deleted file mode 100644 index abbbd7c6d8..0000000000 --- a/Analyses/src/ReadPtr_module.cc +++ /dev/null @@ -1,105 +0,0 @@ -// -// Example of accessing fitted tracks via a KalRepPtrCollection. -// -// -// Original author Rob Kutschke -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" -#include "art_root_io/TFileService.h" -#include "canvas/Utilities/InputTag.h" - -// Need this for the BaBar headers. -using namespace CLHEP; - -// BaBar includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkParticle.hh" - -// mu2e tracking -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -// This is fragile and needs to be last until CLHEP is -// properly qualified and included in the BaBar classes. -//#include "RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -#include "TH1D.h" - -// C++ includes. -#include -#include - -using namespace std; - -namespace mu2e { - - class ReadPtr : public art::EDAnalyzer { - public: - - explicit ReadPtr(fhicl::ParameterSet const& pset); - - void analyze( art::Event const& e) override; - void beginJob() override; - - private: - - // Information about the data product that contains the fitted tracks. - TrkParticle _tpart; - TrkFitDirection _fdir; - std::string _instanceName; - art::InputTag _inputTag; - - TH1D* _hNTracks; - TH1D* _hFitStatus; - TH1D* _hP; - - }; -} // end namespace mu2e - -mu2e::ReadPtr::ReadPtr(fhicl::ParameterSet const& pset): - EDAnalyzer(pset), - _tpart((TrkParticle::type)(pset.get("fitparticle"))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - _instanceName( _fdir.name() + _tpart.name()), - _inputTag( pset.get("inputModuleLabel"), _instanceName) -{} - -void mu2e::ReadPtr::beginJob(){ - art::ServiceHandle tfs; - _hNTracks = tfs->make( "hNTracks", "Number of tracks per Event", 5, 0., 5.); - _hFitStatus = tfs->make( "hFitStatus", "Fit Status", 10, 0., 10.); - _hP = tfs->make( "hP", "Reconstructed Momentum", 30, 80., 110.); -} - -void mu2e::ReadPtr::analyze(art::Event const& event) { - - auto trksHandle = event.getValidHandle(_inputTag); - auto const& tracks = *trksHandle; - - _hNTracks->Fill(tracks.size()); - - for ( auto const& trk : tracks ){ - - KalRep const& krep = *trk; - - int stat = krep.fitStatus().success(); - _hFitStatus->Fill(stat); - - if ( stat != 1 ) continue; - - double s0 = krep.startValidRange(); - _hP->Fill( krep.momentum(s0).mag() ) ; - - - } - -} - - -DEFINE_ART_MODULE(mu2e::ReadPtr) diff --git a/Analyses/src/ReadTrackCaloMatchingMVA_module.cc b/Analyses/src/ReadTrackCaloMatchingMVA_module.cc deleted file mode 100644 index 51aa2e9ff8..0000000000 --- a/Analyses/src/ReadTrackCaloMatchingMVA_module.cc +++ /dev/null @@ -1,524 +0,0 @@ -// -// -// -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -// Mu2e includes. -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -#include "BTrk/BaBar/Constants.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloMatch.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" -#include "Offline/MCDataProducts/inc/CaloMCTruthAssns.hh" - -#include "Offline/RecoDataProducts/inc/CaloHit.hh" - -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixTraj.hh" - -//CLHEP includes -#include "CLHEP/Vector/TwoVector.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/ProbTools/ChisqConsistency.hh" - -// Other includes. -#include "cetlib_except/exception.h" - - -//root includes -#include "TFile.h" -#include "TNtuple.h" - - -#include -#include -#include -#include -#include -#include -#include - - - -namespace mu2e { - - - class ReadTrackCaloMatchingMVA : public art::EDAnalyzer { - - - public: - - explicit ReadTrackCaloMatchingMVA(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel")), - _caloReadoutModuleLabel(pset.get("caloReadoutModuleLabel")), - _caloClusterModuleLabel(pset.get("caloClusterModuleLabel")), - _caloClusterTruthModuleLabel(pset.get("caloClusterTruthModuleLabel")), - _trkCaloMatchModuleLabel(pset.get("trkCaloMatchModuleLabel")), - _trkIntersectModuleLabel(pset.get("trkIntersectModuleLabel")), - _trkFitterModuleLabel(pset.get("fitterModuleLabel")), - _g4ModuleLabel(pset.get("g4ModuleLabel")), - _virtualDetectorLabel(pset.get("virtualDetectorName")), - _Ntup(0) - {} - - virtual ~ReadTrackCaloMatchingMVA() {} - void beginJob(); - void endJob() {} - - void analyze(art::Event const& e ); - - - - private: - - int findBestCluster(TrkCaloMatchCollection const& trkCaloMatches, int trkId, double maxChi2); - int findBestTrack( TrkCaloMatchCollection const& trkCaloMatches, int cluId, double maxChi2); - - std::string _caloCrystalModuleLabel; - std::string _caloReadoutModuleLabel; - std::string _caloClusterModuleLabel; - std::string _caloClusterTruthModuleLabel; - std::string _trkCaloMatchModuleLabel; - std::string _trkIntersectModuleLabel; - std::string _trkFitterModuleLabel; - std::string _trkfitInstanceName; - std::string _g4ModuleLabel; - std::string _virtualDetectorLabel; - - - - TTree* _Ntup; - - int _evt; - - int _nMatch, _mTrkId[4096],_mCluId[4096]; - float _mChi2[4096],_mChi2Pos[4096],_mChi2Time[4096]; - - int _nTrk,_trknHit[4096],_trkStat[4096],_trkCluIdx[4096]; - float _trkx[4096],_trky[4096],_trkz[4096],_trkFFx[4096],_trkFFy[4096],_trkFFz[4096],_trke[4096],_trkt[4096]; - float _trkpx[4096],_trkpy[4096],_trkpz[4096],_trkprob[4096],_tkrCposX[4096],_tkrCposY[4096]; - float _trkd0[4096],_trkz0[4096],_trkphi0[4096],_trkomega[4096],_trkcdip[4096],_trkdlen[4096]; - - int _nCluster,_nCluSim,_cluNcrys[4096]; - float _cluEnergy[4096],_cluTime[4096],_cluCogX[4096],_cluCogY[4096],_cluCogZ[4096]; - float _cluE1[4096],_cluE9[4096],_cluE25[4096],_clu2Mom[4096],_cluAngle[4096]; - int _cluConv[16384],_cluSimIdx[16384],_cluSimLen[16384]; - std::vector > _cluList; - - int _clusimId[16384],_clusimPdgId[16384],_clusimGenIdx[16384],_clusimCrCode[16384]; - float _clusimMom[16384],_clusimPosX[16384],_clusimPosY[16384],_clusimPosZ[16384],_clusimTime[16384],_clusimEdep[16384]; - - int _nHits,_cryId[4096],_crySecId[4096]; - float _cryTime[4096],_cryEdep[4096],_cryEdepErr[4096],_cryPosX[4096],_cryPosY[4096],_cryPosZ[4096]; - - int _nVd,_vdId[4096],_vdPdgId[4096],_vdenIdx[4096]; - float _vdTime[4096],_vdPosX[4096],_vdPosY[4096],_vdPosZ[4096],_vdMom[4096],_vdMomX[4096],_vdMomY[4096],_vdMomZ[4096]; - - }; - - - - - - - void ReadTrackCaloMatchingMVA::beginJob( ) { - - art::ServiceHandle tfs; - _Ntup = tfs->make("trkClu", "track-cluster match info"); - - _Ntup->Branch("evt", &_evt , "evt/I"); - - _Ntup->Branch("nMatch", &_nMatch , "nMatch/I"); - _Ntup->Branch("mTrkId", &_mTrkId, "mTrkId[nMatch]/I"); - _Ntup->Branch("mCluId", &_mCluId, "mCluId[nMatch]/I"); - _Ntup->Branch("mChi2", &_mChi2, "mChi2[nMatch]/F"); - _Ntup->Branch("mChi2Pos", &_mChi2Pos, "mChi2Pos[nMatch]/F"); - _Ntup->Branch("mChi2Time", &_mChi2Time, "mChi2Time[nMatch]/F"); - - _Ntup->Branch("nTrk", &_nTrk , "nTrk/I"); - _Ntup->Branch("trkX", &_trkx, "trkX[nTrk]/F"); - _Ntup->Branch("trkY", &_trky, "trkY[nTrk]/F"); - _Ntup->Branch("trkZ", &_trkz, "trkZ[nTrk]/F"); - _Ntup->Branch("trkFFX", &_trkFFx, "trkFFX[nTrk]/F"); - _Ntup->Branch("trkFFY", &_trkFFy, "trkFFY[nTrk]/F"); - _Ntup->Branch("trkFFZ", &_trkFFz, "trkFFZ[nTrk]/F"); - _Ntup->Branch("tkrCposX", &_tkrCposX, "tkrCposX[nTrk]/F"); - _Ntup->Branch("tkrCposY", &_tkrCposY, "tkrCposY[nTrk]/F"); - _Ntup->Branch("trkt", &_trkt, "trkt[nTrk]/F"); - _Ntup->Branch("trke", &_trke, "trke[nTrk]/F"); - _Ntup->Branch("trkpX", &_trkpx, "trkpX[nTrk]/F"); - _Ntup->Branch("trkpY", &_trkpy, "trkpY[nTrk]/F"); - _Ntup->Branch("trkpZ", &_trkpz, "trkpZ[nTrk]/F"); - _Ntup->Branch("trknHit", &_trknHit, "trknHit[nTrk]/I"); - _Ntup->Branch("trkStat", &_trkStat, "trkStat[nTrk]/I"); - _Ntup->Branch("trkprob", &_trkprob, "trkprob[nTrk]/F"); - _Ntup->Branch("trkd0", &_trkd0, "trkd0[nTrk]/F"); - _Ntup->Branch("trkz0", &_trkz0, "trkz0[nTrk]/F"); - _Ntup->Branch("trkphi0", &_trkphi0, "trkphi0[nTrk]/F"); - _Ntup->Branch("trkomega", &_trkomega, "trkomega[nTrk]/F"); - _Ntup->Branch("trkcdip", &_trkcdip, "trkcdip[nTrk]/F"); - _Ntup->Branch("trkdlen", &_trkdlen, "trkdlen[nTrk]/F"); - _Ntup->Branch("trkCluIdx", &_trkCluIdx, "trkCluIdx[nTrk]/I"); - - _Ntup->Branch("nCluster", &_nCluster , "nCluster/I"); - _Ntup->Branch("cluEnergy", &_cluEnergy , "cluEnergy[nCluster]/F"); - _Ntup->Branch("cluTime", &_cluTime , "cluTime[nCluster]/F"); - _Ntup->Branch("cluCogX", &_cluCogX , "cluCogX[nCluster]/F"); - _Ntup->Branch("cluCogY", &_cluCogY , "cluCogY[nCluster]/F"); - _Ntup->Branch("cluCogZ", &_cluCogZ , "cluCogZ[nCluster]/F"); - _Ntup->Branch("cluE1", &_cluE1 , "cluE1[nCluster]/F"); - _Ntup->Branch("cluE9", &_cluE1 , "cluE9[nCluster]/F"); - _Ntup->Branch("cluE25", &_cluE25 , "cluE25[nCluster]/F"); - _Ntup->Branch("clu2Mom", &_clu2Mom , "clu2Mom[nCluster]/F"); - _Ntup->Branch("cluAngle", &_cluAngle , "cluAngle[nCluster]/F"); - _Ntup->Branch("cluConv", &_cluConv , "cluConv[nCluster]/I"); - _Ntup->Branch("cluSimIdx", &_cluSimIdx , "cluSimIdx[nCluster]/I"); - _Ntup->Branch("cluSimLen", &_cluSimLen , "cluSimLen[nCluster]/I"); - _Ntup->Branch("cluList", &_cluList); - - _Ntup->Branch("nCluSim", &_nCluSim , "nCluSim/I"); - _Ntup->Branch("clusimId", &_clusimId , "clusimId[nCluSim]/I"); - _Ntup->Branch("clusimPdgId", &_clusimPdgId , "clusimPdgId[nCluSim]/I"); - _Ntup->Branch("clusimGenIdx", &_clusimGenIdx ,"clusimGenIdx[nCluSim]/I"); - _Ntup->Branch("clusimCrCode", &_clusimCrCode ,"clusimCrCode[nCluSim]/I"); - _Ntup->Branch("clusimMom", &_clusimMom , "clusimMom[nCluSim]/F"); - _Ntup->Branch("clusimPosX", &_clusimPosX , "clusimPosX[nCluSim]/F"); - _Ntup->Branch("clusimPosY", &_clusimPosY , "clusimPosY[nCluSim]/F"); - _Ntup->Branch("clusimPosZ", &_clusimPosZ , "clusimPosZ[nCluSim]/F"); - _Ntup->Branch("clusimTime", &_clusimTime , "clusimTime[nCluSim]/F"); - _Ntup->Branch("clusimEdep", &_clusimEdep , "clusimEdep[nCluSim]/F"); - - _Ntup->Branch("nCry", &_nHits , "nCry/I"); - _Ntup->Branch("cryId", &_cryId , "cryId[nCry]/I"); - _Ntup->Branch("crySecId", &_crySecId, "crySecId[nCry]/I"); - _Ntup->Branch("cryPosX", &_cryPosX , "cryPosX[nCry]/F"); - _Ntup->Branch("cryPosY", &_cryPosY , "cryPosY[nCry]/F"); - _Ntup->Branch("cryPosZ", &_cryPosZ , "cryPosZ[nCry]/F"); - _Ntup->Branch("cryEdep", &_cryEdep , "cryEdep[nCry]/F"); - _Ntup->Branch("cryEdepErr", &_cryEdepErr,"cryEdepErr[nCry]/F"); - _Ntup->Branch("cryTime", &_cryTime , "cryTime[nCry]/F"); - - _Ntup->Branch("nVd", &_nVd , "nVd/I"); - _Ntup->Branch("vdId", &_vdId , "vdId[nVd]/I"); - _Ntup->Branch("vdPdgId", &_vdPdgId , "vdPdgId[nVd]/I"); - _Ntup->Branch("vdMom", &_vdMom , "vdMom[nVd]/F"); - _Ntup->Branch("vdMomX", &_vdMomX , "vdMomX[nVd]/F"); - _Ntup->Branch("vdMomY", &_vdMomY , "vdMomY[nVd]/F"); - _Ntup->Branch("vdMomZ", &_vdMomZ , "vdMomZ[nVd]/F"); - _Ntup->Branch("vdPosX", &_vdPosX , "vdPosX[nVd]/F"); - _Ntup->Branch("vdPosY", &_vdPosY , "vdPosY[nVd]/F"); - _Ntup->Branch("vdPosZ", &_vdPosZ , "vdPosZ[nVd]/F"); - _Ntup->Branch("vdTime", &_vdTime , "vdTime[nVd]/F"); - _Ntup->Branch("vdGenIdx", &_vdenIdx , "vdGenIdx[nVd]/I"); - - - } - - - - void ReadTrackCaloMatchingMVA::analyze(art::Event const& event) - { - - Calorimeter const & cal = *(GeomHandle()); - - art::Handle trksHandle; - event.getByLabel(_trkFitterModuleLabel,trksHandle); - - art::Handle caloClustersHandle; - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - CaloClusterCollection const& caloClusters(*caloClustersHandle); - - art::Handle trkCaloMatchHandle; - event.getByLabel(_trkCaloMatchModuleLabel, trkCaloMatchHandle); - TrkCaloMatchCollection const& trkCaloMatches(*trkCaloMatchHandle); - - art::Handle trjIntersectHandle; - event.getByLabel(_trkIntersectModuleLabel, trjIntersectHandle); - TrkCaloIntersectCollection const& trkIntersect(*trjIntersectHandle); - - art::Handle CaloHitsHandle; - event.getByLabel(_caloCrystalModuleLabel, CaloHitsHandle); - CaloHitCollection const& CaloHits(*CaloHitsHandle); - - //Calo cluster truth assignment - art::Handle caloClusterTruthHandle; - event.getByLabel(_caloClusterTruthModuleLabel, caloClusterTruthHandle); - const CaloClusterMCTruthAssn& caloClusterTruth(*caloClusterTruthHandle); - - //Get virtual detector hits - art::Handle vdhits; - event.getByLabel(_g4ModuleLabel,_virtualDetectorLabel,vdhits); - - - std::map, const StepPointMC*> vdMap; - if (vdhits.isValid()) - { - for (auto iter=vdhits->begin(), ie=vdhits->end(); iter!=ie; ++iter) - { - const StepPointMC& hit = *iter; - if (hit.volumeId()VirtualDetectorId::EMC_Disk_1_EdgeOut) continue; - vdMap[hit.simParticle()] = &hit; - } - } - - - _evt = event.id().event(); - - - //-------------------------- Dump matching info -------------------------------- - _nMatch=0; - for (auto const& trkCaloMatch: trkCaloMatches) - { - _mTrkId[_nMatch] = trkCaloMatch.trkId(); - _mCluId[_nMatch] = trkCaloMatch.cluId(); - _mChi2[_nMatch] = trkCaloMatch.chi2(); - _mChi2Pos[_nMatch] = trkCaloMatch.chi2Pos(); - _mChi2Time[_nMatch] = trkCaloMatch.chi2Time(); - - ++_nMatch; - } - - - //-------------------------- Dump extrapolator info -------------------------------- - _nTrk=0; - for (auto const& intersect: trkIntersect) - { - KalRep const& trk = *(intersect.trk()); - - double pathLength = intersect.pathLengthEntrance(); - CLHEP::Hep3Vector trkMomentum = trk.momentum(pathLength); - double trkTime = trk.arrivalTime(pathLength); - double tprob = trk.chisqConsistency().significanceLevel(); - int tNhits = trk.nActive(); - int tStatus = trk.fitStatus().success(); - - - HepPoint point = trk.position(pathLength); - CLHEP::Hep3Vector posTrkInTracker(point.x(),point.y(),point.z()); - CLHEP::Hep3Vector posInMu2e = cal.geomUtil().trackerToMu2e(posTrkInTracker); - CLHEP::Hep3Vector posTrkInSectionFF = cal.geomUtil().mu2eToDiskFF(intersect.diskId(),posInMu2e); - - CLHEP::Hep3Vector posTrkInCrystal = cal.geomUtil().mu2eToCrystal(cal.nearestIdxFromPosition(posInMu2e),posInMu2e); - - - - - HelixTraj trkHel(trk.helix(pathLength).params(),trk.helix(pathLength).covariance()); - - _trkFFx[_nTrk] = posTrkInSectionFF.x(); - _trkFFy[_nTrk] = posTrkInSectionFF.y(); - _trkFFz[_nTrk] = posTrkInSectionFF.z(); - _tkrCposX[_nTrk] = posTrkInCrystal.x(); - _tkrCposY[_nTrk] = posTrkInCrystal.y(); - _trkx[_nTrk] = posTrkInTracker.x(); - _trky[_nTrk] = posTrkInTracker.y(); - _trkz[_nTrk] = posTrkInTracker.z(); - _trkt[_nTrk] = trkTime; - _trke[_nTrk] = trkMomentum.mag(); - _trkpx[_nTrk] = trkMomentum.x(); - _trkpy[_nTrk] = trkMomentum.y(); - _trkpz[_nTrk] = trkMomentum.z(); - _trknHit[_nTrk] = tNhits; - _trkprob[_nTrk] = tprob; - _trkStat[_nTrk] = tStatus; - _trkd0[_nTrk] = trkHel.d0(); - _trkz0[_nTrk] = trkHel.z0(); - _trkphi0[_nTrk] = trkHel.phi0(); - _trkomega[_nTrk] = trkHel.omega(); - _trkcdip[_nTrk] = trkHel.cosDip(); - _trkdlen[_nTrk] = intersect.pathLengthExit()-intersect.pathLengthEntrance(); - _trkCluIdx[_nTrk] = findBestCluster(trkCaloMatches,intersect.trkId(),50); - - ++_nTrk; - } - - - //-------------------------- Dump cluster info -------------------------------- - _nCluster = _nCluSim = 0; - _cluList.clear(); - for (unsigned int ic=0; ic cryList; - for (auto cryPtr : cluster.caloHitsPtrVector()) cryList.push_back(std::distance(&CaloHits.at(0),cryPtr.get())); - - - //Find the caloDigiMC in the truth map - auto itMC = caloClusterTruth.begin(); - while (itMC != caloClusterTruth.end()) {if (itMC->first.get() == &cluster) break; ++itMC;} - const auto eDepMCs = (itMC != caloClusterTruth.end()) ? itMC->second->energyDeposits() : std::vector{}; - - bool isConversion(false); - if (itMC != caloClusterTruth.end()) - { - for (auto& edep : eDepMCs) - { - auto parent(edep.sim()); - while (parent->hasParent()) parent = parent->parent(); - if (parent->genParticle() && parent->genParticle()->generatorId().isConversion() ) isConversion=true; - } - } - - _cluEnergy[_nCluster] = cluster.energyDep(); - _cluTime[_nCluster] = cluster.time(); - _cluNcrys[_nCluster] = cluster.size(); - _cluCogX[_nCluster] = cluster.cog3Vector().x(); //in disk FF frame - _cluCogY[_nCluster] = cluster.cog3Vector().y(); - _cluCogZ[_nCluster] = cluster.cog3Vector().z(); - _cluConv[_nCluster] = isConversion; - _cluList.push_back(cryList); - - _cluSimIdx[_nCluster] = _nCluSim; - _cluSimLen[_nCluster] = eDepMCs.size(); - - for (unsigned i=0;i< eDepMCs.size();++i) - { - const auto& eDepMC = eDepMCs[i]; - art::Ptr sim = eDepMC.sim(); - - art::Ptr smother(sim); - while (smother->hasParent()) smother = smother->parent(); - int genIdx=-1; - if (smother->genParticle()) genIdx = smother->genParticle()->generatorId().id(); - - //double simMom(-1); - CLHEP::Hep3Vector simPos(0,0,0); - auto vdMapEntry = vdMap.find(sim); - if (vdMapEntry != vdMap.end()) - { - //simMom = vdMapEntry->second->momentum().mag(); - CLHEP::Hep3Vector simPos = cal.geomUtil().mu2eToDiskFF(cluster.diskID(), vdMapEntry->second->position()); - } - - _clusimId[_nCluSim] = sim->id().asInt(); - _clusimPdgId[_nCluSim] = sim->pdgId(); - _clusimGenIdx[_nCluSim] = genIdx; - _clusimCrCode[_nCluSim] = sim->creationCode(); - _clusimTime[_nCluSim] = eDepMC.time(); - _clusimEdep[_nCluSim] = eDepMC.energyDep(); - _clusimMom[_nCluSim] = eDepMC.momentumIn(); - _clusimPosX[_nCluSim] = simPos.x(); // in disk FF frame - _clusimPosY[_nCluSim] = simPos.y(); - _clusimPosZ[_nCluSim] = simPos.z(); - - ++_nCluSim; - } - - ++_nCluster; - } - - - //-------------------------- Dump crystal info -------------------------------- - _nHits=0; - for (unsigned int ic=0; icbegin(), ie=vdhits->end(); iter!=ie; ++iter) - { - const StepPointMC& hit = *iter; - - if (hit.volumeId()<73 || hit.volumeId() > 80) continue; - if (_nVd > 999) {std::cout<<"Problem, nVd = "<<_nVd <pdgId(); - _vdTime[_nVd] = hit.time(); - _vdPosX[_nVd] = hit.position().x()+3904; - _vdPosY[_nVd] = hit.position().y(); - _vdPosZ[_nVd] = hit.position().z(); - _vdMom[_nVd] = hit.momentum().mag(); - _vdMomX[_nVd] = hit.momentum().x(); - _vdMomY[_nVd] = hit.momentum().y(); - _vdMomZ[_nVd] = hit.momentum().z(); - _vdenIdx[_nVd] = hit.simParticle()->generatorIndex(); - ++_nVd; - } - - _Ntup->Fill(); - - } - - - - - //---------------------------------------------------------- - int ReadTrackCaloMatchingMVA::findBestCluster(TrkCaloMatchCollection const& trkCaloMatches, int trkId, double maxChi2) - { - double chi2Best(maxChi2), cluBest(-1); - for (auto const& trkCaloMatch: trkCaloMatches) - { - if (trkCaloMatch.trkId()==trkId && trkCaloMatch.chi2() < chi2Best) - { - chi2Best= trkCaloMatch.chi2(); - cluBest = trkCaloMatch.cluId(); - } - } - return cluBest; - } - - //---------------------------------------------------------- - int ReadTrackCaloMatchingMVA::findBestTrack(TrkCaloMatchCollection const& trkCaloMatches, int cluId, double maxChi2) - { - double chi2Best(maxChi2), trkBest(-1); - for (auto const& trkCaloMatch: trkCaloMatches) - { - if (trkCaloMatch.cluId()==cluId && trkCaloMatch.chi2() < chi2Best) - { - chi2Best= trkCaloMatch.chi2(); - trkBest = trkCaloMatch.trkId(); - } - } - return trkBest; - } - - -} - - - - - - -using mu2e::ReadTrackCaloMatchingMVA; -DEFINE_ART_MODULE(ReadTrackCaloMatchingMVA) diff --git a/Analyses/src/ReadTrackCaloMatching_module.cc b/Analyses/src/ReadTrackCaloMatching_module.cc deleted file mode 100644 index 3954caeb5c..0000000000 --- a/Analyses/src/ReadTrackCaloMatching_module.cc +++ /dev/null @@ -1,243 +0,0 @@ -// -// -// -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - -// Other includes. -#include "cetlib_except/exception.h" - - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -//root includes -#include "TFile.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" - - -using namespace std; - -namespace mu2e { - - static int ncalls(0); - - class ReadTrackCaloMatching : public art::EDAnalyzer { - public: - explicit ReadTrackCaloMatching(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel")), - _trackClusterMatchModuleLabel(pset.get("trackClusterMatchModuleLabel")), - _Ntup(0){} - - virtual ~ReadTrackCaloMatching() { - } - void beginJob(); - void endJob() {} - - void analyze(art::Event const& e ); - - private: - - void readTracClusterMatch(art::Event const& evt, bool skip); - - // Diagnostic level - int _diagLevel; - - // Label of the extrapolated impact points - std::string _trackClusterMatchModuleLabel; - - bool _skipEvent; - - TTree* _Ntup;//Ntupla which contains informations about the extrapolation starting from MC - - Int_t _evt,//event Id - _ntrks; - - Float_t _xtrk[100], - _ytrk[100], - _ztrk[100], - _ttrk[100], - _nx[100], - _ny[100], - _nz[100], - _dx[100], - _dy[100], - _dz[100], - _dt[100], - _du[100], - _dv[100], - _ep[100], - _chi2[100], - _chi2_time[100], - _int_depth[100], - _ds[100]; - - }; - - - - void ReadTrackCaloMatching::beginJob( ) { - - cout << "start ReadTrackCaloMatching..."< tfs; - _Ntup = tfs->make("trkClu", "track-cluster match info"); - - _Ntup->Branch("evt" , &_evt , "evt/F"); - _Ntup->Branch("ntrks" , &_ntrks , "ntrks/I"); - - _Ntup->Branch("xtrk", _xtrk, "xtrk[ntrks]/F"); - _Ntup->Branch("ytrk", &_ytrk, "ytrk[ntrks]/F"); - _Ntup->Branch("ztrk", &_ztrk, "ztrk[ntrks]/F"); - _Ntup->Branch("ttrk", &_ttrk, "ttrk[ntrks]/F"); - _Ntup->Branch("nx", &_nx, "nx[ntrks]/F"); - _Ntup->Branch("ny", &_ny, "ny[ntrks]/F"); - _Ntup->Branch("nz", &_nz, "nz[ntrks]/F"); - _Ntup->Branch("dx", &_dx, "dx[ntrks]/F"); - _Ntup->Branch("dy", &_dy, "dy[ntrks]/F"); - _Ntup->Branch("dz", &_dz, "dz[ntrks]/F"); - _Ntup->Branch("dt", &_dt, "dt[ntrks]/F"); - _Ntup->Branch("du", &_du, "du[ntrks]/F"); - _Ntup->Branch("dv", &_dv, "dv[ntrks]/F"); - _Ntup->Branch("ep", &_ep, "ep[ntrks]/F"); - _Ntup->Branch("chi2", &_chi2, "chi2[ntrks]/F"); - _Ntup->Branch("chi2time", &_chi2_time, "chi2time[ntrks]/F"); - _Ntup->Branch("intdepth", &_int_depth, "intdepth[ntrks]/F"); - _Ntup->Branch("ds", &_ds, "ds[ntrks]/F"); - } - - - readTracClusterMatch(evt, _skipEvent); - - } // end of analyze - - - void ReadTrackCaloMatching::readTracClusterMatch(art::Event const& evt, bool skip){ - - art::Handle handle; - evt.getByLabel(_trackClusterMatchModuleLabel, handle); - const TrackClusterMatchCollection* coll; - const TrackClusterMatch* obj; - - if (handle.isValid()){ - coll = handle.product(); - }else { - printf(">>> ERROR in ReadTrackCaloMatching::doExtrapolation: failed to locate collection"); - printf(". BAIL OUT. \n"); - return; - } - - _evt = evt.id().event(); - _ntrks = coll->size(); - - for(int i=0; i<_ntrks; ++i){ - - obj = &coll->at(i); - - _xtrk[i] = obj->xtrk(); - _ytrk[i] = obj->ytrk(); - _ztrk[i] = obj->ztrk(); - _ttrk[i] = obj->ttrk(); - _nx[i] = obj->nx(); - _ny[i] = obj->ny(); - _nz[i] = obj->nz(); - _dx[i] = obj->dx(); - _dy[i] = obj->dy(); - _dz[i] = obj->dz(); - _dt[i] = obj->dt(); - _du[i] = obj->du(); - _dv[i] = obj->dv(); - _ep[i] = obj->ep(); - _chi2[i] = obj->chi2(); - _chi2_time[i] = obj->chi2_time(); - _int_depth[i] = obj->int_depth(); - _ds[i] = obj->ds(); - - - } - - _Ntup->Fill(); - - if(evt.id().event() % 100 == 0){ - cout << "Event "< -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" - - -using namespace std; - -namespace mu2e { - - - class ReadTrkExtrapolMVA : public art::EDAnalyzer { - - public: - - explicit ReadTrkExtrapolMVA(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel",0)), - _trkExtrapolModuleLabel(pset.get("trkExtrapolModuleLabel")), - _Ntup(0) - {} - - virtual ~ReadTrkExtrapolMVA() {} - - void beginJob(); - void endJob() {} - - void analyze(art::Event const& event ); - - - - private: - - int _diagLevel; - std::string _trkExtrapolModuleLabel; - - TTree* _Ntup; - Int_t _evt,_ntrks; - Float_t _caloSec[100],_trkId[100],_trkTime[100],_trkTimeErr[100], _trkPathLenghtIn[100], _trkPathLenghtInErr[100], _trkPathLenghtOut[100]; - Float_t _trkMom[100],_trkMomX[100], _trkMomY[100],_trkMomZ[100], _trkPosX[100], _trkPosY[100], _trkPosZ[100]; - - }; - - - - void ReadTrkExtrapolMVA::beginJob( ) { - - - art::ServiceHandle tfs; - _Ntup = tfs->make("trkExt", "Extrapolated track info"); - - _Ntup->Branch("evt" , &_evt , "evt/F"); - _Ntup->Branch("ntrks" , &_ntrks , "ntrks/I"); - _Ntup->Branch("caloSec", &_caloSec, "caloSec[ntrks]/F"); - _Ntup->Branch("trkTime", &_trkTime, "trkTime[ntrks]/F"); - _Ntup->Branch("trkPathLenghtIn", &_trkPathLenghtIn, "trkPathLenghtIn[ntrks]/F"); - _Ntup->Branch("trkPathLenghtInErr", &_trkPathLenghtInErr, "trkPathLenghtInErr[ntrks]/F"); - _Ntup->Branch("trkPathLenghtOut", &_trkPathLenghtOut, "trkPathLenghtOut[ntrks]/F"); - _Ntup->Branch("trkMom", &_trkMom, "trkMom[ntrks]/F"); - _Ntup->Branch("trkMomX", &_trkMomX, "trkMomX[ntrks]/F"); - _Ntup->Branch("trkMomY", &_trkMomY, "trkMomY[ntrks]/F"); - _Ntup->Branch("trkMomZ", &_trkMomZ, "trkMomZ[ntrks]/F"); - _Ntup->Branch("trkPosX", &_trkPosX, "trkPosX[ntrks]/F"); - _Ntup->Branch("trkPosY", &_trkPosY, "trkPosY[ntrks]/F"); - _Ntup->Branch("trkPosZ", &_trkPosZ, "trkPosZ[ntrks]/F"); - - - } - - - - void ReadTrkExtrapolMVA::analyze(art::Event const& event ) - { - - art::Handle trjExtrapolHandle; - event.getByLabel(_trkExtrapolModuleLabel, trjExtrapolHandle); - TrkCaloIntersectCollection const& trkExtrapols(*trjExtrapolHandle); - - _evt = event.id().event(); - _ntrks = trkExtrapols.size(); - - int it(0); - for (auto const& extrapol: trkExtrapols) - { - double pathLength = extrapol.pathLengthEntrance(); - _caloSec[it] = extrapol.diskId(); - _trkTime[it] = extrapol.trk()->arrivalTime(pathLength); - _trkPathLenghtIn[it] = extrapol.pathLengthEntrance(); - _trkPathLenghtInErr[it] = extrapol.pathLenghtEntranceErr(); - _trkPathLenghtOut[it] = extrapol.pathLengthExit(); - _trkMom[it] = extrapol.trk()->momentum(pathLength).mag(); - _trkMomX[it] = extrapol.trk()->momentum(pathLength).x(); - _trkMomY[it] = extrapol.trk()->momentum(pathLength).y(); - _trkMomZ[it] = extrapol.trk()->momentum(pathLength).z(); - _trkPosX[it] = extrapol.trk()->position(pathLength).x(); - _trkPosY[it] = extrapol.trk()->position(pathLength).y(); - _trkPosZ[it] = extrapol.trk()->position(pathLength).z(); - - ++it; - } - - _Ntup->Fill(); - } - - -} - - - -using mu2e::ReadTrkExtrapolMVA; -DEFINE_ART_MODULE(ReadTrkExtrapolMVA) diff --git a/Analyses/src/ReadTrkExtrapol_module.cc b/Analyses/src/ReadTrkExtrapol_module.cc deleted file mode 100644 index 3dd44b0273..0000000000 --- a/Analyses/src/ReadTrkExtrapol_module.cc +++ /dev/null @@ -1,231 +0,0 @@ -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -//root includes -#include "TFile.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" - - -using namespace std; - -namespace mu2e { - - static int ncalls(0); - - class ReadTrkExtrapol : public art::EDAnalyzer { - public: - explicit ReadTrkExtrapol(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel")), - _trkToCaloExtrapolModuleLabel(pset.get("trkToCaloExtrapolModuleLabel")), - _Ntup(0){} - - virtual ~ReadTrkExtrapol() { - } - void beginJob(); - void endJob() {} - - void analyze(art::Event const& e ); - - private: - - void readTrackExtrapolation(art::Event const& evt, bool skip); - - // Diagnostic level - int _diagLevel; - - // Label of the extrapolated impact points - std::string _trkToCaloExtrapolModuleLabel; - - bool _skipEvent; - - TTree* _Ntup;//Ntupla which contains informations about the extrapolation starting from MC - - Int_t _evt,//event Id - _ntrks; - - Float_t _caloSec[100], - _trkId[100], - _trkTime[100], - _trkTimeErr[100], - _trkPathLenghtIn[100], - _trkPathLenghtInErr[100], - _trkPathLenghtOut[100], - _trkPathLenghtOutErr[100], - _trkMom[100], - _trkMomX[100], - _trkMomY[100], - _trkMomZ[100], - _trkPosX[100], - _trkPosY[100], - _trkPosZ[100]; - - }; - - - - void ReadTrkExtrapol::beginJob( ) { - - cout << "start ReadTrkExtrapol..."< tfs; - _Ntup = tfs->make("trkExt", "Extrapolated track info"); - - _Ntup->Branch("evt" , &_evt , "evt/F"); - _Ntup->Branch("ntrks" , &_ntrks , "ntrks/I"); - _Ntup->Branch("caloSec", &_caloSec, "caloSec[ntrks]/F"); - _Ntup->Branch("trkId", &_trkId, "trkId[ntrks]/F"); - _Ntup->Branch("trkTime", &_trkTime, "trkTime[ntrks]/F"); - _Ntup->Branch("trkTimeErr", &_trkTimeErr, "trkTimeErr[ntrks]/F"); - _Ntup->Branch("trkPathLenghtIn", &_trkPathLenghtIn, "trkPathLenghtIn[ntrks]/F"); - _Ntup->Branch("trkPathLenghtInErr", &_trkPathLenghtInErr, "trkPathLenghtInErr[ntrks]/F"); - _Ntup->Branch("trkPathLenghtOut", &_trkPathLenghtOut, "trkPathLenghtOut[ntrks]/F"); - _Ntup->Branch("trkPathLenghtOutErr", &_trkPathLenghtOutErr, "trkPathLenghtOutErr[ntrks]/F"); - _Ntup->Branch("trkMom", &_trkMom, "trkMom[ntrks]/F"); - _Ntup->Branch("trkMomX", &_trkMomX, "trkMomX[ntrks]/F"); - _Ntup->Branch("trkMomY", &_trkMomY, "trkMomY[ntrks]/F"); - _Ntup->Branch("trkMomZ", &_trkMomZ, "trkMomZ[ntrks]/F"); - _Ntup->Branch("trkPosX", &_trkPosX, "trkPosX[ntrks]/F"); - _Ntup->Branch("trkPosY", &_trkPosY, "trkPosY[ntrks]/F"); - _Ntup->Branch("trkPosZ", &_trkPosZ, "trkPosZ[ntrks]/F"); - - } - - - readTrackExtrapolation(evt, _skipEvent); - - } // end of analyze - - - void ReadTrkExtrapol::readTrackExtrapolation(art::Event const& evt, bool skip){ - - art::Handle handle; - evt.getByLabel(_trkToCaloExtrapolModuleLabel, handle); - const TrkToCaloExtrapolCollection* coll; - const TrkToCaloExtrapol *trkExt; - - if (handle.isValid()) { - coll = handle.product(); - } else { - printf(">>> ERROR in readTrackExtrapolation::doExtrapolation: failed to locate collection"); - printf(". BAIL OUT. \n"); - return; - } - - _evt = evt.id().event(); - _ntrks = coll->size(); - - for(int i=0; i<_ntrks; ++i){ - trkExt = &coll->at(i); -// KalRepPtr const& trkPtr = trkExt->trk(); -// const KalRep* trk = trkPtr.get(); - - _caloSec[i] = trkExt->diskId(); - _trkId[i] = trkExt->trackNumber(); - _trkTime[i] = trkExt->time(); - _trkTimeErr[i] = trkExt->timeErr(); - - _trkPathLenghtIn[i] = trkExt->pathLengthEntrance(); - _trkPathLenghtInErr[i] = trkExt->pathLenghtEntranceErr(); - _trkPathLenghtOut[i] = trkExt->pathLengthExit(); - _trkPathLenghtOutErr[i] = trkExt->pathLenghtEntranceErr(); - _trkMom[i] = trkExt->momentum().mag(); - _trkMomX[i] = trkExt->momentum().x(); - _trkMomY[i] = trkExt->momentum().y(); - _trkMomZ[i] = trkExt->momentum().z(); - _trkPosX[i] = trkExt->entrancePosition().x(); - _trkPosY[i] = trkExt->entrancePosition().y(); - _trkPosZ[i] = trkExt->entrancePosition().z(); - - } - - _Ntup->Fill(); - - if(evt.id().event() % 100 == 0){ - cout << "Event "< -#include -#include -#include - -#include "cetlib_except/exception.h" - -#include "CLHEP/Vector/ThreeVector.h" - -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" - -#include "Offline/Mu2eUtilities/inc/toHepPoint.hh" -#include "Offline/RecoDataProducts/inc/TrackSummary.hh" -#include "Offline/RecoDataProducts/inc/TrackSummaryRecoMap.hh" - -namespace mu2e { - - class TrackSummaryMaker : public art::EDProducer { - public: - - struct Config { - using Name=fhicl::Name; - using Comment=fhicl::Comment; - fhicl::Atom trackInput{ Name("trackInput"), Comment("The input collection.") }; - }; - - using Parameters = art::EDProducer::Table; - explicit TrackSummaryMaker(const Parameters& conf); - - void produce(art::Event& evt) override; - private: - art::InputTag trackInput_; - }; - - //================================================================ - TrackSummaryMaker::TrackSummaryMaker(const Parameters& conf) - : art::EDProducer{conf} - , trackInput_(conf().trackInput()) - { - produces(); - produces(); - } - - //================================================================ - void TrackSummaryMaker::produce(art::Event& event) { - GeomHandle det; - GeomHandle vdg; - - std::unique_ptr output(new TrackSummaryCollection()); - std::unique_ptr recomap(new TrackSummaryRecoMap()); - - const art::ProductID trackSummaryPID = event.getProductID(); - const art::EDProductGetter *trackSummaryGetter = event.productGetter(trackSummaryPID); - - auto ih = event.getValidHandle(trackInput_); - for(unsigned itrack=0; itracksize(); ++itrack) { - const auto& krep = (*ih)[itrack]; - if(krep->fitCurrent()){ - TrackSummary sum(krep->fitStatus().success(), - krep->charge(), krep->nActive(), - krep->nDof(), krep->chisq(), - krep->t0().t0(), krep->t0().t0Err(), - krep->flt0()); - - // The following code is based on KalFitMC.cc - CLHEP::Hep3Vector entpos = det->toDetector(vdg->getGlobal(VirtualDetectorId::TT_FrontPA)); - double zent = entpos.z(); - double firsthitfltlen = krep->firstHit()->kalHit()->hit()->fltLen(); - double lasthitfltlen = krep->lastHit()->kalHit()->hit()->fltLen(); - double entlen = std::min(firsthitfltlen,lasthitfltlen); - if(!TrkHelixUtils::findZFltlen(krep->traj(),zent,entlen,0.1)) { - throw cet::exception("RUNTIME")<<"Error from findZFltlen()\n"; - } - - double loclen(0.0); - TrackSummary::HelixParams helix(*krep->localTrajectory(entlen,loclen)); - TrackSummary::TrackStateAtPoint st(helix, - fromHepPoint(krep->position(entlen)), - krep->momentum(entlen), - krep->momentumErr(entlen).covMatrix(), - krep->arrivalTime(entlen), - entlen - ); - - sum.addState(st); - - recomap->addSingle(art::Ptr(ih, itrack), - art::Ptr(trackSummaryPID, output->size(), trackSummaryGetter)); - - output->emplace_back(sum); - } - else { - throw cet::exception("BADINPUT")<<"TrackSummaryMaker: do not know what to do with a fitCurrent==0 track\n"; - } - } - - event.put(std::move(output)); - event.put(std::move(recomap)); - } - - //================================================================ - -} // namespace mu2e - -DEFINE_ART_MODULE(mu2e::TrackSummaryMaker) diff --git a/Analyses/src/TrackSummaryTruthMaker_module.cc b/Analyses/src/TrackSummaryTruthMaker_module.cc deleted file mode 100644 index a7539ce907..0000000000 --- a/Analyses/src/TrackSummaryTruthMaker_module.cc +++ /dev/null @@ -1,108 +0,0 @@ -// Andrei Gaponenko, 2014 - -#include -#include -#include -#include - -#include "cetlib_except/exception.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" - -#include "Offline/RecoDataProducts/inc/StrawDigi.hh" -#include "Offline/MCDataProducts/inc/StrawDigiMC.hh" -#include "Offline/RecoDataProducts/inc/TrackSummaryRecoMap.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/MCDataProducts/inc/TrackSummaryTruthAssns.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" - -#include "Offline/Mu2eUtilities/inc/particleEnteringG4Volume.hh" - -namespace mu2e { - - class TrackSummaryTruthMaker : public art::EDProducer { - public: - explicit TrackSummaryTruthMaker(fhicl::ParameterSet const& pset); - void produce(art::Event& evt) override; - private: - art::InputTag recoMapInput_; - art::InputTag strawHitDigiMCInput_; - - // Cuts for storing a match - unsigned minPrincipalHits_; - unsigned minAllHits_; - }; - - //================================================================ - TrackSummaryTruthMaker::TrackSummaryTruthMaker(const fhicl::ParameterSet& pset) - : art::EDProducer{pset} - , recoMapInput_(pset.get("recoMapInput")) - , strawHitDigiMCInput_(pset.get("strawHitDigiMCInput")) - , minPrincipalHits_(pset.get("minPrincipalHits")) - , minAllHits_(pset.get("minAllHits")) - { - produces(); - produces(); // list of particles of interest for filtering - } - - //================================================================ - void TrackSummaryTruthMaker::produce(art::Event& event) { - std::unique_ptr spptrs(new SimParticlePtrCollection()); - std::unique_ptr output(new TrackSummaryTruthAssns()); - auto ireco = event.getValidHandle(recoMapInput_); - auto imc = event.getValidHandle(strawHitDigiMCInput_); - - StrawEnd end(StrawEnd::cal); - - typedef std::map, unsigned> PerParticleCount; - PerParticleCount nPrincipal; - PerParticleCount nAll; - - for(const auto& recoMapEntry: *ireco) { - const KalRep& krep = **recoMapEntry.first; - for(const auto hot : krep.hitVector()) { - const TrkStrawHit *hit = dynamic_cast(hot); - if(!hit) { - throw cet::exception("BADINPUT")<<"TrackSummaryTruthMaker: an entry in KalRep::hitVector() is not a TrkStrawHit.\n"; - } - - const StrawDigiMC& dmc = imc->at(hit->index()); - if(hit->straw().id() != dmc.strawId()) { - throw cet::exception("BADINPUTS")<<"TrackSummaryTruthMaker: mismatched input data: " - <<"straw id="<straw().id() - <<" != StrawDigiMC index="<isActive()) { - ++nPrincipal[particleEnteringG4Volume(*dmc.strawGasStep(end))]; - // Aggregate all the steps, so that each particle is counted no more than once per hit - std::set > parts; - parts.insert(particleEnteringG4Volume(*dmc.strawGasStep(end))); - for(const auto& p: parts) { - ++nAll[p]; - } - } - } - - // The "principal" particles should form a subset of "all" - // Therefore it is sufficient to iterate over "all". - for(const auto& p : nAll) { - TrackSummaryMatchInfo mi(nPrincipal[p.first], p.second); - if((mi.nPrincipal() >= minPrincipalHits_) || (mi.nAll() >= minAllHits_)) { - output->addSingle(p.first, recoMapEntry.second, mi); - spptrs->emplace_back(p.first); - } - } - } - - event.put(std::move(output)); - event.put(std::move(spptrs)); - } - -} // namespace mu2e - -DEFINE_ART_MODULE(mu2e::TrackSummaryTruthMaker) diff --git a/Analyses/src/materailsPropStudy_module.cc b/Analyses/src/materailsPropStudy_module.cc deleted file mode 100644 index dfd2c3d540..0000000000 --- a/Analyses/src/materailsPropStudy_module.cc +++ /dev/null @@ -1,184 +0,0 @@ -// -// Module which starts the event display, and transmits the data of each event to the event display. -// - -// framework -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/SubRun.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art_root_io/TFileService.h" -#include "Offline/SeedService/inc/SeedService.hh" - -// BaBar -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/MatEnv/RecoMatFactory.hh" -#include "BTrk/MatEnv/MatDBInfo.hh" -#include "BTrk/DetectorModel/DetMaterial.hh" - -// c++ -#include -#include -#include - -// ROOT -#include "TNtuple.h" -#include "TMath.h" -#include "TFile.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "TApplication.h" -#include "TGMsgBox.h" -#include "TTree.h" - -// CLHEP -#include "CLHEP/Units/SystemOfUnits.h" - - -namespace mu2e -{ - class materailsPropStudy : public art::EDAnalyzer - { - public: - explicit materailsPropStudy(fhicl::ParameterSet const&); - virtual ~materailsPropStudy() { } - virtual void beginJob(); - virtual void beginRun(art::Run const&) override; - void endJob(); - //void produce(art::Event& e); - void analyze(art::Event const&); - - private: - - MatDBInfo* matdbinfo(){ - static MatDBInfo mat; - return &mat; - } - - //std::string _materialdb; - std::string _matname; - TrkParticle _tpart; // particle type being searched for - double _partmom; - double _Tcut; - std::vector _pathlengths; - double _maxTCut_dEdx; - unsigned int _nStepTCut_dEdx; - - const DetMaterial *_mat; - - TNtuple *_meanEloss; - TNtuple *_dEdx; - - // Save directory from beginJob so that we can go there in endJob. See note 3. - TDirectory* _directory; - - }; - - materailsPropStudy::materailsPropStudy(fhicl::ParameterSet const& pset) : - art::EDAnalyzer(pset), - //_materialdb(pset.get("materialdb", "")), - _matname(pset.get("matname", "")), - _tpart((TrkParticle::type)(pset.get("particle",TrkParticle::e_minus))), - _partmom(pset.get("partmom",100.0)), - _Tcut(pset.get("Tcut",-1)), - _pathlengths(pset.get< std::vector >("pathlengths")), - _maxTCut_dEdx(pset.get("maxTCut_dEdx",0)), - _nStepTCut_dEdx(pset.get("nStepTCut_dEdx",0)), - _mat(0), - _meanEloss(0), - _dEdx(0), - _directory(0) - { - } - - void materailsPropStudy::beginJob() - { - art::ServiceHandle tfs; - _meanEloss = tfs->make("meanEloss","meanEloss","path:elossBB:elossTCut_20:elossTCut_500:elossTCut_1000"); - _dEdx = tfs->make("dEdx","dEdx","TCut:dedx"); - - // See note 3. - _directory = gDirectory; - } - - void materailsPropStudy::beginRun(art::Run const&){ - //std::cout<<"init dchdetector"<materialDictionary())->FillMtrDict(mtrList); - //MatDBInfo* mtdbinfo=new MatDBInfo; - - _mat = matdbinfo()->findDetMaterial(_matname); - - //_mat->printAll(std::cout); - //double pathlen = 1.0*CLHEP::cm; - //std::cout<<"part mass "<<_tpart.mass()<density()<dEdx(_partmom,DetMaterial::loss,_tpart)/_mat->density()/CLHEP::cm/CLHEP::cm< diff --git a/CaloFilters/CMakeLists.txt b/CaloFilters/CMakeLists.txt index 60b8b5e1b0..0cc356d96f 100644 --- a/CaloFilters/CMakeLists.txt +++ b/CaloFilters/CMakeLists.txt @@ -29,17 +29,6 @@ cet_build_plugin(CaloLikelihood art::module Offline::RecoDataProducts ) -cet_build_plugin(EcalTriggerPreselect art::module - REG_SOURCE src/EcalTriggerPreselect_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::ConditionsService - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts -) - cet_build_plugin(FilterEcalMixedTrigger art::module REG_SOURCE src/FilterEcalMixedTrigger_module.cc LIBRARIES REG diff --git a/CaloFilters/src/EcalTriggerPreselect_module.cc b/CaloFilters/src/EcalTriggerPreselect_module.cc deleted file mode 100644 index 6a8b241732..0000000000 --- a/CaloFilters/src/EcalTriggerPreselect_module.cc +++ /dev/null @@ -1,319 +0,0 @@ -// -// Filter events whit killed tracks. -// - -// Mu2e includes. - -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/TrkQual.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/GenId.hh" - -#include "Offline/MCDataProducts/inc/StepPointMC.hh" - -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/CaloRecoDigi.hh" - -// prefetching Digi -#include "Offline/RecoDataProducts/inc/CaloDigi.hh" - -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" -#include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" - -// Framework includes. -#include "art/Framework/Core/EDFilter.h" -#include "art/Framework/Principal/Event.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - -// C++ includes -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace mu2e { - - class EcalTriggerPreselect : public art::EDFilter { - public: - explicit EcalTriggerPreselect(fhicl::ParameterSet const& pset); - virtual ~EcalTriggerPreselect() { } - - bool filter( art::Event& event); - - //virtual bool beginRun(art::Run &run) override; - - virtual void beginJob() override; - virtual void endJob() override; - - private: - - int _diagLevel; - std::string _g4ModuleLabel; - std::string _virtualDetectorLabel; - std::string _caloDigiModuleLabel; - art::InputTag _shTag; - art::InputTag _shpTag; - - std::string _trkPatRecModuleLabel; - art::InputTag _tqTag; - std::string _caloClusterModuleLabel; - std::string _trackClusterMatchModuleLabel; - std::string _instanceName; - TrkParticle _tpart; - TrkFitDirection _fdir; - int nch; // number of combo hits - const ComboHit* comboHit; - const ComboHitCollection* _chcol; - const TrkQualCollection* _tqcol; - int _virtualhit_good; - int _trk_good; - int _match_good; - float _D0MIN; - float _D0MAX; - float _RMAXMIN; - float _RMAXMAX; - float _T0MIN; - float _T0MAX; - float _TANDIPMIN; - float _TANDIPMAX; - float _MVAMIN; - int _VDPID; - float _PMIN; - float _PMATCHMIN; - float _ECLUMIN; - float _DTMIN; - float _DTMAX; - float _CHI2MATCHMIN; - - int _nProcessed; - // Clusters - int _nCluster; - float _cluEnergys[16384]; - float _cluene; - }; - - EcalTriggerPreselect::EcalTriggerPreselect(fhicl::ParameterSet const& pset): - art::EDFilter{pset}, - _diagLevel(pset.get("diagLevel",0)), - _g4ModuleLabel(pset.get("g4ModuleLabel","g4run")), - _virtualDetectorLabel(pset.get("virtualDetectorName","virtualdetector")), - _caloDigiModuleLabel (pset.get("caloDigiModuleLabel","CaloDigiFromShower")), - _shTag(pset.get("StrawHitCollectionTag","makePH")), - _trkPatRecModuleLabel(pset.get("trkPatRecModuleLabel")), - _tqTag(pset.get("TrkQualTag","KFFDeM")), - _caloClusterModuleLabel(pset.get("caloClusterModuleLabel")), - _trackClusterMatchModuleLabel(pset.get("trackClusterMatchModuleLabel")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _virtualhit_good(pset.get("virtualhit",1)), - _trk_good(pset.get("trkgood",1)), - _match_good(pset.get("matchgood",1)), - _D0MIN (pset.get("D0MIN",-80.)), - _D0MAX (pset.get("D0MAX",105.)), - _RMAXMIN (pset.get("RMAXMIN",450.)), - _RMAXMAX (pset.get("RMAXMAX",680.)), - _T0MIN (pset.get("T0MIN",700.)), - _T0MAX (pset.get("T0MAX",1720.)), - _TANDIPMIN (pset.get("TANDIPMIN",0.57735)), - _TANDIPMAX (pset.get("TANDIPMAX",1.)), - _MVAMIN (pset.get("MVAMIN",0.4)), - _VDPID (pset.get("VDPID",11)), - _PMIN (pset.get("PMIN",90.)), - _PMATCHMIN (pset.get("PMATCHMIN",100.)), - _ECLUMIN (pset.get("ECLUMIN",10.)), - _DTMIN (pset.get("DTMIN",-12.)), - _DTMAX (pset.get("DTMAX",0.)), - _CHI2MATCHMIN (pset.get("CHI2MATCHMIN",100.)), - _nProcessed(0){ - } - - void EcalTriggerPreselect::beginJob(){ - art::ServiceHandle tfs; - art::TFileDirectory tfdir = tfs->mkdir("diag"); - - } - - bool EcalTriggerPreselect::filter(art::Event& event) { - - - ++_nProcessed; - if (_nProcessed%100==0 && _diagLevel > 0) std::cout<<"Processing event from EcalTriggerPreselect = "<<_nProcessed < geom; - if( ! geom->hasElement() ) return false; - - //load the timeoffset - double _mbtime = GlobalConstantsHandle()->getNominalDRPeriod(); - - //-------------------------- Prefetch Calo Digis -------------------------------- - auto caloDigiFlag = event.getValidHandle(_caloDigiModuleLabel); - if ( caloDigiFlag.product() == 0){ - std::cout << "EcalTriggerPreselect: CaloDigiHandle NOT VALID" << std::endl; - return false; - } - const CaloDigiCollection& caloDigis = *caloDigiFlag.product(); - - int roId; - for (const auto& caloDigi : caloDigis){ - roId=caloDigi.SiPMID(); - if (roId==0) continue; - } - - // ------------------------- Prefetch Straw Hits and Straw Hit Positions ------------------------------- - - auto chcolH = event.getValidHandle(_shTag); - - if (chcolH.product() != 0){ - _chcol= chcolH.product(); - nch=_chcol->size(); - for(int istr=0; istrat(istr); - } - } - else{ - std::cout << "EcalTriggerPreselect: ComboHitCollection Handle NOT VALID" << std::endl; - return false; - } - if (_diagLevel > 1) std::cout << "Combo Hits Number: " << nch < vdhits; - event.getByLabel(_g4ModuleLabel,_virtualDetectorLabel,vdhits); - - // Handle tracks - art::Handle trksHandle; - event.getByLabel(_trkPatRecModuleLabel, trksHandle); - const KalRepPtrCollection& trks = *trksHandle; - //----- Track quality (produced by TrkPatRec/src/KalFinalFit_module.cc) - // from TrkDiag/src/TrkRecoDiag_module.cc - auto tqH = event.getValidHandle(_tqTag); - _tqcol = tqH.product(); - - // Handle clusters - art::Handle caloClustersHandle; - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - CaloClusterCollection const& caloClusters(*caloClustersHandle); - - _nCluster = 0; - for (CaloClusterCollection::const_iterator clusterIt = caloClusters.begin(); clusterIt != caloClusters.end(); ++clusterIt){ - _cluEnergys[_nCluster] = clusterIt->energyDep(); - ++_nCluster; - } - - // Check virtual hits - - bool virtualhit_good=false; - if (_virtualhit_good ){ - if (vdhits.isValid()){ - for (auto iter=vdhits->begin(), ie=vdhits->end(); iter!=ie; ++iter){ - // the virtual hit has the same structure of the Step Point - const StepPointMC& hit = *iter; - // HITS in CALORIMETER VIRTUAL DETECTORS - if (hit.volumeId()VirtualDetectorId::EMC_Disk_1_EdgeOut) continue; - - double hitTime = fmod(hit.time(),_mbtime); - - if (hit.simParticle()->pdgId()==_VDPID && hitTime>(double) _T0MIN ){ - virtualhit_good=true; - break; - } - } - } - if (! virtualhit_good ) return false; - } - - // Check on track cluster matching - art::Handle trackClusterHandle; - event.getByLabel(_trackClusterMatchModuleLabel, trackClusterHandle); - TrackClusterMatchCollection const& trackClusterMatches(*trackClusterHandle); - - bool trk_good=false; - if (_trk_good ){ - for ( size_t itrk=0; itrk< trks.size(); ++itrk ){ - KalRep const* trk = trks.at(itrk).get(); - CLHEP::Hep3Vector mom = trk->momentum(0); - if ( (trk->helix(0).d0() > _D0MIN ) && - (trk->helix(0).d0() < _D0MAX ) && - (trk->helix(0).d0()+2./trk->helix(0).omega() > _RMAXMIN ) && - (trk->helix(0).d0()+2./trk->helix(0).omega() < _RMAXMAX ) && - (trk->t0().t0() > _T0MIN ) && - (trk->t0().t0() < _T0MAX ) && - (trk->helix(0).tanDip() > _TANDIPMIN ) && - (trk->helix(0).tanDip() < _TANDIPMAX ) && - (_tqcol->at(itrk).MVAOutput() > _MVAMIN ) && - (mom.mag() > _PMIN )){ - trk_good=true; - } - } - if (_diagLevel > 0) std::cout << "Tracks Number: " << trks.size() << " good?" << trk_good << endl; - if ( ! trk_good ) return false; - } - - bool match_good=false; - if (_match_good ){ - for (TrackClusterMatchCollection::const_iterator matchIt = trackClusterMatches.begin(); matchIt != trackClusterMatches.end(); ++matchIt){ - // good matching - if (matchIt->iex()<(int)trks.size() && matchIt->iex()>=0 ){ - KalRep const* trk = trks.at(matchIt->iex()).get(); - CLHEP::Hep3Vector mom = trk->momentum(0); - if (matchIt->icl()<_nCluster && matchIt->icl()>=0 ){ - _cluene= _cluEnergys[matchIt->icl()]; - if (_diagLevel > 0) std::cout << "Cluster energy=" << _cluene << " p=" << mom.mag() << " matchIt->dt()=" << matchIt->dt() << " _tqcol=" <<_tqcol->at(matchIt->iex()).MVAOutput() << endl; - if (mom.mag()>_PMATCHMIN && - _cluene>_ECLUMIN && - matchIt->dt()>_DTMIN && matchIt->dt()<_DTMAX && - matchIt->chi2()<_CHI2MATCHMIN && - _tqcol->at(matchIt->iex()).MVAOutput()>_MVAMIN){ - match_good=true; - break; - } - } - } - } - if (_diagLevel > 0) std::cout << "Matches Number: " << trackClusterMatches.size() << " good?" << match_good << endl; - if (! match_good ) return false; - } - return true; - - } - void EcalTriggerPreselect::endJob(){ - cout << "EcalTriggerPreselect filter end job:" << _nProcessed << " events processed" << endl; - } - -} - -using mu2e::EcalTriggerPreselect; -DEFINE_ART_MODULE(EcalTriggerPreselect) diff --git a/CosmicReco/inc/DriftFitUtils.hh b/CosmicReco/inc/DriftFitUtils.hh index c768e9cada..1bc426c05b 100644 --- a/CosmicReco/inc/DriftFitUtils.hh +++ b/CosmicReco/inc/DriftFitUtils.hh @@ -18,16 +18,6 @@ #include "Offline/TrackerConditions/inc/StrawDrift.hh" //Utilities: #include "Offline/Mu2eUtilities/inc/ParametricFit.hh" -//For Drift: -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BbrGeom/Trajectory.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" using namespace mu2e; diff --git a/CosmicReco/inc/MinuitDriftFitter.hh b/CosmicReco/inc/MinuitDriftFitter.hh index 6f43a62524..5de89dd71a 100644 --- a/CosmicReco/inc/MinuitDriftFitter.hh +++ b/CosmicReco/inc/MinuitDriftFitter.hh @@ -8,17 +8,6 @@ #include "Offline/TrackerConditions/inc/StrawDrift.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" -// For Drift: -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/BbrGeom/Trajectory.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - // ROOT #include "TF1.h" #include "TH1F.h" diff --git a/CosmicReco/src/CosmicTrackFinder_module.cc b/CosmicReco/src/CosmicTrackFinder_module.cc index dc277f7b22..75eea6c4fe 100644 --- a/CosmicReco/src/CosmicTrackFinder_module.cc +++ b/CosmicReco/src/CosmicTrackFinder_module.cc @@ -38,9 +38,6 @@ //For Drift: #include "Offline/TrkReco/inc/TrkFaceData.hh" -// Mu2e BaBar -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - //CLHEP: #include "CLHEP/Units/PhysicalConstants.h" #include "CLHEP/Matrix/Vector.h" diff --git a/CosmicReco/src/CosmicTrackFit.cc b/CosmicReco/src/CosmicTrackFit.cc index c7a34aef2a..525a080897 100644 --- a/CosmicReco/src/CosmicTrackFit.cc +++ b/CosmicReco/src/CosmicTrackFit.cc @@ -16,18 +16,6 @@ #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/RecoDataProducts/inc/TimeCluster.hh" -//For Drift: -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BbrGeom/Trajectory.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" - //Fitting #include "Offline/Mu2eUtilities/inc/ParametricFit.hh" #include "Offline/Mu2eUtilities/inc/BuildLinearFitMatrixSums.hh" diff --git a/CosmicReco/src/DriftFitUtils.cc b/CosmicReco/src/DriftFitUtils.cc index e450282ead..1169ff2c93 100644 --- a/CosmicReco/src/DriftFitUtils.cc +++ b/CosmicReco/src/DriftFitUtils.cc @@ -17,18 +17,6 @@ #include "Offline/TrackerConditions/inc/StrawDrift.hh" #include "Offline/CosmicReco/inc/DriftFitUtils.hh" -//For Drift: -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BbrGeom/Trajectory.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" - using namespace mu2e; double DriftFitUtils::GetTestDOCA(ComboHit const& chit, double a0, double a1, double b0, double b1, const Tracker* tracker) { diff --git a/CosmicReco/src/MinuitDriftFitter.cc b/CosmicReco/src/MinuitDriftFitter.cc index 903e57751c..773ae6135b 100644 --- a/CosmicReco/src/MinuitDriftFitter.cc +++ b/CosmicReco/src/MinuitDriftFitter.cc @@ -15,15 +15,6 @@ #include "Offline/TrackerGeom/inc/Tracker.hh" // For Drift: -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/BbrGeom/Trajectory.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" #include #include #include diff --git a/CosmicReco/src/PDFFit.cc b/CosmicReco/src/PDFFit.cc index b3116f7777..a4f7ca6727 100644 --- a/CosmicReco/src/PDFFit.cc +++ b/CosmicReco/src/PDFFit.cc @@ -11,17 +11,6 @@ #include #include -// For Drift: -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/HepPoint.h" -#include "BTrk/BbrGeom/Trajectory.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - // Tracker Details: #include "Offline/TrackerConditions/inc/StrawDrift.hh" #include "Offline/TrackerConditions/inc/StrawResponse.hh" From 6f95113afee47eb48be1422f88573dd5ec5d5cd2 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 16 Nov 2025 18:32:54 -0800 Subject: [PATCH 022/174] removed btrk from filters --- Filters/CMakeLists.txt | 18 -- Filters/src/ChooseTrackFilter_module.cc | 256 ------------------------ Filters/src/TrkPatRecFilter_module.cc | 101 ---------- 3 files changed, 375 deletions(-) delete mode 100644 Filters/src/ChooseTrackFilter_module.cc delete mode 100644 Filters/src/TrkPatRecFilter_module.cc diff --git a/Filters/CMakeLists.txt b/Filters/CMakeLists.txt index 36de3d5376..c93648e37d 100644 --- a/Filters/CMakeLists.txt +++ b/Filters/CMakeLists.txt @@ -14,17 +14,6 @@ cet_build_plugin(CaloShowerSimFilter art::module Offline::MCDataProducts ) -cet_build_plugin(ChooseTrackFilter art::module - REG_SOURCE src/ChooseTrackFilter_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts -) - cet_build_plugin(CompressPhysicalVolumes art::module REG_SOURCE src/CompressPhysicalVolumes_module.cc LIBRARIES REG @@ -255,13 +244,6 @@ cet_build_plugin(TriggerResultsFilter art::module Offline::Mu2eUtilities ) -cet_build_plugin(TrkPatRecFilter art::module - REG_SOURCE src/TrkPatRecFilter_module.cc - LIBRARIES REG - Offline::MCDataProducts - Offline::RecoDataProducts -) - cet_build_plugin(TrkQualFilter art::module REG_SOURCE src/TrkQualFilter_module.cc LIBRARIES REG diff --git a/Filters/src/ChooseTrackFilter_module.cc b/Filters/src/ChooseTrackFilter_module.cc deleted file mode 100644 index 54ad4bef92..0000000000 --- a/Filters/src/ChooseTrackFilter_module.cc +++ /dev/null @@ -1,256 +0,0 @@ -// -// A Filter module that reads back the hits, track, and calorimeter clusters. It reads in multiple collections under different track hypotheses -// -// Original author Robert Bernstein -// - -#include "CLHEP/Units/SystemOfUnits.h" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/HelixTraj.hh" - -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/GenId.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" - -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -#include "art/Framework/Core/EDFilter.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Principal/Selector.h" -#include "art/Framework/Principal/Provenance.h" -#include "cetlib_except/exception.h" -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -#include "canvas/Utilities/InputTag.h" - -#include "TDirectory.h" -#include "TNtuple.h" -#include "TTree.h" - -#include -#include -#include -#include -#include - - -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" - -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; -using CLHEP::keV; - - - -namespace mu2e { - - - class ChooseTrackFilter : public art::EDFilter { - - public: - - typedef art::Ptr StepPtr; - typedef std::vector StepPtrs; - typedef std::map HitMap; - - - - explicit ChooseTrackFilter(fhicl::ParameterSet const& pset); - virtual ~ChooseTrackFilter() { } - - - // This is called for each event. - virtual bool filter(art::Event& e); - - - - - - private: - - - - int _diagLevel; - int _nProcess; - - - std::vector _trkPatRecModuleLabel; - std::vector _instanceName; - std::vector _tpart; - std::vector _fdir; - - std::vector _tpartTemp; - std::vector _fdirTemp; - - - - int _evt,_run; - - - float _pmin; - float _pmax; - - }; - - - ChooseTrackFilter::ChooseTrackFilter(fhicl::ParameterSet const& pset) : - art::EDFilter{pset}, - _diagLevel(pset.get("diagLevel",0)), - _nProcess(0), - _trkPatRecModuleLabel(pset.get>("trkPatRecModuleLabel")), - _tpartTemp(pset.get>("fitparticle")), - _fdirTemp(pset.get>("fitdirection")), - _pmin(pset.get("pmin")), - _pmax(pset.get("pmax")) - - { - - std::cout << "constructing ChooseTrackFilter" << std::endl; - - // - // check these match or module is misconfigured. - if ( (_fdirTemp.size() != _tpartTemp.size()) || (_trkPatRecModuleLabel.size() != _tpartTemp.size()) || (_trkPatRecModuleLabel.size() != _tpartTemp.size())){ - throw cet::exception("RECO") <<"ChooseTrackFilter ctor: sizes of module label, fitparticle, and fitdirection differ" << std::endl; - } - - for (uint i = 0; i < _fdirTemp.size(); ++i){ - - // - //kluge until this gets cleaned up...not by me...sort of a giant kluge since what I want to do is deconstruct the module label - - - - if (_fdirTemp.at(i) == TrkFitDirection::downstream){ - _fdir.emplace_back(TrkFitDirection(TrkFitDirection::downstream));} - else if (_fdirTemp.at(i) == TrkFitDirection::upstream){ - _fdir.emplace_back(TrkFitDirection(TrkFitDirection::upstream));} - - - - if (_tpartTemp.at(i) == TrkParticle::e_minus){ - _tpart.emplace_back(TrkParticle::e_minus);} - else if (_tpartTemp.at(i) == TrkParticle::pi_minus){ - _tpart.emplace_back(TrkParticle(TrkParticle::pi_minus));} - else if (_tpartTemp.at(i) == TrkParticle::e_plus){ - _tpart.emplace_back(TrkParticle(TrkParticle::e_plus));} - else if (_tpartTemp.at(i) == TrkParticle::pi_plus){ - _tpart.emplace_back(TrkParticle(TrkParticle::pi_plus));} - else throw cet::exception("RECO") << "ChooseTrackFilterParticleType misconfigured" << std::endl; - } - - - - - for (uint i = 0; i < _fdir.size(); ++i){ - _instanceName.emplace_back(_fdir.at(i).name() + _tpart.at(i).name()); - if (_diagLevel > 0){ - std::cout << "ChooseTrackFilter ctor: element number " << i << " instance name " << _instanceName.at(i) << std::endl; - } - } - } - - bool ChooseTrackFilter::filter(art::Event& event) { - - ++_nProcess; - if (_nProcess%10==0 && _diagLevel > 0) std::cout <<"Processing event from ChooseTrackFilter = " <<_nProcess < kalRepHandle; - - if (_diagLevel > 1){ - std::cout << "ChooseTrackFilter filter : ithrep, trkPatRecModuleLabel = " << ithrep << " xx" << _trkPatRecModuleLabel.at(ithrep) - << "xx " << std::endl; - } - event.getByLabel(_trkPatRecModuleLabel.at(ithrep),_instanceName.at(ithrep),kalRepHandle); - - if (_diagLevel > 1 && !kalRepHandle.isValid() ){ - std::cout << "ChooseTrackFilter: invalid handle, loser! xx" << _trkPatRecModuleLabel.at(ithrep)<< "xx xx" << _instanceName.at(ithrep) - << "xx " << std::endl; - } - - if (kalRepHandle.isValid()){ - if (_diagLevel > 1){ - std::cout <<"ChooseTrackFilter: valid handle " << _trkPatRecModuleLabel.at(ithrep) << " " <<_instanceName.at(ithrep) << std::endl; - } - // - //bingo, found it. Do stuff. - const KalRepPtrCollection& kreps = *kalRepHandle; // the * dereferences the handle and gives ptrs; def'n of * for handles. - - for (auto const& krepPtr:kreps){ //looping over the collection and getting a ptr to each collection - - KalRep const& krep = *krepPtr; //derefencing the ptr - - // Arc length from center of tracker to the most upstream point on the fitted track. - double s0 = krep.startValidRange(); - - // Momentum and position at s0. - CLHEP::Hep3Vector p0 = krep.momentum(s0); - HepPoint pos0 = krep.position(s0); - - // Some other properties at s0. - double loclen(0.); - HepVector momvec(3); - momvec = p0.unit(); - - const TrkSimpTraj* ltraj = krep.localTrajectory(s0,loclen); - BbrVectorErr momCov = krep.momentumErr(s0); - double fitMomErr = sqrt(momCov.covMatrix().similarity(momvec)); - double tanDip = ltraj->parameters()->parameter()[HelixTraj::tanDipIndex]; - double omega = ltraj->parameters()->parameter()[HelixTraj::omegaIndex]; - double d0 = ltraj->parameters()->parameter()[HelixTraj::d0Index]; - double fitCon = krep.chisqConsistency().significanceLevel(); - double trkt0Err = krep.t0().t0Err(); - - // Does this fit pass cut set C? - cutC = - ( krep.fitStatus().success() >0 ) && - ( fitCon > 2.e-3 ) && - ( krep.nActive() >= 20 ) && - ( fitMomErr < 0.25 ) && - ( tanDip >= 0.577 && tanDip <= 1.0 ) && - ( krep.t0().t0() > 700 && krep.t0().t0() < 1695. ) && - ( d0 > -80. && d0 < 105. ) && - ( d0 + 2./omega > 450. && d0 + 2./omega < 680. ) && - ( trkt0Err < 0.9 ) && - ( p0.mag() > _pmin && p0.mag() < _pmax ) ; - - if (_diagLevel > 1) {std:: cout << "ChooseTrackFilter t0 = " << krep.t0().t0() << " and cut set C = " << cutC << std::endl;} - } - } - } - return (cutC); - } - - - -} // end namespace mu2e - -DEFINE_ART_MODULE(mu2e::ChooseTrackFilter) - - diff --git a/Filters/src/TrkPatRecFilter_module.cc b/Filters/src/TrkPatRecFilter_module.cc deleted file mode 100644 index d2fb308efc..0000000000 --- a/Filters/src/TrkPatRecFilter_module.cc +++ /dev/null @@ -1,101 +0,0 @@ -#include "CLHEP/Units/SystemOfUnits.h" -#include "art/Framework/Core/EDFilter.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" -#include "Offline/MCDataProducts/inc/StrawDigiMC.hh" -#include "fhiclcpp/ParameterSet.h" - -using namespace CLHEP; -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -#include -#include - -using namespace std; - -namespace mu2e -{ - class TrkPatRecFilter : public art::EDFilter - { - public: - explicit TrkPatRecFilter(fhicl::ParameterSet const& pset); - virtual ~TrkPatRecFilter() { } - virtual bool filter(art::Event& e); - - private: - std::vector _fitterModuleLabels; - std::vector _trkPatRecInstances; - double _minMomentum; - double _maxMomentum; - double _minCETime; // minimum time of CE - bool _reverse; // reverse the logic of the final decision - std::string _mcdigislabel; - int _minCEHits; // minimum number of true CE hits to require - }; - - TrkPatRecFilter::TrkPatRecFilter(fhicl::ParameterSet const& pset) : - art::EDFilter{pset}, - _fitterModuleLabels(pset.get >("fitterModuleLabels")), - _trkPatRecInstances(pset.get >("trkPatRecInstances")), - _minMomentum(pset.get("minMomentum", -1.0)), - _maxMomentum(pset.get("maxMomentum", 1.0e6)), - _minCETime(pset.get("minCETime", 550.0)), - _reverse(pset.get("ReverseTrackSelection",false)), - _mcdigislabel(pset.get("StrawHitMCLabel","makeSH")), - _minCEHits(pset.get("MinCEHits",-1)) - { - if(_fitterModuleLabels.size() != _trkPatRecInstances.size()) - { - throw cet::exception("G4CONTROL") - << "Sizes of fitterModuleLabels and trkPatRecInstances do not match.\n"; - } - } - - bool TrkPatRecFilter::filter(art::Event& event) - { - bool retval(false); - for(unsigned int i=0; i<_fitterModuleLabels.size(); i++) - { - art::Handle trksHandle; - if(event.getByLabel(_fitterModuleLabels[i],_trkPatRecInstances[i],trksHandle)) - { - KalRepPtrCollection const& kalReps = *trksHandle; - for(unsigned int j=0; jstartFoundRange(); - double fltLMax=kalrep->endFoundRange(); - double p1=kalrep->momentum(fltLMin).mag(); - double p2=kalrep->momentum(fltLMax).mag(); - if(p1/CLHEP::MeV<_minMomentum ) continue; - if(p2/CLHEP::MeV>_maxMomentum ) continue; - retval = true; - break; - } - } - } - } - if(_reverse) retval = !retval; - // check for MC truth - if(retval && _minCEHits > 0){ - int ncehits(0); - art::Handle mcdigisHandle; - if(event.getByLabel(_mcdigislabel,mcdigisHandle)){ - const StrawDigiMCCollection* mcdigis = mcdigisHandle.product(); - for(auto imcdigi = mcdigis->begin(); imcdigi != mcdigis->end(); ++imcdigi){ - if( imcdigi->wireEndTime(StrawEnd::cal) > _minCETime ) { - if(imcdigi->strawGasStep(StrawEnd::cal)->simParticle()->genParticle().isNonnull() && - imcdigi->strawGasStep(StrawEnd::cal)->simParticle()->genParticle()->generatorId().isConversion()) ++ncehits; - } - } - } - retval &= ncehits >= _minCEHits; - } - return(retval); - } -} - -DEFINE_ART_MODULE(mu2e::TrkPatRecFilter) From 6f64ff2158e3ff96112423dd08c309698fa77d99 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 16 Nov 2025 18:42:16 -0800 Subject: [PATCH 023/174] removed btrk from particleid --- ParticleID/CMakeLists.txt | 15 - ParticleID/src/ParticleIDRead_module.cc | 2 +- ParticleID/src/ParticleID_module.cc | 448 ------------------------ 3 files changed, 1 insertion(+), 464 deletions(-) delete mode 100644 ParticleID/src/ParticleID_module.cc diff --git a/ParticleID/CMakeLists.txt b/ParticleID/CMakeLists.txt index cd564dde56..ed1e2c08ef 100644 --- a/ParticleID/CMakeLists.txt +++ b/ParticleID/CMakeLists.txt @@ -10,21 +10,6 @@ cet_make_library( Offline::GeneralUtilities ) -cet_build_plugin(ParticleID art::module - REG_SOURCE src/ParticleID_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::ParticleID - - Offline::BTrkData - Offline::ConditionsService - Offline::ConfigTools - Offline::GeometryService - Offline::ProditionsService - Offline::RecoDataProducts - Offline::TrackerConditions -) - cet_build_plugin(ParticleIDRead art::module REG_SOURCE src/ParticleIDRead_module.cc LIBRARIES REG diff --git a/ParticleID/src/ParticleIDRead_module.cc b/ParticleID/src/ParticleIDRead_module.cc index e7350d9c1d..b163242684 100644 --- a/ParticleID/src/ParticleIDRead_module.cc +++ b/ParticleID/src/ParticleIDRead_module.cc @@ -21,7 +21,7 @@ #include "Offline/RecoDataProducts/inc/PIDProduct.hh" -#include "BTrk/TrkBase/TrkParticle.hh" +#include "BTrkLegacy/inc/TrkParticle.hh" // mu2e tracking #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" diff --git a/ParticleID/src/ParticleID_module.cc b/ParticleID/src/ParticleID_module.cc deleted file mode 100644 index 6cabc7b908..0000000000 --- a/ParticleID/src/ParticleID_module.cc +++ /dev/null @@ -1,448 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// $Id: -// $Author: -// $Date: -// -// Original author Vadim Rusu -// -// 2015-01-23 P.Murat: default condiguration is stored in ParticleID/fcl/prolog.fcl -/////////////////////////////////////////////////////////////////////////////// -// C++ includes. -#include -#include -#include - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/Handle.h" -#include "art_root_io/TFileService.h" -#include "fhiclcpp/ParameterSet.h" - -//ROOTs -#include "TH1F.h" -#include "TTree.h" -#include "TNtuple.h" -#include "TF1.h" -#include "TGraphErrors.h" -#include "TMinuit.h" -#include "TFile.h" -#include "TApplication.h" -#include "TCanvas.h" -#include "TDirectory.h" -#include "TROOT.h" -#include "TStyle.h" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/PIDProduct.hh" - -#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" - -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" - -#include "Offline/ParticleID/inc/PIDUtilities.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -using namespace std; - -namespace mu2e { - -TGraphErrors *error; - - //compute sum of squares of residuals -void myfcn(Int_t &, Double_t *, Double_t &f, Double_t *par, Int_t) { - //minimisation function computing the sum of squares of residuals - Int_t np = error->GetN(); - f = 0; - Double_t *x = error->GetX(); - Double_t *y = error->GetY(); - Double_t *ey = error->GetEY(); - // Double_t *ey = error->GetEY(); - - for (Int_t i=0;ipathbounds[0] && d<=pathbounds[1]) return 0; - else if (d>pathbounds[1] && d<=pathbounds[2]) return 1; - else if (d>pathbounds[2] && d<=pathbounds[3]) return 2; - else if (d>pathbounds[3] && d<=pathbounds[4]) return 3; - else if (d>pathbounds[4] && d<=pathbounds[5]) return 4; - else if (d>pathbounds[5] && d<=pathbounds[6]) return 5; - else if (d>pathbounds[6] && d<=pathbounds[7]) return 6; - else if (d>pathbounds[7] && d<=pathbounds[8]) return 7; - else if (d>pathbounds[8] && d<=pathbounds[9]) return 8; - else if (d>pathbounds[9] && d<=pathbounds[10]) return 9; - else if (d>pathbounds[10]) return 10; - - else - { cout<<"Out of bounds. Should never end up here\n"; return -9999.;} - -} - - class ParticleID : public art::EDProducer { - - public: - explicit ParticleID(fhicl::ParameterSet const& pset); - virtual ~ParticleID() { } - void beginJob(); - void beginRun(art::Run &run); - void beginSubRun(art::SubRun & lblock ); - virtual void produce(art::Event& event); - void endJob(); - - private: - - PIDProduct _pid; - - int _processed_events; - int _evtid; - - std::string _fitterModuleLabel; - std::string _electronTemplateFile; - std::string _muonTemplateFile; - - ProditionsHandle _mu2eDetector_h; - - TrkParticle _tpart; - TrkFitDirection _fdir; - - int _trkid; - double _trkmom; - double _residualsSlope; - double _residualsSlopeError; - double _logeprob; - double _logmprob; - - int _debugLevel; - int _verbosity; - int _diagLevel; - bool _doDisplay; - - std::string _electrontemplates; - std::string _muontemplates; - - TH1D* _heletemp[nbounds]; - TH1D* _hmuotemp[nbounds]; - - int _templatesnbins ; - float _templateslastbin ; - float _templatesbinsize ; - - TTree * _pidtree; - TCanvas* _plotCanvas; - - bool calculateSlope(std::vectorvresd,std::vectorvflt, - std::vectorevresd,std::vectorevflt, - double * slope, - double * eslope); - - double calculateProb(std::vectorgaspaths, std::vectoredeps, TH1D** templates); - - unique_ptr _application; - - // Save directory from beginJob so that we can go there in endJob. - TDirectory* _directory; - }; - - ParticleID::ParticleID(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _fitterModuleLabel (pset.get("fitterModuleLabel")), - _electronTemplateFile(pset.get("ElectronTemplates")), - _muonTemplateFile (pset.get("MuonTemplates" )), - _tpart ((TrkParticle::type) (pset.get("fitparticle" ))), - _fdir ((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - _debugLevel(pset.get("debugLevel", 0 )), - _verbosity(pset.get ("verbosity" , 0 )), - _diagLevel(pset.get ("diagLevel" , 0 )), - _doDisplay(pset.get("doDisplay" ,false)), - _pidtree(0), - _plotCanvas(0) - { - _processed_events = -1; - - produces(); - - // location-independent files - ConfigFileLookupPolicy configFile; - - _electrontemplates = configFile(_electronTemplateFile); - _muontemplates = configFile(_muonTemplateFile ); - - char name[50]; - TFile* electrontemplatefile = TFile::Open(_electrontemplates.c_str()); - for (int i = 0; i < nbounds; i++){ - sprintf(name,"htempe%d",i); - electrontemplatefile->GetObject(name,_heletemp[i]); - } - - TFile* muontemplatefile = TFile::Open(_muontemplates.c_str()); - for (int i = 0; i < nbounds; i++){ - sprintf(name,"htempm%d",i); - muontemplatefile->GetObject(name,_hmuotemp[i]); - } - - _templatesnbins = _heletemp[0]->GetNbinsX(); - _templateslastbin = _heletemp[0]->GetBinLowEdge(_templatesnbins)+_heletemp[0]->GetBinWidth(1); - _templatesbinsize = _heletemp[0]->GetBinWidth(1); - - } - - void ParticleID::beginJob(){ - - // histograms - - art::ServiceHandle tfs; - - if (_diagLevel) { - _pidtree = tfs->make("PID", "PID info"); - _pidtree->Branch("trkid" , &_trkid , "trkid/I"); - _pidtree->Branch("slope" , &_residualsSlope , "slope/D"); - _pidtree->Branch("errslope", &_residualsSlopeError, "errslope/D"); - _pidtree->Branch("p" , &_trkmom , "trkmom/D"); - _pidtree->Branch("logeprob", &_logeprob , "logeprob/D"); - _pidtree->Branch("logmprob", &_logmprob , "logmprob/D"); - } - - if(_doDisplay) { - // If needed, create the ROOT interactive environment. See note 1. - if ( !gApplication ){ - int tmp_argc(0); - char** tmp_argv(0); - _application = unique_ptr(new TApplication( "noapplication", &tmp_argc, tmp_argv )); - } - - gStyle->SetPalette(1); - gROOT->SetStyle("Plain"); - gStyle->SetOptFit(1); - gStyle->SetMarkerStyle(22); - - _plotCanvas = new TCanvas("plots","PID Plots",600,400); - } - } - - void ParticleID::beginRun(art::Run & run){ - if (_verbosity>=2) cout << "ParticleID: From beginRun: " << run.id().run() << endl; - - } - - void ParticleID::beginSubRun(art::SubRun & lblock ) { - if (_verbosity>=2) cout << "ParticleID: From beginSubRun. " << endl; - } - - void ParticleID::endJob(){ - if (_verbosity>=2) cout << "ParticleID: From endJob. " << endl; - if (_doDisplay) delete _plotCanvas; - - } - -////////// Produce /////////// - - void ParticleID::produce(art::Event& event) { - - auto detmodel = _mu2eDetector_h.getPtr(event.id()); - - _evtid = event.id().event(); - ++_processed_events; - if (_processed_events%100 == 0) { - if (_verbosity>=1) cout << "ParticleID: processing " << _processed_events << "-th event at evtid=" << _evtid << endl; - } - if (_verbosity>=2) cout << "ParticleID: processing " << _processed_events << "-th event at evtid=" << _evtid << endl; - - unique_ptr pids(new PIDProductCollection ); - - art::Handle trksHandle; - event.getByLabel(_fitterModuleLabel,trksHandle); - const KalRepPtrCollection* const trks = trksHandle.product(); - - if (!trksHandle.isValid()) { - if (_verbosity>=1) cout << "ParticleID : " << "no" << " obj for " << _fitterModuleLabel.c_str() << " of event " << _evtid << endl; - } - - if (trks->size() >0) { - if (_verbosity>=1) cout << "ParticleID : " << trks->size() << " obj for " << _fitterModuleLabel.c_str() << " of event " << _evtid << endl; - } - - for ( size_t i=0; i< trks->size(); ++i ){ - - _trkid = i; - const KalRep* krep = trks->at(i).get(); - - double firsthitfltlen = krep->firstHit()->kalHit()->hit()->fltLen() - 10; - double lasthitfltlen = krep->lastHit()->kalHit()->hit()->fltLen() - 10; - double entlen = std::min(firsthitfltlen,lasthitfltlen); - _trkmom = krep->momentum(entlen).mag(); - - std::vector kalsites= krep->siteList(); - - std::vector vresd; - std::vector vflt; - std::vector evflt; - std::vector evresd; - std::vector gaspaths; - std::vector edeps; - - for(unsigned isite=0;isitetype() == KalSite::hitSite){ - - TrkStrawHit* hit = dynamic_cast(ksite->kalHit()->hit()); - double resid, residerr; - hit->resid(resid,residerr,true); - - bool activehit = hit->isActive(); - if (activehit){ - double aresd = (hit->poca().doca()>0?resid:-resid); - double normflt = hit->fltLen() - krep->flt0(); - double normresd = aresd/residerr; - - vresd.push_back(normresd); - vflt.push_back(normflt); - evresd.push_back(1.); - evflt.push_back(0.1); - - // 2. * here because KalmanFit reports half the path through gas. - const DetStrawElem* strawelem = detmodel->strawElem(hit->straw()); - gaspaths.push_back(2. * strawelem->gasPath(hit->driftRadius(),hit->trkTraj()->direction( hit->fltLen() ))); - - edeps.push_back(hit->comboHit().energyDep()); - - } - } - } - - calculateSlope(vresd,vflt,evresd,evflt,&_residualsSlope,&_residualsSlopeError); - - double eprob = calculateProb(gaspaths, edeps, _heletemp); - double muprob = calculateProb(gaspaths, edeps, _hmuotemp); - - _logeprob = log(eprob); - _logmprob = log(muprob); - - if(_diagLevel) - _pidtree->Fill(); - - _pid.clear(); - _pid.SetTrkID(_trkid); - _pid.SetResidualsSlope(_residualsSlope); - _pid.SetResidualsSlopeError(_residualsSlopeError); - _pid.SetLogEProb(_logeprob); - _pid.SetLogMProb(_logmprob); - - pids->push_back(_pid); - - } // end of trks loop - event.put(std::move(pids)); - - } - - double ParticleID::calculateProb(std::vectorgaspaths, std::vectoredeps, TH1D** templates){ - - static const double _minpath = 0.5; - static const double _maxpath = 10.; - - double thisprob = 1; - - for (unsigned int ipath = 0; ipath < gaspaths.size(); ipath++){ - double thispath = gaspaths.at(ipath); - double thisedep = edeps.at(ipath); - - double tmpprob = 0; - if (thispath > _minpath && thispath<=_maxpath){ - int lowhist = findlowhist(thispath); - - PIDUtilities util; - TH1D* hinterp = util.th1dmorph(templates[lowhist],templates[lowhist+1],pathbounds[lowhist],pathbounds[lowhist+1],thispath,1,0); - //what is the probability for this edep - int thisedepbin = -999; - if (thisedep > _templateslastbin) thisedepbin = _templatesnbins; - else - thisedepbin = int(thisedep/_templatesbinsize)+1; - - tmpprob=hinterp->GetBinContent(thisedepbin); - - if (_doDisplay){ - templates[lowhist]->Draw(); - templates[lowhist+1]->Draw("same"); - hinterp->SetLineColor(2); - hinterp->Draw("same"); - _plotCanvas->WaitPrimitive(); - } - hinterp->Delete(); - } - - if (tmpprob> 0) - thisprob = thisprob * tmpprob; - - } - - return thisprob; - - } - - bool ParticleID::calculateSlope(std::vectorvresd,std::vectorvflt,std::vectorevresd,std::vectorevflt, double * slope, double * eslope) { - - error = new TGraphErrors(vresd.size(),vflt.data(),vresd.data(),evflt.data(),evresd.data()); - - TMinuit *gmMinuit = new TMinuit(2); - gmMinuit->SetPrintLevel(-1); - gmMinuit->SetFCN(myfcn); - const int dim(2); - const char par_name[dim][20]={"offset","slope"}; - static Double_t step[dim] = {0.001,0.001}; - Double_t sfpar[dim]={0.0,0.005}; - Double_t errsfpar[dim]={0.0,0.0}; - int ierflg = 0; - for (int ii = 0; iimnparm(ii,par_name[ii],sfpar[ii], step[ii], 0,0,ierflg); - } - gmMinuit->FixParameter(0); - gmMinuit->Migrad(); - bool converged = gmMinuit->fCstatu.Contains("CONVERGED"); - if (!converged) - { - cout <<"-----------TOF Linear fit did not converge---------------------------" <GetParameter(i,sfpar[i],errsfpar[i]); - } - - *slope = sfpar[1]; - *eslope = errsfpar[1]; - - if (_doDisplay){ - error->Draw("AP"); - _plotCanvas->WaitPrimitive(); - } - - delete error; - - return converged; - } - -} // end namespace mu2e - -using mu2e::ParticleID; -DEFINE_ART_MODULE(ParticleID) From 1a681cf0a28138ed8e157eb15acd6c50d431a7ce Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 24 Nov 2025 22:13:35 -0800 Subject: [PATCH 024/174] Removewd BTrk from Print, removed some references from EventDisplay, TrackerConditions, and RecoDataProducts --- BTrkData/inc/TrkStrawHit.hh | 2 +- BTrkLegacy/inc/TrkT0.hh | 16 +++ CMakeLists.txt | 1 + EventDisplay/src/DataInterface.cc | 15 +-- Print/CMakeLists.txt | 1 - Print/inc/KalRepPrinter.hh | 42 -------- Print/src/KalRepPrinter.cc | 117 --------------------- Print/src/PrintModule_module.cc | 8 +- RecoDataProducts/inc/CosmicTrackSeed.hh | 2 +- RecoDataProducts/inc/HelixSeed.hh | 2 +- RecoDataProducts/inc/HelixVal.hh | 2 +- RecoDataProducts/inc/HitT0.hh | 2 +- RecoDataProducts/inc/TimeCluster.hh | 2 +- RecoDataProducts/inc/TrackSummary.hh | 4 +- RecoDataProducts/inc/TrkCaloIntersect.hh | 1 - RecoDataProducts/inc/TrkCaloMatch.hh | 1 - RecoDataProducts/inc/TrkToCaloExtrapol.hh | 11 +- RecoDataProducts/src/TrackSummary.cc | 12 +-- RecoDataProducts/src/TrkToCaloExtrapol.cc | 11 +- TrackerConditions/src/Mu2eMaterialMaker.cc | 2 +- 20 files changed, 52 insertions(+), 202 deletions(-) create mode 100644 BTrkLegacy/inc/TrkT0.hh delete mode 100644 Print/inc/KalRepPrinter.hh delete mode 100644 Print/src/KalRepPrinter.cc diff --git a/BTrkData/inc/TrkStrawHit.hh b/BTrkData/inc/TrkStrawHit.hh index 681e4978d0..b9e45d2654 100644 --- a/BTrkData/inc/TrkStrawHit.hh +++ b/BTrkData/inc/TrkStrawHit.hh @@ -9,7 +9,7 @@ #include "BTrk/BbrGeom/TrkLineTraj.hh" #include "BTrk/TrkBase/TrkDifPieceTraj.hh" #include "BTrk/TrkBase/TrkHit.hh" -#include "BTrk/TrkBase/TrkT0.hh" +#include "Offline/BTrkLegacy/inc/TrkT0.hh" // Mu2e #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" diff --git a/BTrkLegacy/inc/TrkT0.hh b/BTrkLegacy/inc/TrkT0.hh new file mode 100644 index 0000000000..621f3d1bc1 --- /dev/null +++ b/BTrkLegacy/inc/TrkT0.hh @@ -0,0 +1,16 @@ +// struct to define t0 as an external parameter +#ifndef TrkT0_hh +#define TrkT0_hh + +// simple struct to put together t0 and t0 error +struct TrkT0 { + TrkT0(double t0, double t0err) : _t0(t0),_t0err(t0err){} + TrkT0() : _t0(0.0),_t0err(-1.0){} + double t0() const { return _t0; } + double t0Err() const { return _t0err; } + void setT0(double t0, double t0err) { _t0 = t0; _t0err = t0err; } + double _t0; // estimate of t0 value. Convention is implementation-specific + double _t0err; // estimate of t0 error +}; + +#endif \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c29badb003..b9353d4526 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,7 @@ add_subdirectory(Blinding) add_subdirectory(bin) add_subdirectory(boost_fix) add_subdirectory(BTrkData) +add_subdirectory(BTrkLegacy) add_subdirectory(CaloCluster) add_subdirectory(CaloConditions) add_subdirectory(CaloConfig) diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index a1cb6f7b7c..05123485bb 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -53,10 +53,10 @@ using namespace std; #include using namespace CLHEP; -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/BaBar/ExternalInfo.hh" +//#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" +//#include "Offline/BTrkData/inc/TrkStrawHit.hh" +//#include "BTrk/KalmanTrack/KalRep.hh" +#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" namespace mu2e_eventdisplay { @@ -911,7 +911,7 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS } } } - + /* const mu2e::KalRepCollection *kalRepHits=contentSelector->getSelectedHitCollection(); if(kalRepHits!=nullptr) { @@ -991,6 +991,7 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS } } + */ // KalSeed hits const mu2e::KalSeedCollection *kalSeedsWithHits=contentSelector->getSelectedHitCollection(); if(kalSeedsWithHits!=NULL) @@ -1271,7 +1272,7 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS _tracks.push_back(shape); } } - + /* trackInfos.clear(); std::vector kalRepCollectionVector=contentSelector->getSelectedTrackCollection(trackInfos); for(unsigned int i=0; i const &contentS info->setText(3,Form("t0 %gns d0 %gmm rmax %gmm",t0/CLHEP::ns,d0/CLHEP::mm,rmax/CLHEP::mm)); } } - + */ // KalSeed tracks trackInfos.clear(); std::vector kalSeedCollectionVector=contentSelector->getSelectedTrackCollection(trackInfos); diff --git a/Print/CMakeLists.txt b/Print/CMakeLists.txt index 58666ffe8d..babf4b557d 100644 --- a/Print/CMakeLists.txt +++ b/Print/CMakeLists.txt @@ -20,7 +20,6 @@ cet_make_library( src/EventWindowMarkerPrinter.cc src/GenParticlePrinter.cc src/HelixSeedPrinter.cc - src/KalRepPrinter.cc src/KalSeedPrinter.cc src/MCTrajectoryPrinter.cc src/PhysicalVolumePrinter.cc diff --git a/Print/inc/KalRepPrinter.hh b/Print/inc/KalRepPrinter.hh deleted file mode 100644 index 60d65ca940..0000000000 --- a/Print/inc/KalRepPrinter.hh +++ /dev/null @@ -1,42 +0,0 @@ -// -// Utility class to print KalRep -// -#ifndef Print_inc_KalRepPrinter_hh -#define Print_inc_KalRepPrinter_hh - -#include -#include - -#include "Offline/Print/inc/ProductPrinter.hh" -#include "Offline/Print/inc/TrackSummaryPrinter.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "art/Framework/Principal/Handle.h" -#include "canvas/Persistency/Common/Ptr.h" - -namespace mu2e { - -class KalRepPrinter : public ProductPrinter { - public: - KalRepPrinter() {} - KalRepPrinter(const Config& conf) : ProductPrinter(conf) {} - - // all the ways to request a printout - void Print(art::Event const& event, std::ostream& os = std::cout) override; - void Print(const art::Handle& handle, - std::ostream& os = std::cout); - void Print(const art::ValidHandle& handle, - std::ostream& os = std::cout); - void Print(const KalRepPtrCollection& coll, std::ostream& os = std::cout); - void Print(const art::Ptr& ptr, int ind = -1, - std::ostream& os = std::cout); - void Print(const KalRep& obj, int ind = -1, std::ostream& os = std::cout); - - void PrintHeader(const std::string& tag, std::ostream& os = std::cout); - void PrintListHeader(std::ostream& os = std::cout); - - private: - TrackSummaryPrinter _tsprinter; -}; - -} // namespace mu2e -#endif diff --git a/Print/src/KalRepPrinter.cc b/Print/src/KalRepPrinter.cc deleted file mode 100644 index 1dda0bd5e0..0000000000 --- a/Print/src/KalRepPrinter.cc +++ /dev/null @@ -1,117 +0,0 @@ - -#include "Offline/Print/inc/KalRepPrinter.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" -#include "Offline/Mu2eUtilities/inc/toHepPoint.hh" -#include "Offline/RecoDataProducts/inc/TrackSummary.hh" -#include "art/Framework/Principal/Provenance.h" - -#include - -void mu2e::KalRepPrinter::Print(art::Event const& event, std::ostream& os) { - if (verbose() < 1) return; - if (tags().empty()) { - // if a list of instances not specified, print all instances - std::vector > vah = - event.getMany(); - for (auto const& ah : vah) Print(ah); - } else { - // print requested instances - for (const auto& tag : tags()) { - auto ih = event.getValidHandle(tag); - Print(ih); - } - } -} - -void mu2e::KalRepPrinter::Print(const art::Handle& handle, - std::ostream& os) { - if (verbose() < 1) return; - // the product tags with all four fields, with underscores - std::string tag = handle.provenance()->productDescription().branchName(); - tag.pop_back(); // remove trailing dot - PrintHeader(tag, os); - Print(*handle); -} - -void mu2e::KalRepPrinter::Print( - const art::ValidHandle& handle, std::ostream& os) { - if (verbose() < 1) return; - // the product tags with all four fields, with underscores - std::string tag = handle.provenance()->productDescription().branchName(); - tag.pop_back(); // remove trailing dot - PrintHeader(tag, os); - Print(*handle); -} - -void mu2e::KalRepPrinter::Print(const KalRepPtrCollection& coll, - std::ostream& os) { - if (verbose() < 1) return; - os << "KalRepPtrCollection has " << coll.size() << " tracks\n"; - if (verbose() == 1) PrintListHeader(); - int i = 0; - for (const auto& obj : coll) Print(obj, i++); -} - -void mu2e::KalRepPrinter::Print(const art::Ptr& obj, int ind, - std::ostream& os) { - if (verbose() < 1) return; - Print(*obj, ind); -} - -void mu2e::KalRepPrinter::Print(const KalRep& obj, int ind, std::ostream& os) { - if (verbose() < 1) return; - - os << std::setiosflags(std::ios::fixed | std::ios::right); - if (ind >= 0) os << std::setw(4) << ind; - - // reuse code from TrackSummaryMaker - const KalRep* krep = &obj; - - GeomHandle det; - GeomHandle vdg; - if (!krep->fitCurrent()) { - os << " KalRep::fitCurrent() is false " << std::endl; - return; - } - TrackSummary sum(krep->fitStatus().success(), krep->charge(), krep->nActive(), - krep->nDof(), krep->chisq(), krep->t0().t0(), - krep->t0().t0Err(), krep->flt0()); - - CLHEP::Hep3Vector entpos = - det->toDetector(vdg->getGlobal(VirtualDetectorId::TT_FrontPA)); - double zent = entpos.z(); - double firsthitfltlen = krep->firstHit()->kalHit()->hit()->fltLen(); - double lasthitfltlen = krep->lastHit()->kalHit()->hit()->fltLen(); - double entlen = std::min(firsthitfltlen, lasthitfltlen); - if (!TrkHelixUtils::findZFltlen(krep->traj(), zent, entlen, 0.1)) { - throw cet::exception("RUNTIME") << "Error from findZFltlen()\n"; - } - - double loclen(0.0); - TrackSummary::HelixParams helix(*krep->localTrajectory(entlen, loclen)); - TrackSummary::TrackStateAtPoint st( - helix, fromHepPoint(krep->position(entlen)), krep->momentum(entlen), - krep->momentumErr(entlen).covMatrix(), krep->arrivalTime(entlen), entlen); - - sum.addState(st); - - _tsprinter.setVerbose(verbose()); - _tsprinter.Print(sum); -} - -void mu2e::KalRepPrinter::PrintHeader(const std::string& tag, - std::ostream& os) { - if (verbose() < 1) return; - os << "\nProductPrint " << tag << "\n"; -} - -void mu2e::KalRepPrinter::PrintListHeader(std::ostream& os) { - if (verbose() < 1) return; - _tsprinter.PrintListHeader(os); -} diff --git a/Print/src/PrintModule_module.cc b/Print/src/PrintModule_module.cc index 01fee939b6..10426bf5b4 100644 --- a/Print/src/PrintModule_module.cc +++ b/Print/src/PrintModule_module.cc @@ -25,7 +25,7 @@ #include "Offline/Print/inc/CrvStepPrinter.hh" #include "Offline/Print/inc/EventWindowMarkerPrinter.hh" #include "Offline/Print/inc/GenParticlePrinter.hh" -#include "Offline/Print/inc/KalRepPrinter.hh" +//#include "Offline/Print/inc/KalRepPrinter.hh" #include "Offline/Print/inc/KalSeedPrinter.hh" #include "Offline/Print/inc/MCTrajectoryPrinter.hh" #include "Offline/Print/inc/PhysicalVolumePrinter.hh" @@ -137,8 +137,8 @@ class PrintModule : public art::EDAnalyzer { fhicl::Name("trkCaloIntersectPrinter")}; fhicl::Table trackSummaryPrinter{ fhicl::Name("trackSummaryPrinter")}; - fhicl::Table kalRepPrinter{ - fhicl::Name("kalRepPrinter")}; + //fhicl::Table kalRepPrinter{ + // fhicl::Name("kalRepPrinter")}; fhicl::Table comboHitPrinter{ fhicl::Name("comboHitPrinter")}; fhicl::Table timeClusterPrinter{ @@ -241,7 +241,7 @@ mu2e::PrintModule::PrintModule(const Parameters& conf) : art::EDAnalyzer(conf), make_unique(conf().trkCaloIntersectPrinter())); _printers.push_back( make_unique(conf().trackSummaryPrinter())); - _printers.push_back(make_unique(conf().kalRepPrinter())); + //_printers.push_back(make_unique(conf().kalRepPrinter())); TODO: Check if OK _printers.push_back(make_unique(conf().comboHitPrinter())); _printers.push_back(make_unique(conf().timeClusterPrinter())); _printers.push_back(make_unique(conf().helixSeedPrinter())); diff --git a/RecoDataProducts/inc/CosmicTrackSeed.hh b/RecoDataProducts/inc/CosmicTrackSeed.hh index e64693792e..ceab3c4003 100644 --- a/RecoDataProducts/inc/CosmicTrackSeed.hh +++ b/RecoDataProducts/inc/CosmicTrackSeed.hh @@ -2,7 +2,7 @@ #define RecoDataProducts_CosmicTrackSeed_hh // Mu2e includes -#include "BTrk/TrkBase/TrkT0.hh" +#include "Offline/BTrkLegacy/inc/TrkT0.hh" #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/TrkStrawHitSeed.hh" #include "Offline/RecoDataProducts/inc/CosmicTrack.hh" diff --git a/RecoDataProducts/inc/HelixSeed.hh b/RecoDataProducts/inc/HelixSeed.hh index 7a7940452f..2c1567ca0c 100644 --- a/RecoDataProducts/inc/HelixSeed.hh +++ b/RecoDataProducts/inc/HelixSeed.hh @@ -6,7 +6,7 @@ // // Mu2e includes -#include "BTrk/TrkBase/TrkT0.hh" +#include "Offline/BTrkLegacy/inc/TrkT0.hh" #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/RobustHelix.hh" #include "Offline/RecoDataProducts/inc/TimeCluster.hh" diff --git a/RecoDataProducts/inc/HelixVal.hh b/RecoDataProducts/inc/HelixVal.hh index 0a8e2affd7..32032919cc 100644 --- a/RecoDataProducts/inc/HelixVal.hh +++ b/RecoDataProducts/inc/HelixVal.hh @@ -10,7 +10,7 @@ #include "Offline/DataProducts/inc/Helicity.hh" #include "Offline/DataProducts/inc/GenVector.hh" // BTrk -#include "BTrk/TrkBase/HelixParams.hh" +#include "Offline/BTrkLegacy/inc/HelixParams.hh" // CLHEP #include "CLHEP/Matrix/Vector.h" #include "CLHEP/Matrix/SymMatrix.h" diff --git a/RecoDataProducts/inc/HitT0.hh b/RecoDataProducts/inc/HitT0.hh index 23fda3f202..55deedfaa8 100644 --- a/RecoDataProducts/inc/HitT0.hh +++ b/RecoDataProducts/inc/HitT0.hh @@ -6,7 +6,7 @@ #ifndef RecoDataProducts_HitT0_HH #define RecoDataProducts_HitT0_HH #include -#include "BTrk/TrkBase/TrkT0.hh" +#include "Offline/BTrkLegacy/inc/TrkT0.hh" namespace mu2e { struct HitT0 { Float_t _t0; // t0 value diff --git a/RecoDataProducts/inc/TimeCluster.hh b/RecoDataProducts/inc/TimeCluster.hh index 1be8cbd2f4..628f86f178 100644 --- a/RecoDataProducts/inc/TimeCluster.hh +++ b/RecoDataProducts/inc/TimeCluster.hh @@ -14,7 +14,7 @@ #include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" #include "Offline/DataProducts/inc/GenVector.hh" // BTrk includes -#include "BTrk/TrkBase/TrkT0.hh" +#include "Offline/BTrkLegacy/inc/TrkT0.hh" // c++ #include namespace mu2e { diff --git a/RecoDataProducts/inc/TrackSummary.hh b/RecoDataProducts/inc/TrackSummary.hh index c11d9c294e..c3c1f65ae6 100644 --- a/RecoDataProducts/inc/TrackSummary.hh +++ b/RecoDataProducts/inc/TrackSummary.hh @@ -18,7 +18,7 @@ namespace mu2e { class TrackSummary { public: - + //================================================================ class HelixParams { public: @@ -54,7 +54,7 @@ namespace mu2e { double tanDip_; CLHEP::HepSymMatrix covariance_; }; - + //================================================================ class TrackStateAtPoint { public: diff --git a/RecoDataProducts/inc/TrkCaloIntersect.hh b/RecoDataProducts/inc/TrkCaloIntersect.hh index 0e51435deb..7a99328418 100644 --- a/RecoDataProducts/inc/TrkCaloIntersect.hh +++ b/RecoDataProducts/inc/TrkCaloIntersect.hh @@ -15,7 +15,6 @@ //tracker includes -#include "BTrk/KalmanTrack/KalRep.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" diff --git a/RecoDataProducts/inc/TrkCaloMatch.hh b/RecoDataProducts/inc/TrkCaloMatch.hh index 33ef152c0a..1cd7102bce 100644 --- a/RecoDataProducts/inc/TrkCaloMatch.hh +++ b/RecoDataProducts/inc/TrkCaloMatch.hh @@ -16,7 +16,6 @@ //tracker includes -#include "BTrk/KalmanTrack/KalRep.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/CaloCluster.hh" #include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" diff --git a/RecoDataProducts/inc/TrkToCaloExtrapol.hh b/RecoDataProducts/inc/TrkToCaloExtrapol.hh index 033d992696..22353407a6 100644 --- a/RecoDataProducts/inc/TrkToCaloExtrapol.hh +++ b/RecoDataProducts/inc/TrkToCaloExtrapol.hh @@ -15,7 +15,6 @@ #include "CLHEP/Matrix/Vector.h" #include "CLHEP/Vector/TwoVector.h" #include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" #include "CLHEP/Units/PhysicalConstants.h" #include "CLHEP/Matrix/SymMatrix.h" #include "BTrk/BbrGeom/BbrVectorErr.hh" @@ -23,12 +22,6 @@ #include "BTrk/BbrGeom/BbrLorentzVectorErr.hh" //tracker includes -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalHit.hh" - -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" // C++ includes @@ -83,9 +76,9 @@ namespace mu2e { double tOriginErr() const; CLHEP::Hep3Vector entranceMomentum() const; BbrVectorErr entranceMomentumErr() const; - HepPoint entrancePosition() const; + //HepPoint entrancePosition() const; #TODO: Check if can delete BbrPointErr entrancePositionErr() const; - HepPoint exitPosition() const; + //HepPoint exitPosition() const; BbrPointErr exitPositionErr() const; CLHEP::Hep3Vector momentum() const; BbrVectorErr momentumErr() const; diff --git a/RecoDataProducts/src/TrackSummary.cc b/RecoDataProducts/src/TrackSummary.cc index 6ac79dc306..2430aa5b5f 100644 --- a/RecoDataProducts/src/TrackSummary.cc +++ b/RecoDataProducts/src/TrackSummary.cc @@ -8,11 +8,11 @@ // BaBar #include "BTrk/BaBar/BaBar.hh" -#include "BTrk/TrkBase/HelixTraj.hh" +//#include "BTrk/TrkBase/HelixTraj.hh" #include "BTrk/ProbTools/ChisqConsistency.hh" -namespace mu2e { - +namespace mu2e { + /* TODO: Delete if OK. Also check if can use BTrkLegacy HelixParams to substitute TrackSummary::HelixParams::HelixParams(const TrkSimpTraj& ltraj) : d0_(ltraj.parameters()->parameter()[d0Index]) , phi0_(ltraj.parameters()->parameter()[phi0Index]) @@ -21,7 +21,7 @@ namespace mu2e { , tanDip_(ltraj.parameters()->parameter()[tanDipIndex]) , covariance_(ltraj.parameters()->covariance()) {} - + */ double TrackSummary::HelixParams::radius() const { // can check for division by zero here return 1./omega_; @@ -35,12 +35,12 @@ namespace mu2e { static const double pi = 4.*atan(1.); // M_PI is not in the standard return 2 * pi * radius() * tanDip_; } - + double TrackSummary::fitcon() const { ChisqConsistency cs(chi2(), ndof()); return cs.significanceLevel(); } - + void TrackSummary::addState(const TrackSummary::TrackStateAtPoint& st) { states_.emplace_back(st); } diff --git a/RecoDataProducts/src/TrkToCaloExtrapol.cc b/RecoDataProducts/src/TrkToCaloExtrapol.cc index 4ca4d5dec8..77532ef29d 100644 --- a/RecoDataProducts/src/TrkToCaloExtrapol.cc +++ b/RecoDataProducts/src/TrkToCaloExtrapol.cc @@ -15,8 +15,8 @@ // #include "BTrk/BaBar/BaBar.hh" -// #include "BTrk/TrkBase/HelixParams.hh" -// #include "BTrk/TrkBase/HelixTraj.hh" +#include "Offline/BTrkLegacy/inc/HelixParams.hh" +#include "Offline/BTrkLegacy/inc/HelixTraj.hh" using namespace std; @@ -145,18 +145,19 @@ namespace mu2e { double TrkToCaloExtrapol::fitConsistency() const{ return _trk->chisqConsistency().consistency(); } - + /* HepPoint TrkToCaloExtrapol::entrancePosition() const{ return _trk->position(_pathLengthEntrance); } - + */ BbrPointErr TrkToCaloExtrapol::entrancePositionErr() const{ return _trk->positionErr(_pathLengthEntrance); } - + /* HepPoint TrkToCaloExtrapol::exitPosition() const{ return _trk->position(_pathLengthExit); } + */ BbrPointErr TrkToCaloExtrapol::exitPositionErr() const{ return _trk->positionErr(_pathLengthExit); diff --git a/TrackerConditions/src/Mu2eMaterialMaker.cc b/TrackerConditions/src/Mu2eMaterialMaker.cc index cc0256640e..16469298d5 100644 --- a/TrackerConditions/src/Mu2eMaterialMaker.cc +++ b/TrackerConditions/src/Mu2eMaterialMaker.cc @@ -3,7 +3,7 @@ #include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" #include "Offline/TrackerConditions/inc/Mu2eMaterialMaker.hh" -#include "BTrk/BaBar/ExternalInfo.hh" +#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" using namespace std; From 88791ff55c2f4dfc790e6cbf1cb634b5638ba3b2 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 4 Dec 2025 22:36:49 -0800 Subject: [PATCH 025/174] removed uneeded trackerconditions files. Running into weird issue with removing Mu2eBTrk from CMakeLists: --- BTrkLegacy/inc/ParticleInfo.hh | 58 +++++++++++++++ ProditionsService/src/ProditionsService.cc | 10 ++- TrackerConditions/CMakeLists.txt | 5 -- TrackerConditions/inc/Mu2eDetector.hh | 48 ------------- TrackerConditions/inc/Mu2eDetectorCache.hh | 63 ---------------- TrackerConditions/inc/Mu2eDetectorMaker.hh | 29 -------- TrackerConditions/inc/Mu2eMaterial.hh | 54 -------------- TrackerConditions/inc/Mu2eMaterialCache.hh | 44 ------------ TrackerConditions/inc/Mu2eMaterialMaker.hh | 29 -------- TrackerConditions/src/Mu2eDetector.cc | 35 --------- TrackerConditions/src/Mu2eDetectorMaker.cc | 46 ------------ TrackerConditions/src/Mu2eMaterial.cc | 23 ------ TrackerConditions/src/Mu2eMaterialMaker.cc | 83 ---------------------- 13 files changed, 62 insertions(+), 465 deletions(-) create mode 100644 BTrkLegacy/inc/ParticleInfo.hh delete mode 100644 TrackerConditions/inc/Mu2eDetector.hh delete mode 100644 TrackerConditions/inc/Mu2eDetectorCache.hh delete mode 100644 TrackerConditions/inc/Mu2eDetectorMaker.hh delete mode 100644 TrackerConditions/inc/Mu2eMaterial.hh delete mode 100644 TrackerConditions/inc/Mu2eMaterialCache.hh delete mode 100644 TrackerConditions/inc/Mu2eMaterialMaker.hh delete mode 100644 TrackerConditions/src/Mu2eDetector.cc delete mode 100644 TrackerConditions/src/Mu2eDetectorMaker.cc delete mode 100644 TrackerConditions/src/Mu2eMaterial.cc delete mode 100644 TrackerConditions/src/Mu2eMaterialMaker.cc diff --git a/BTrkLegacy/inc/ParticleInfo.hh b/BTrkLegacy/inc/ParticleInfo.hh new file mode 100644 index 0000000000..89eed26fca --- /dev/null +++ b/BTrkLegacy/inc/ParticleInfo.hh @@ -0,0 +1,58 @@ +#ifndef BTrkHelper_ParticleInfo_hh +#define BTrkHelper_ParticleInfo_hh + +// +// Supply information about particles to the btrk code. +// - btrk code makes calls indexed by TrkParicle::type. +// - PDT is indexed by PDGCode::type +// This code looks after the translation and caches results. +// + +#include "Offline/GlobalConstantsService/inc/ParticleData.hh" + +#include "Offline/BTrkLegacy/inc/ParticleInfoInterface.hh" + +#include +#include + +namespace mu2e { + + class ParticleDataList; + + class ParticleInfo : public ParticleInfoInterface { + + public: + + ParticleInfo(); + + double mass ( TrkParticle::type id ) const override { + return getParticle(id)->mass(); + } + + double charge( TrkParticle::type id ) const override { + return getParticle(id)->charge(); + } + + std::string name ( TrkParticle::type id ) const override { + return getParticle(id)->name(); + } + + private: + + //the following has to be mutable because BTrk holds this + //with a const pointer + + // Guaranteed valid throughout the job. + ParticleDataList const& pdt_; + + // Local cache of the information for particles that we care about; + // indexed by TrkParticle::type, not by PDG::id. + mutable std::map table_; + + // Find particle data in the local cache; fault to the full cache as needed. + ParticleData const* getParticle( TrkParticle::type ) const; + + }; +} + +#endif /* btrkHelper_ParticleInfo_hh */ diff --git a/ProditionsService/src/ProditionsService.cc b/ProditionsService/src/ProditionsService.cc index e2ee9dadda..17932ebce9 100644 --- a/ProditionsService/src/ProditionsService.cc +++ b/ProditionsService/src/ProditionsService.cc @@ -22,8 +22,6 @@ #include "Offline/TrackerConditions/inc/AlignedTrackerCache.hh" #include "Offline/TrackerConditions/inc/FullReadoutStrawCache.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetectorCache.hh" -#include "Offline/TrackerConditions/inc/Mu2eMaterialCache.hh" #include "Offline/TrackerConditions/inc/StrawDriftCache.hh" #include "Offline/TrackerConditions/inc/StrawElectronicsCache.hh" #include "Offline/TrackerConditions/inc/StrawPhysicsCache.hh" @@ -87,10 +85,10 @@ ProditionsService::ProditionsService(Parameters const& sTable, auto atcs = std::make_shared(_config.alignedTrackerSim()); _caches[atcs->name()+"Sim"] = atcs; - auto mmc = std::make_shared(_config.mu2eMaterial()); - _caches[mmc->name()] = mmc; - auto mdc = std::make_shared(_config.mu2eDetector()); - _caches[mdc->name()] = mdc; + //auto mmc = std::make_shared(_config.mu2eMaterial()); + //_caches[mmc->name()] = mmc; + //auto mdc = std::make_shared(_config.mu2eDetector()); + //_caches[mdc->name()] = mdc; auto cdc = std::make_shared(_config.caloDAQConditions()); _caches[cdc->name()] = cdc; diff --git a/TrackerConditions/CMakeLists.txt b/TrackerConditions/CMakeLists.txt index 6ae6595fd8..4df817bc92 100644 --- a/TrackerConditions/CMakeLists.txt +++ b/TrackerConditions/CMakeLists.txt @@ -4,10 +4,6 @@ cet_make_library( src/DriftInfo.cc src/FullReadoutStraw.cc src/FullReadoutStrawMaker.cc - src/Mu2eDetector.cc - src/Mu2eDetectorMaker.cc - src/Mu2eMaterial.cc - src/Mu2eMaterialMaker.cc src/StrawDrift.cc src/StrawDriftMaker.cc src/StrawElectronics.cc @@ -29,7 +25,6 @@ cet_make_library( Offline::DbTables Offline::GeneralUtilities Offline::GeometryService - Offline::Mu2eBTrk Offline::Mu2eInterfaces Offline::ProditionsService Offline::TrackerConfig diff --git a/TrackerConditions/inc/Mu2eDetector.hh b/TrackerConditions/inc/Mu2eDetector.hh deleted file mode 100644 index 84dafd48a0..0000000000 --- a/TrackerConditions/inc/Mu2eDetector.hh +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef TrackerConditions_Mu2eDetector_hh -#define TrackerConditions_Mu2eDetector_hh -// -// This holds the straw geometry as a set of -// DetStrawElem, which is the format needed by BTrk. -// DetStrawElem has a pointer to a DetStrawType, -// which describes the material in a format BTrk needs, and -// a pointer to a Straw, including aligned wire geometry. -// Initialized with Mu2eDetectorMaker -// - -#include "Offline/Mu2eInterfaces/inc/ProditionsEntity.hh" -#include "Offline/TrackerGeom/inc/Straw.hh" -#include "Offline/Mu2eBTrk/inc/DetStrawElem.hh" -#include -#include - -namespace mu2e { - - class Mu2eDetector : public ProditionsEntity { - - public: - - typedef std::shared_ptr ptr_t; - typedef std::shared_ptr cptr_t; - friend class Mu2eDetectorMaker; - constexpr static const char* cxname = {"Mu2eDetector"}; - - Mu2eDetector(): ProditionsEntity(cxname) {} - virtual ~Mu2eDetector(); - - const DetStrawElem* strawElem(Straw const& straw) const { - return strawElem(straw.id()); - } - const DetStrawElem* strawElem(StrawId const& strawid) const; - - void print( std::ostream& ) const; - - private: - - // map between straw index and detector elements - std::map _strawmap; - - }; - -} // namespace mu2e - -#endif /* TrackerConditions_Mu2eDetector_hh */ diff --git a/TrackerConditions/inc/Mu2eDetectorCache.hh b/TrackerConditions/inc/Mu2eDetectorCache.hh deleted file mode 100644 index e0cf7bda3b..0000000000 --- a/TrackerConditions/inc/Mu2eDetectorCache.hh +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef TrackerConditions_Mu2eDetectorCache_hh -#define TrackerConditions_Mu2eDetectorCache_hh - -// -// hold a set of run-dependent conditions objects -// and update them when needed -// - -#include "Offline/Mu2eInterfaces/inc/ProditionsCache.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetectorMaker.hh" -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" - -namespace mu2e { - class Mu2eDetectorCache : public ProditionsCache { - public: - Mu2eDetectorCache(Mu2eDetectorConfig const& config): - ProditionsCache(Mu2eDetector::cxname,config.verbose()), - _useDb(config.useDb()),_maker(config) {} - - - void initialize() { - _mu2eMaterial_p = std::make_unique >(); - _alignedDetector_p = std::make_unique >(); - } - - set_t makeSet(art::EventID const& eid) { - auto mm = _mu2eMaterial_p->getPtr(eid); - auto tr = _alignedDetector_p->getPtr(eid); - // this is the set of DB cid's they depend on - ProditionsEntity::set_t ss; - ss.merge(set_t(mm->getCids())); - ss.merge(set_t(tr->getCids())); - return ss; - } - - DbIoV makeIov(art::EventID const& eid) { - _mu2eMaterial_p->get(eid); // check up to date - _alignedDetector_p->get(eid); - auto iov = _mu2eMaterial_p->iov(); - iov.overlap(_alignedDetector_p->iov()); - return iov; - } - - ProditionsEntity::ptr makeEntity(art::EventID const& eid) { - auto mm = _mu2eMaterial_p->getPtr(eid); - auto tr = _alignedDetector_p->getPtr(eid); - return _maker.fromFcl(mm,tr); - } - - private: - bool _useDb; - Mu2eDetectorMaker _maker; - - // this handle is not default constructed - // so to not create a dependency loop on construction - std::unique_ptr > _mu2eMaterial_p; - std::unique_ptr > _alignedDetector_p; - - }; -} - -#endif diff --git a/TrackerConditions/inc/Mu2eDetectorMaker.hh b/TrackerConditions/inc/Mu2eDetectorMaker.hh deleted file mode 100644 index 1e788d2319..0000000000 --- a/TrackerConditions/inc/Mu2eDetectorMaker.hh +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef TrackerConditions_Mu2eDetectorMaker_hh -#define TrackerConditions_Mu2eDetectorMaker_hh -// -// Make Mu2eDetector from fcl or (eventually) database -// - -#include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" -#include "Offline/TrackerConfig/inc/Mu2eDetectorConfig.hh" - -namespace mu2e { - class Mu2eDetectorMaker { - - public: - Mu2eDetectorMaker(Mu2eDetectorConfig const& config):_config(config) {} - Mu2eDetector::ptr_t fromFcl(Mu2eMaterial::cptr_t material, - Tracker::cptr_t det); - - private: - - // this object needs to be thread safe, - // _config should only be initialized once - const Mu2eDetectorConfig _config; - }; - - -} // namespace mu2e - -#endif /* TrackerConditions_Mu2eDetectorMaker_hh */ diff --git a/TrackerConditions/inc/Mu2eMaterial.hh b/TrackerConditions/inc/Mu2eMaterial.hh deleted file mode 100644 index e76f9d7bc2..0000000000 --- a/TrackerConditions/inc/Mu2eMaterial.hh +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef TrackerConditions_Mu2eMaterial_hh -#define TrackerConditions_Mu2eMaterial_hh -// -// This holds pointers to BTrk objects that -// describe materails that BTrk will use. -// BTrk has singletons and to reflect that, there -// is only ever one instance of this service entity. -// Initialized with Mu2eMaterialMaker -// - -#include "Offline/Mu2eInterfaces/inc/ProditionsEntity.hh" -#include "Offline/Mu2eBTrk/inc/FileFinder.hh" -#include "Offline/Mu2eBTrk/inc/ParticleInfo.hh" -#include "Offline/Mu2eBTrk/inc/DetStrawType.hh" -#include "BTrk/MatEnv/MatDBInfo.hh" -#include - -namespace mu2e { - - class Mu2eMaterial : public ProditionsEntity { - - public: - - typedef std::shared_ptr ptr_t; - typedef std::shared_ptr cptr_t; - friend class Mu2eMaterialMaker; - constexpr static const char* cxname = {"Mu2eMaterial"}; - - Mu2eMaterial():ProditionsEntity(cxname) {} - virtual ~Mu2eMaterial() {} - - DetStrawType const* strawType() const { return _strawtype.get(); } - - void print( std::ostream& ) const; - - private: - - // types for straw elements - std::unique_ptr _strawtype; // straw materials description - // materials - std::string _gasmatname, _wallmatname, _wirematname; - - // this hold pointers to material descriptions inside of - // BTrk material singleton - MatDBInfo _mat; - - std::unique_ptr _fileFinder; - std::unique_ptr _particleInfo; - - }; - -} // namespace mu2e - -#endif /* TrackerConditions_Mu2eMaterial_hh */ diff --git a/TrackerConditions/inc/Mu2eMaterialCache.hh b/TrackerConditions/inc/Mu2eMaterialCache.hh deleted file mode 100644 index 2aa8c71585..0000000000 --- a/TrackerConditions/inc/Mu2eMaterialCache.hh +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef TrackerConditions_Mu2eMaterialCache_hh -#define TrackerConditions_Mu2eMaterialCache_hh - -// -// This Proditions entitiy cache should only ever hold one -// because Mu2eMaterial has pointers to BTrk singletons -// - -#include "Offline/Mu2eInterfaces/inc/ProditionsCache.hh" -#include "Offline/TrackerConditions/inc/Mu2eMaterialMaker.hh" - - -namespace mu2e { - class Mu2eMaterialCache : public ProditionsCache { - public: - Mu2eMaterialCache(Mu2eMaterialConfig const& config): - ProditionsCache(Mu2eMaterial::cxname,config.verbose()), - _maker(config) { - // force a fake update so BTrk TrkParticle - // is working when modules are created - update(art::EventID(1,0,0)); - } - - void initialize() { - } - set_t makeSet(art::EventID const& eid) { - return ProditionsEntity::set_t(); - } - DbIoV makeIov(art::EventID const& eid) { - DbIoV iov; - iov.setMax(); // all runs - return iov; - } - ProditionsEntity::ptr makeEntity(art::EventID const& eid) { - return _maker.fromFcl(); - } - - private: - Mu2eMaterialMaker _maker; - - }; -} - -#endif diff --git a/TrackerConditions/inc/Mu2eMaterialMaker.hh b/TrackerConditions/inc/Mu2eMaterialMaker.hh deleted file mode 100644 index 26627e7e59..0000000000 --- a/TrackerConditions/inc/Mu2eMaterialMaker.hh +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef TrackerConditions_Mu2eMaterialMaker_hh -#define TrackerConditions_Mu2eMaterialMaker_hh -// -// Make Mu2eMaterial from fcl -// Since Mu2eMaterial holds pointers to singletons -// inside of BTrk, there should only ever be one made -// - -#include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" -#include "Offline/TrackerConfig/inc/Mu2eMaterialConfig.hh" - -namespace mu2e { - - class Mu2eMaterialMaker { - - public: - Mu2eMaterialMaker(Mu2eMaterialConfig const& config):_config(config) {} - Mu2eMaterial::ptr_t fromFcl(); - - private: - - // _config should only be initialized once - const Mu2eMaterialConfig _config; - }; - - -} // namespace mu2e - -#endif /* TrackerConditions_Mu2eMaterialMaker_hh */ diff --git a/TrackerConditions/src/Mu2eDetector.cc b/TrackerConditions/src/Mu2eDetector.cc deleted file mode 100644 index da97d785a0..0000000000 --- a/TrackerConditions/src/Mu2eDetector.cc +++ /dev/null @@ -1,35 +0,0 @@ - -#include - -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" -#include -#include "cetlib_except/exception.h" - -using namespace std; - -namespace mu2e { - - - const DetStrawElem* Mu2eDetector::strawElem(StrawId const& istraw) const{ - const DetStrawElem* retval(0); - auto ifnd = _strawmap.find(istraw); - if(ifnd != _strawmap.end()) - retval = ifnd->second; - else - throw cet::exception("RECO_NO_ELEMENT") - <<"mu2e::Mu2eDetector: no element associated to straw " - << istraw << std::endl; - return retval; - } - - Mu2eDetector::~Mu2eDetector() { - for(auto istraw : _strawmap) { - delete istraw.second; - } - } - - void Mu2eDetector::print( ostream& out) const{ - out << "Mu2eDetector has "<<_strawmap.size() << " elements" << endl; - } - -} // namespace mu2e diff --git a/TrackerConditions/src/Mu2eDetectorMaker.cc b/TrackerConditions/src/Mu2eDetectorMaker.cc deleted file mode 100644 index c92b122d69..0000000000 --- a/TrackerConditions/src/Mu2eDetectorMaker.cc +++ /dev/null @@ -1,46 +0,0 @@ - -#include - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetectorMaker.hh" - -using namespace std; - -namespace mu2e { - - - Mu2eDetector::ptr_t Mu2eDetectorMaker::fromFcl( - Mu2eMaterial::cptr_t mat_p, Tracker::cptr_t trk_p) { - - Mu2eDetector::ptr_t ptr = make_shared(); - - // loop over Planes - Mu2eMaterial const& material = *mat_p; - Tracker const& tracker = *trk_p; - for ( size_t i=0; i!= tracker.nPlanes(); ++i){ - StrawId sid(i,0,0); - if(tracker.planeExists(sid)){ - const auto& plane = tracker.getPlane(i); - // loop over panels - for(auto panel_p : plane.getPanels()){ - auto& panel = *panel_p; - // loop over straws - for (const auto& straw : panel.getStrawPointers()) { - // build the straw elements from this - // have to strip const because thing inside BTrk are non-const - auto temp = const_cast(material.strawType()); - DetStrawElem* elem = new DetStrawElem(temp,tracker,straw->id()); - // push this into the map - ptr->_strawmap[straw->id()] = elem; - } // straws - } // panels - } // if exists - } // planes - - return ptr; - } - - -} // namespace mu2e diff --git a/TrackerConditions/src/Mu2eMaterial.cc b/TrackerConditions/src/Mu2eMaterial.cc deleted file mode 100644 index 377fc25320..0000000000 --- a/TrackerConditions/src/Mu2eMaterial.cc +++ /dev/null @@ -1,23 +0,0 @@ - -#include - -#include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" -#include - -using namespace std; - -namespace mu2e { - - void Mu2eMaterial::print( ostream& out) const{ - out << "gasMaterial " - << *( _strawtype->gasMaterial()->name() ) << endl; - out << "wallMaterial " - << *( _strawtype->wallMaterial()->name() ) << endl; - //out << "wireMaterial " - // << *( _strawtype->wireMaterial()->name() ) << endl; - out << "offset " << _strawtype->offset() << endl; - out << "tolerance " << _strawtype->tolerance() << endl; - out << "maxRadiusFraction " << _strawtype->maxRadiusFraction() << endl; - } - -} // namespace mu2e diff --git a/TrackerConditions/src/Mu2eMaterialMaker.cc b/TrackerConditions/src/Mu2eMaterialMaker.cc deleted file mode 100644 index 0d8303207e..0000000000 --- a/TrackerConditions/src/Mu2eMaterialMaker.cc +++ /dev/null @@ -1,83 +0,0 @@ - -#include - -#include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" -#include "Offline/TrackerConditions/inc/Mu2eMaterialMaker.hh" -#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" - - -using namespace std; - -namespace mu2e { - - - Mu2eMaterial::ptr_t Mu2eMaterialMaker::fromFcl() { - - - // make shared_ptr to the Mu2eDetector object on the heap - Mu2eMaterial::ptr_t ptr = make_shared(); - - // file finder tells BTrk where to get data files - ptr->_fileFinder = make_unique(_config.elements(), - _config.isotopes(),_config.materials()); - - // particle info tells BTrk particle definitions - // from our ParticleDataList - ptr->_particleInfo = make_unique(); - - // this points BTrk static variables to our - // implementations of file list and particle definitions - ExternalInfo::set( ptr->_fileFinder.get() ); - ExternalInfo::set( ptr->_particleInfo.get() ); - - // now construct the BTrk version of the description - // of straw material - - string gasmatname = _config.strawGasMaterialName(); - string wallmatname = _config.strawWallMaterialName(); - string wirematname = _config.strawWireMaterialName(); - - // MatDBInfo holds pointers to material in BTrk, - // so needs to be long-lived - MatDBInfo& mat = ptr->_mat; - - // this forces a pointer into the MatDBInfo cache, - // the pointer also exists inside Btrk singletons - const DetMaterial* gasmat = mat.findDetMaterial(gasmatname.c_str()); - if(gasmat == 0) { - throw cet::exception("RECO_NO_GAS_MATERIAL") - << "mu2e::Mu2eDetector: no material with name " - << gasmatname << std::endl; - } - - const DetMaterial* wallmat = mat.findDetMaterial(wallmatname.c_str()); - if(wallmat == 0) { - throw cet::exception("RECO_NO_WALL_MATERIAL") - <<"mu2e::Mu2eDetector: no material with name " - << wallmatname << std::endl; - } - - // for now the wire type isn't set or used: FIXME!!! - const DetMaterial* wiremat(nullptr); - - // the offset displaces the element from the wire, which avoids - // problems when computing POCA on the fit trajectory. - double offset = _config.strawElementOffset(); - - // parameters for elements - double tol = _config.intersectionTolerance(); - - // maximum (fractional) radius to allow an intersection. This avoids - // creating intersections with crazy long paths through the straw wall - double rfrac = _config.maximumIntersectionRadiusFraction(); - - // construct the type. This is reused by all straws - // memory owned by Mu2eMaterial - ptr->_strawtype = std::make_unique( - gasmat,wallmat,wiremat,offset,tol,rfrac); - - return ptr; - } - - -} // namespace mu2e From 1c80479f237933d15e5077b9d56318c79de664be Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Wed, 10 Dec 2025 15:43:36 -0600 Subject: [PATCH 026/174] Allow filtering by trigger bits, add accessor --- Filters/src/TriggerResultsFilter_module.cc | 80 +++++++++++++------- Mu2eUtilities/inc/TriggerResultsNavigator.hh | 13 ++++ 2 files changed, 67 insertions(+), 26 deletions(-) diff --git a/Filters/src/TriggerResultsFilter_module.cc b/Filters/src/TriggerResultsFilter_module.cc index 3c84a3dcb2..aef812aeaf 100644 --- a/Filters/src/TriggerResultsFilter_module.cc +++ b/Filters/src/TriggerResultsFilter_module.cc @@ -7,8 +7,8 @@ #include #include #include -// root -#include "TString.h" +#include + // art includes #include "art/Framework/Core/EDFilter.h" #include "art/Framework/Principal/Event.h" @@ -16,6 +16,7 @@ #include "canvas/Persistency/Common/TriggerResults.h" #include "cetlib_except/exception.h" #include "fhiclcpp/types/Sequence.h" + // mu2e includes #include "Offline/Mu2eUtilities/inc/TriggerResultsNavigator.hh" @@ -29,12 +30,14 @@ namespace mu2e { using Name=fhicl::Name; using Comment=fhicl::Comment; struct Config { - fhicl::Atom diagLevel{ Name("DiagLevel"), Comment("Diagonstic Level"), 0}; - fhicl::Atom printFirst{ Name("PrintFirst"), - Comment("Print the TriggerResults on the first event"), false}; + fhicl::Atom diagLevel{ Name("DiagLevel"), Comment("Diagonstic Level"), 0}; + fhicl::Atom printFirst{ Name("PrintFirst"), Comment("Print the TriggerResults on the first event"), false}; + fhicl::Atom noFilter{ Name("NoFilter"), Comment("If true, do not filter any events"), false}; fhicl::Atom processName{Name("ProcessName"), Comment("Process which generated TriggerResults")}; fhicl::Sequence triggerNames{ Name("TriggerNames"), - Comment("Trigger line names to test; if any of these are set the event will pass the filter")}; + Comment("Trigger line names to test; if any of these are set the event will pass the filter"), vector()}; + fhicl::Sequence triggerBits{ Name("TriggerBits"), + Comment("Trigger line bits to test; if any of these are set the event will pass the filter"), vector()}; }; using Parameters = art::EDFilter::Table; @@ -46,7 +49,9 @@ namespace mu2e { int _diag; string _pname; // process name for the TriggerResults object to test bool _pfirst; // print lines on first event + bool _noFilter; // if true, do not filter any events std::vector _tnames; // trigger line names; if any of these lines are set, accept the event + std::vector _tbits; // trigger line bits; if any of these lines are set, accept the event std::vector _nset; // number of events passing each line unsigned _nevts, _npassed; }; @@ -57,47 +62,70 @@ namespace mu2e { _diag(config().diagLevel()), _pname(config().processName()), _pfirst(config().printFirst()), + _noFilter(config().noFilter()), _tnames(config().triggerNames()), - _nset(_tnames.size(),0), + _tbits(config().triggerBits()), + _nset(max(_tnames.size(), _tbits.size()),0), _nevts(0),_npassed(0) - {} + { + // Only filter on trigger bits or trigger names, not both + if(_tnames.size()>0 && _tbits.size()>0){ + throw cet::exception("CONFIG")<<"mu2e::TriggerResultsFilter: cannot specify both trigger names and trigger bits to filter on"; + } + if(_tnames.empty() && _tbits.empty() && !_noFilter){ + throw cet::exception("CONFIG")<<"mu2e::TriggerResultsFilter: must specify at least one trigger name or bit to filter on, or set NoFilter to true"; + } + } //================================================================ bool TriggerResultsFilter::filter(art::Event& event) { _nevts++; // find the TriggerResults object for the requested process name - art::InputTag const tag{Form("TriggerResults::%s", _pname.c_str())}; + art::InputTag const tag{format("TriggerResults::{}", _pname.c_str())}; auto trigResultsH = event.getValidHandle(tag); const art::TriggerResults* trigResults = trigResultsH.product(); TriggerResultsNavigator tnav(trigResults); - if(_pfirst){ + if(_pfirst || _diag > 2){ _pfirst = false; tnav.print(); } // loop over all the lines in this TriggerResults and see if any of the requested are set. // Count each line separately for diagnostics bool passed(false); - for(size_t iname=0;iname < _tnames.size(); iname++){ - auto const& tname = _tnames[iname]; - size_t itrig = tnav.findTrigPath(tname); - // require that the line exist - if(itrig == trigResults->size())throw cet::exception("Filter")<<"mu2e::TriggerResultsFilter: cannot find TriggerResults value for trigger " << tname << endl; - if(_diag>0) cout << "trigger line " << itrig << " found for name " << tname << " with value " << tnav.getTrigPath(itrig) << " status " - << trigResults->accept(itrig) << endl; - - if(trigResults->accept(itrig)){ - passed = true; - _nset[iname]++; + const bool use_bits = _tnames.empty(); + const size_t nbits = (use_bits) ? _tbits.size() : _tnames.size(); + for(size_t itrig = 0; itrig < nbits; itrig++) { + try { + auto const& tname = (use_bits) ? tnav.getTrigNameByBit(_tbits[itrig]) : _tnames[itrig]; + const bool accepted = tnav.accepted(tname); + if(_diag>1) printf("[TriggerResultsFilter::%s] Trigger %s (bit %zu) accepted = %o\n", + __func__, tname.c_str(), tnav.getTrigBit(tname), accepted); + if(accepted) { + passed = true; + _nset[itrig]++; + } + } catch (...) { // don't require the trigger to exist, as it may only appear in some runs + if(_diag>0) printf("[TriggerResultsFilter::%s] Trigger list index %zu not found\n", + __func__, itrig); } } - if(passed)_npassed++; - return passed; + if(passed) _npassed++; + return passed || _noFilter; } void TriggerResultsFilter::endJob() { - cout << "filter passed " << _npassed << " of " << _nevts << " events" << endl; - for(size_t iname=0;iname<_tnames.size(); iname++){ - cout << "Trigger Line " << _tnames[iname] << " set for " << _nset[iname] << " events" << endl; + printf("[TriggerResultFilter::%s] Processed %u events, accepted %u events (%8.4f%%)\n", + __func__, _nevts, _npassed, _nevts > 0 ? _npassed*100./_nevts : 0.); + if(_diag > 0) { + if(_tnames.size()>0) { + for(size_t iname=0;iname<_tnames.size(); iname++){ + cout << " Trigger Line " << _tnames[iname] << " set for " << _nset[iname] << " events" << endl; + } + } else if(_tbits.size()>0) { + for(size_t ibit=0;ibit<_tbits.size(); ibit++){ + cout << " Trigger Bit " << _tbits[ibit] << " set for " << _nset[ibit] << " events" << endl; + } + } } } diff --git a/Mu2eUtilities/inc/TriggerResultsNavigator.hh b/Mu2eUtilities/inc/TriggerResultsNavigator.hh index 095aff6933..a738b12bae 100644 --- a/Mu2eUtilities/inc/TriggerResultsNavigator.hh +++ b/Mu2eUtilities/inc/TriggerResultsNavigator.hh @@ -43,8 +43,21 @@ namespace mu2e { return findTrigPathID(name); } + std::string const& getTrigNameByBit(size_t const bit) const { + for (const auto& pair : _trigPathMap) { + if (pair.second == bit) { + return pair.first; + } + } + throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Bit " << bit << " not found"; + } + // Has ith path accepted the event? bool accepted(std::string const& name) const; + bool accepted(unsigned int const bit) const { + auto name = getTrigNameByBit(bit); + return accepted(name); + } bool wasrun(std::string const& name) const; From 909597ab92a7056b40b8b82c7a252a3298a07437 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Fri, 19 Dec 2025 11:53:34 -0800 Subject: [PATCH 027/174] account for calo waveform saturation in digi mixing --- Blinding/src/MergeDigis_module.cc | 10 ++++++++-- CaloMC/inc/CaloDigiWrapper.hh | 3 +++ CaloMC/inc/CaloDigiWrapperCollection.hh | 11 ++++++----- CaloMC/src/CaloDigiWrapperCollection.cc | 12 ++++++++---- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Blinding/src/MergeDigis_module.cc b/Blinding/src/MergeDigis_module.cc index 23f6783382..dab5909d83 100644 --- a/Blinding/src/MergeDigis_module.cc +++ b/Blinding/src/MergeDigis_module.cc @@ -41,6 +41,10 @@ namespace mu2e{ fhicl::Name("CaloDigiCollections"), fhicl::Comment("art::InputTags of source CaloDigis") }; + fhicl::Atom calo_adc_bits{ + fhicl::Name("CalorimeterADCBitDepth"), + fhicl::Comment("Bit depth of calorimeter adc readings (temporary)") + }; }; using Parameters = art::EDProducer::Table; @@ -54,6 +58,7 @@ namespace mu2e{ // calorimeter std::vector _calo_digi_tags; + CaloDigiWrapper::sample_t _calo_max_adc; private: void produce(art::Event&); @@ -64,7 +69,8 @@ namespace mu2e{ art::EDProducer(config), _tracker_digi_tags(config().tracker_digi_tags()), _tracker_mc(config().tracker_mc()), - _calo_digi_tags(config().calo_digi_tags()){ + _calo_digi_tags(config().calo_digi_tags()), + _calo_max_adc(1 << config().calo_adc_bits()){ // tracker for (const auto& tag: _tracker_digi_tags){ this->consumes(tag); @@ -127,7 +133,7 @@ namespace mu2e{ wrappers.Append(*handle); } CaloDigiWrapperCollection calo_resolved; - wrappers.ResolveCollisions(calo_resolved); + wrappers.ResolveCollisions(_calo_max_adc, calo_resolved); auto calo_digis = calo_resolved.GetDigis(); event.put(std::move(calo_digis)); diff --git a/CaloMC/inc/CaloDigiWrapper.hh b/CaloMC/inc/CaloDigiWrapper.hh index 1f8f7a84ed..c1677edb60 100644 --- a/CaloMC/inc/CaloDigiWrapper.hh +++ b/CaloMC/inc/CaloDigiWrapper.hh @@ -11,6 +11,9 @@ namespace mu2e{ class CaloDigiWrapper{ public: + using SiPMID_t = int; + using sample_t = int; + using pos_t = size_t; CaloDigiWrapper(const CaloDigi&); const CaloDigi& Digi() const; diff --git a/CaloMC/inc/CaloDigiWrapperCollection.hh b/CaloMC/inc/CaloDigiWrapperCollection.hh index 21d3f414b2..eca4f4dc9e 100644 --- a/CaloMC/inc/CaloDigiWrapperCollection.hh +++ b/CaloMC/inc/CaloDigiWrapperCollection.hh @@ -21,9 +21,9 @@ namespace mu2e{ class CaloDigiWrapperCollection{ public: - using SiPMID_t = int; - using sample_t = int; - using pos_t = size_t; + using SiPMID_t = CaloDigiWrapper::SiPMID_t; + using sample_t = CaloDigiWrapper::sample_t; + using pos_t = CaloDigiWrapper::pos_t; // forwarded calls to underlying container size_t size() const; CDWC_iterator begin(); @@ -46,11 +46,12 @@ namespace mu2e{ // identify sets of digis with overlapping digitization windows, and // reduce each such set to a single digi, representing their "sum" - void ResolveCollisions(CaloDigiWrapperCollection&); + void ResolveCollisions(sample_t, CaloDigiWrapperCollection&); protected: std::vector _wrappers; - void ResolveCollision(CaloDigiWrapperCollection&, + void ResolveCollision(sample_t, + CaloDigiWrapperCollection&, CaloDigiWrapperCollection&); private: diff --git a/CaloMC/src/CaloDigiWrapperCollection.cc b/CaloMC/src/CaloDigiWrapperCollection.cc index 23a2f4c4f4..74ab8120d5 100644 --- a/CaloMC/src/CaloDigiWrapperCollection.cc +++ b/CaloMC/src/CaloDigiWrapperCollection.cc @@ -99,7 +99,7 @@ namespace mu2e{ // ejc: this overlaps _greatly_ with CaloDigiWrapperCollection // TODO this assumes a fixed overlap window, which does not apply for calo // here we need variable-length chain links --- -.- - void CaloDigiWrapperCollection::ResolveCollisions(CaloDigiWrapperCollection& rv){ + void CaloDigiWrapperCollection::ResolveCollisions(sample_t max_adc, CaloDigiWrapperCollection& rv){ // identify time-overlapped chains: this is a 3 step process // first, partition wrappers according to SiPMID_t std::map unsorted_map; @@ -150,12 +150,12 @@ namespace mu2e{ for (const auto& wrapper: bucket){ wrappers.Append(wrapper); } - this->ResolveCollision(wrappers, rv); + this->ResolveCollision(max_adc, wrappers, rv); } } } - void CaloDigiWrapperCollection::ResolveCollision(CaloDigiWrapperCollection& collided, CaloDigiWrapperCollection& rv){ + void CaloDigiWrapperCollection::ResolveCollision(sample_t max_adc, CaloDigiWrapperCollection& collided, CaloDigiWrapperCollection& rv){ // if only one digi present, then nothing to do if (collided.size() < 2){ rv.Append(collided.front()); @@ -177,7 +177,6 @@ namespace mu2e{ std::vector samples(length, 0); // sum each individual waveform into the total - // TODO this does not account for saturation for (const auto& wrapper: collided){ const auto& digi = wrapper.Digi(); const auto& waveform = digi.waveform(); @@ -187,6 +186,11 @@ namespace mu2e{ } } + // enforce saturation of waveforms from adc word size + for (size_t i = 0 ; i < samples.size() ; i++){ + samples[i] = std::min(max_adc, samples[i]); + } + // now find the peak position pos_t peakpos = 0; sample_t peak = 0; From 9ec187c9d5168c09eec7690189b7dddb90b4a137 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 13:08:56 -0800 Subject: [PATCH 028/174] CaloShowerSim mixing to support MC truth info in digi mixing --- EventMixing/inc/Mu2eProductMixer.hh | 9 ++++++++ EventMixing/src/Mu2eProductMixer.cc | 36 ++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/EventMixing/inc/Mu2eProductMixer.hh b/EventMixing/inc/Mu2eProductMixer.hh index b594e50e4b..51bf37aab8 100644 --- a/EventMixing/inc/Mu2eProductMixer.hh +++ b/EventMixing/inc/Mu2eProductMixer.hh @@ -45,6 +45,7 @@ #include "Offline/RecoDataProducts/inc/StrawDigi.hh" #include "Offline/MCDataProducts/inc/StrawDigiMC.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" +#include "Offline/MCDataProducts/inc/CaloShowerSim.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" @@ -111,6 +112,7 @@ namespace mu2e { fhicl::Table strawDigiADCWaveformMixer { fhicl::Name("strawDigiADCWaveformMixer") }; fhicl::Table strawDigiMCMixer { fhicl::Name("strawDigiMCMixer") }; fhicl::Table caloDigiMixer { fhicl::Name("caloDigiMixer") }; + fhicl::Table caloShowerSimMixer { fhicl::Name("caloShowerSimMixer") }; fhicl::Table eventWindowMarkerMixer { fhicl::Name("eventWindowMarkerMixer") }; fhicl::OptionalTable cosmicLivetimeMixer { fhicl::Name("cosmicLivetimeMixer") }; fhicl::OptionalTable volumeInfoMixer { fhicl::Name("volumeInfoMixer") }; @@ -178,6 +180,10 @@ namespace mu2e { CaloDigiCollection& out, art::PtrRemapper const& remap); + bool mixCaloShowerSims(std::vector const& in, + CaloShowerSimCollection& out, + art::PtrRemapper const& remap); + bool mixEventWindowMarkers(std::vector const& in, EventWindowMarker& out, art::PtrRemapper const& remap); @@ -215,6 +221,9 @@ namespace mu2e { typedef StrawGasStepCollection::size_type SGSOffset; std::vector sgsOffsets_; + typedef CaloShowerStepCollection::size_type CSSOffset; + std::vector cssOffsets_; + void updateSimParticle(SimParticle& particle, SPOffset offset, art::PtrRemapper const& remap); typedef std::map VolumeMap; diff --git a/EventMixing/src/Mu2eProductMixer.cc b/EventMixing/src/Mu2eProductMixer.cc index 47d0ac5e82..636a77f3a5 100644 --- a/EventMixing/src/Mu2eProductMixer.cc +++ b/EventMixing/src/Mu2eProductMixer.cc @@ -122,6 +122,11 @@ namespace mu2e { (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixCaloDigis, *this); } + for(const auto& e: conf.caloShowerSimMixer().mixingMap()) { + helper.declareMixOp + (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixCaloShowerSims, *this); + } + for(const auto& e: conf.eventWindowMarkerMixer().mixingMap()) { helper.declareMixOp (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixEventWindowMarkers, *this); @@ -356,11 +361,11 @@ namespace mu2e { CaloShowerStepCollection& out, art::PtrRemapper const& remap) { - std::vector stepOffsets; - art::flattenCollections(in, out, stepOffsets); + std::vector cssOffsets_; + art::flattenCollections(in, out, cssOffsets_); for(CaloShowerStepCollection::size_type i=0; i const& in, + CaloShowerSimCollection& out, + art::PtrRemapper const& remap) + { + std::vector cssimOffsets; + art::flattenCollections(in, out, cssimOffsets); + + // remap art::Ptrs + for (CaloShowerSimCollection::size_type i=0; i < out.size(); ++i) { + auto& sim = out[i]; + auto ie = getInputEventIndex(i, cssimOffsets); + auto cssOffset = cssOffsets_[ie]; + + // remap CaloShowerSteps + auto& steps = sim.caloShowerSteps(); + CaloShowerSim::StepPtrs remapped; + for (size_t is = 0 ; is < steps.size(); is++){ + remapped.push_back(remap(steps[is], cssOffset)); + } + sim.setCaloShowerSteps(std::move(remapped)); + } + + return true; + } + bool Mu2eProductMixer::mixEventWindowMarkers(std::vector const& in, EventWindowMarker& out, art::PtrRemapper const& remap){ From 445af368012db1b43eaf56541a41cd10806e167f Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 14:26:39 -0800 Subject: [PATCH 029/174] fix shadow declaration --- EventMixing/src/Mu2eProductMixer.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/EventMixing/src/Mu2eProductMixer.cc b/EventMixing/src/Mu2eProductMixer.cc index 636a77f3a5..2edd07169e 100644 --- a/EventMixing/src/Mu2eProductMixer.cc +++ b/EventMixing/src/Mu2eProductMixer.cc @@ -361,7 +361,6 @@ namespace mu2e { CaloShowerStepCollection& out, art::PtrRemapper const& remap) { - std::vector cssOffsets_; art::flattenCollections(in, out, cssOffsets_); for(CaloShowerStepCollection::size_type i=0; i Date: Mon, 22 Dec 2025 15:30:51 -0800 Subject: [PATCH 030/174] replace missing syntax braces --- Blinding/src/MergeDigis_module.cc | 1 + EventMixing/src/Mu2eProductMixer.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/Blinding/src/MergeDigis_module.cc b/Blinding/src/MergeDigis_module.cc index 5a91fd89b0..d90427350e 100644 --- a/Blinding/src/MergeDigis_module.cc +++ b/Blinding/src/MergeDigis_module.cc @@ -49,6 +49,7 @@ namespace mu2e{ fhicl::Atom calo_adc_bits{ fhicl::Name("CalorimeterADCBitDepth"), fhicl::Comment("Bit depth of calorimeter adc readings (temporary)") + }; fhicl::Sequence crv_digi_tags{ fhicl::Name("CrvDigiCollections"), fhicl::Comment("art::InputTags of source CrvDigi") diff --git a/EventMixing/src/Mu2eProductMixer.cc b/EventMixing/src/Mu2eProductMixer.cc index cd2b429518..16b9b3f41c 100644 --- a/EventMixing/src/Mu2eProductMixer.cc +++ b/EventMixing/src/Mu2eProductMixer.cc @@ -125,6 +125,7 @@ namespace mu2e { for(const auto& e: conf.caloShowerSimMixer().mixingMap()) { helper.declareMixOp (e.inTag, e.resolvedInstanceName(), &Mu2eProductMixer::mixCaloShowerSims, *this); + } for(const auto& e: conf.crvDigiMixer().mixingMap()) { helper.declareMixOp From fb026e0fe679372110468938e5bd1bf23e596e58 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 15:52:57 -0800 Subject: [PATCH 031/174] data member reordering + clean up from merge --- Blinding/src/MergeDigis_module.cc | 9 +++++---- EventMixing/inc/Mu2eProductMixer.hh | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Blinding/src/MergeDigis_module.cc b/Blinding/src/MergeDigis_module.cc index d90427350e..30517cf93b 100644 --- a/Blinding/src/MergeDigis_module.cc +++ b/Blinding/src/MergeDigis_module.cc @@ -68,15 +68,16 @@ namespace mu2e{ std::vector _tracker_digi_tags; bool _tracker_mc; ProditionsHandle _tracker_conditions_handle; - // crv - std::vector _crv_digi_tags; - std::vector _crv_digimc_tags; - ProditionsHandle _crv_calib_handle; // calorimeter std::vector _calo_digi_tags; CaloDigiWrapper::sample_t _calo_max_adc; + // crv + std::vector _crv_digi_tags; + std::vector _crv_digimc_tags; + ProditionsHandle _crv_calib_handle; + private: void produce(art::Event&); void mergeCrvDigis(art::Event&); diff --git a/EventMixing/inc/Mu2eProductMixer.hh b/EventMixing/inc/Mu2eProductMixer.hh index bb055e0d91..b230a78c1a 100644 --- a/EventMixing/inc/Mu2eProductMixer.hh +++ b/EventMixing/inc/Mu2eProductMixer.hh @@ -186,6 +186,8 @@ namespace mu2e { bool mixCaloShowerSims(std::vector const& in, CaloShowerSimCollection& out, + art::PtrRemapper const& remap); + bool mixCrvDigis(std::vector const& in, CrvDigiCollection& out, art::PtrRemapper const& remap); From b95f834f410dd175a1e52bb3e030d1ef0d7c11a9 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 16:02:48 -0800 Subject: [PATCH 032/174] more fallout from merge :') --- EventMixing/src/Mu2eProductMixer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EventMixing/src/Mu2eProductMixer.cc b/EventMixing/src/Mu2eProductMixer.cc index 16b9b3f41c..41268b758f 100644 --- a/EventMixing/src/Mu2eProductMixer.cc +++ b/EventMixing/src/Mu2eProductMixer.cc @@ -501,6 +501,10 @@ namespace mu2e { bool Mu2eProductMixer::mixCaloDigis(std::vector const& in, CaloDigiCollection& out, art::PtrRemapper const& remap) + { + art::flattenCollections(in, out); + return true; + } bool Mu2eProductMixer::mixCrvDigis(std::vector const& in, CrvDigiCollection& out, From 479180ce7a4ae1ff8d14f01e5a884d64e7a2153a Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 17:30:39 -0800 Subject: [PATCH 033/174] last post-merge fix --- EventMixing/src/Mu2eProductMixer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EventMixing/src/Mu2eProductMixer.cc b/EventMixing/src/Mu2eProductMixer.cc index 41268b758f..620f96f859 100644 --- a/EventMixing/src/Mu2eProductMixer.cc +++ b/EventMixing/src/Mu2eProductMixer.cc @@ -534,6 +534,10 @@ namespace mu2e { remapped.push_back(remap(steps[is], cssOffset)); } sim.setCaloShowerSteps(std::move(remapped)); + } + + return true; + } bool Mu2eProductMixer::mixCrvDigiMCs(std::vector const& in, CrvDigiMCCollection& out, From 624f33ffa8a745908c39e39b311fdb8a8572efc9 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 17:45:38 -0800 Subject: [PATCH 034/174] rm defunct commentary --- CaloMC/src/CaloDigiWrapperCollection.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/CaloMC/src/CaloDigiWrapperCollection.cc b/CaloMC/src/CaloDigiWrapperCollection.cc index 74ab8120d5..9e4f86310f 100644 --- a/CaloMC/src/CaloDigiWrapperCollection.cc +++ b/CaloMC/src/CaloDigiWrapperCollection.cc @@ -96,9 +96,6 @@ namespace mu2e{ return rv; } - // ejc: this overlaps _greatly_ with CaloDigiWrapperCollection - // TODO this assumes a fixed overlap window, which does not apply for calo - // here we need variable-length chain links --- -.- void CaloDigiWrapperCollection::ResolveCollisions(sample_t max_adc, CaloDigiWrapperCollection& rv){ // identify time-overlapped chains: this is a 3 step process // first, partition wrappers according to SiPMID_t From f56bda5120aeaf1288d5983a20fdea3f9fafa6d7 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 17:58:46 -0800 Subject: [PATCH 035/174] correct calorimeter adc range --- Blinding/src/MergeDigis_module.cc | 2 +- CaloMC/src/CaloDigiMaker_module.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Blinding/src/MergeDigis_module.cc b/Blinding/src/MergeDigis_module.cc index 30517cf93b..f9c4ff2afd 100644 --- a/Blinding/src/MergeDigis_module.cc +++ b/Blinding/src/MergeDigis_module.cc @@ -89,7 +89,7 @@ namespace mu2e{ _tracker_digi_tags(config().tracker_digi_tags()), _tracker_mc(config().tracker_mc()), _calo_digi_tags(config().calo_digi_tags()), - _calo_max_adc(1 << config().calo_adc_bits()), + _calo_max_adc((1 << config().calo_adc_bits()) - 1), _crv_digi_tags(config().crv_digi_tags()), _crv_digimc_tags(config().crv_digimc_tags()){ // tracker diff --git a/CaloMC/src/CaloDigiMaker_module.cc b/CaloMC/src/CaloDigiMaker_module.cc index 2f654a269e..5e9705b687 100644 --- a/CaloMC/src/CaloDigiMaker_module.cc +++ b/CaloMC/src/CaloDigiMaker_module.cc @@ -82,7 +82,7 @@ namespace mu2e { digiSampling_ (config().digiSampling()), bufferDigi_ (config().bufferDigi()), startTimeBuffer_ (config().digiSampling()*config().bufferDigi()), - maxADCCounts_ (1 << config().nBits()), + maxADCCounts_ ((1 << config().nBits()) - 1), pulseShape_ (CaloPulseShape(config().digiSampling())), wfExtractor_ (config().bufferDigi(),config().nBinsPeak(),config().minPeakADC(),config().bufferDigi()), engine_ (createEngine(art::ServiceHandle()->getSeed())), From 71a8ca4242c787a4b080fd69e1fe305234d23cf7 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Mon, 22 Dec 2025 22:10:24 -0600 Subject: [PATCH 036/174] add calo support classes to CMakeLists --- CaloMC/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CaloMC/CMakeLists.txt b/CaloMC/CMakeLists.txt index a631ff4e95..915621ac7b 100644 --- a/CaloMC/CMakeLists.txt +++ b/CaloMC/CMakeLists.txt @@ -4,6 +4,8 @@ cet_make_library( src/CaloPhotonPropagation.cc src/CaloWFExtractor.cc src/ShowerStepUtil.cc + src/CaloDigiWrapper.cc + src/CaloDigiWrapperCollection.cc LIBRARIES PUBLIC Offline::CalorimeterGeom From 635edcafddb7534f15995cd79b46b5430e3dfad2 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Tue, 30 Dec 2025 05:29:28 -0600 Subject: [PATCH 037/174] small changes for Crv calibration and DQM --- CRVReco/src/CrvCalibration_module.cc | 2 +- CRVReco/src/CrvDQMcollector_module.cc | 8 ++++---- CRVReco/src/CrvTimingStudies_module.cc | 7 ++----- CRVReco/src/MakeCrvRecoPulses.cc | 4 +++- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index e0408befb3..11ed150d76 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -50,7 +50,7 @@ namespace mu2e fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum. numbers less then 4 result in warnings"), 6}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; - fhicl::Atom peakRatioTolerance{Name("peakRatioTolerance"), Comment("allowed deviation of the ratio between 1PE peak and 2PE peak from 2.0"), 0.1}; + fhicl::Atom peakRatioTolerance{Name("peakRatioTolerance"), Comment("allowed deviation of the ratio between 1PE peak and 2PE peak from 2.0"), 0.2}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; diff --git a/CRVReco/src/CrvDQMcollector_module.cc b/CRVReco/src/CrvDQMcollector_module.cc index f57e5f16f1..c6edfc8bad 100644 --- a/CRVReco/src/CrvDQMcollector_module.cc +++ b/CRVReco/src/CrvDQMcollector_module.cc @@ -411,10 +411,10 @@ namespace mu2e Form("crvDigiRatesNZS_ROC%zu",ROC), CRVId::nFEBPerROC*CRVId::nChanPerFEB,0,CRVId::nFEBPerROC*CRVId::nChanPerFEB)); } - _hist2DPEsMPVROC=tfs->make("crvPEsMPV","crvPEsMPV", CRVId::nChanPerFEB,0,CRVId::nChanPerFEB, CRVId::nROC*CRVId::nFEBPerROC,0,CRVId::nROC*CRVId::nFEBPerROC); - _hist2DDigiRatesROC=tfs->make("crvDigiRates","crvDigiRates", CRVId::nChanPerFEB,0,CRVId::nChanPerFEB, CRVId::nROC*CRVId::nFEBPerROC,0,CRVId::nROC*CRVId::nFEBPerROC); - _hist2DDigiRatesROCNZS=tfs->make("crvDigiRatesNZS","crvDigiRatesNZS", CRVId::nChanPerFEB,0,CRVId::nChanPerFEB, CRVId::nROC*CRVId::nFEBPerROC,0,CRVId::nROC*CRVId::nFEBPerROC); - _histCoincidenceClusters=tfs->make("crvCoincidencesClusters","crvCoincidenceClusters",10,0,10); + _hist2DPEsMPVROC=tfs->make("crvPEsMPV","crvPEsMPV:FEBchannel:FEB", CRVId::nChanPerFEB,0,CRVId::nChanPerFEB, CRVId::nROC*CRVId::nFEBPerROC,0,CRVId::nROC*CRVId::nFEBPerROC); + _hist2DDigiRatesROC=tfs->make("crvDigiRates","crvDigiRates:FEBchannel:FEB", CRVId::nChanPerFEB,0,CRVId::nChanPerFEB, CRVId::nROC*CRVId::nFEBPerROC,0,CRVId::nROC*CRVId::nFEBPerROC); + _hist2DDigiRatesROCNZS=tfs->make("crvDigiRatesNZS","crvDigiRatesNZS:FEBchannel:FEB", CRVId::nChanPerFEB,0,CRVId::nChanPerFEB, CRVId::nROC*CRVId::nFEBPerROC,0,CRVId::nROC*CRVId::nFEBPerROC); + _histCoincidenceClusters=tfs->make("crvCoincidencesClusters","crvCoincidenceClusters:sectorType",10,0,10); _treeMetaData=tfs->make("crvMetaData","crvMetaData"); _treeMetaData->Branch("runNumberStart",&_firstRunSubrun.first); diff --git a/CRVReco/src/CrvTimingStudies_module.cc b/CRVReco/src/CrvTimingStudies_module.cc index 039dc8cc68..13b5338aa2 100644 --- a/CRVReco/src/CrvTimingStudies_module.cc +++ b/CRVReco/src/CrvTimingStudies_module.cc @@ -111,11 +111,8 @@ namespace mu2e uint16_t ROC = onlineChannel.ROC(); uint16_t feb = onlineChannel.FEB(); uint16_t febChannel = onlineChannel.FEBchannel(); -ROC--; -feb--; - uint16_t fpgaIndex = (ROC*CRVId::nFEBPerROC*CRVId::nChanPerFEB+feb*CRVId::nChanPerFEB+febChannel)/(CRVId::nChanPerFEB/CRVId::nFPGAPerFEB); -//uint16_t fpgaIndex = (ROC*CRVId::nFEBPerROC*CRVId::nChanPerFEB+feb*CRVId::nChanPerFEB+febChannel)/(8); -//uint16_t fpgaIndex = (ROC*CRVId::nFEBPerROC*CRVId::nChanPerFEB+feb*CRVId::nChanPerFEB+febChannel); + + uint16_t fpgaIndex = ((ROC-1)*CRVId::nFEBPerROC*CRVId::nChanPerFEB+(feb-1)*CRVId::nChanPerFEB+febChannel)/(CRVId::nChanPerFEB/CRVId::nFPGAPerFEB); fpgaTimes[fpgaIndex].push_back(recoPulseTime); } diff --git a/CRVReco/src/MakeCrvRecoPulses.cc b/CRVReco/src/MakeCrvRecoPulses.cc index 7f5040712f..cc12280c26 100644 --- a/CRVReco/src/MakeCrvRecoPulses.cc +++ b/CRVReco/src/MakeCrvRecoPulses.cc @@ -31,7 +31,9 @@ MakeCrvRecoPulses::MakeCrvRecoPulses(float minADCdifference, float defaultBeta, _pulseThreshold(pulseThreshold), _pulseAreaThreshold(pulseAreaThreshold), _doublePulseSeparation(doublePulseSeparation) -{} +{ + if(_pulseAreaThreshold>_minADCdifference) _pulseAreaThreshold=_minADCdifference; +} void MakeCrvRecoPulses::FillGraphAndFindPeaks(const std::vector &waveform, uint16_t startTDC, float digitizationPeriod, float pedestal, From 564af28fb09998e7e0b3cc044eec5a9dafcb511a Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Tue, 30 Dec 2025 06:27:06 -0600 Subject: [PATCH 038/174] more Crv calibration updates --- CRVReco/src/CrvCalibration_module.cc | 69 ++++++++++++++++------------ 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 11ed150d76..6101e6f641 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -46,8 +46,10 @@ namespace mu2e fhicl::Atom histMaxPulseHeight{Name("histMaxPulseHeight"), Comment("end range of pulseArea histogram"), 150.0}; fhicl::Atom fitRangeStart{Name("fitRangeStart"), Comment("low end of the 1PE fit range as fraction of peak"), 0.8}; fhicl::Atom fitRangeEnd{Name("fitRangeEnd"), Comment("high end of the 1PE fit range as fraction of peak"), 1.2}; + fhicl::Atom minPeakPulseArea{Name("minPeakPulseArea"), Comment("minimum accepted SPE peak for pulseArea histogram"), 250.0}; + fhicl::Atom minPeakPulseHeight{Name("minPeakPulseHeight"), Comment("minimum accepted SPE peak for pulseHeight histogram"), 10.0}; fhicl::Atom minHistEntries{Name("minHistEntries"), Comment("minimum number of entries required for a fit"), 100}; - fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum. numbers less then 4 result in warnings"), 6}; + fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum. numbers less then 4 result in warnings"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; fhicl::Atom peakRatioTolerance{Name("peakRatioTolerance"), Comment("allowed deviation of the ratio between 1PE peak and 2PE peak from 2.0"), 0.2}; @@ -60,7 +62,8 @@ namespace mu2e void analyze(const art::Event& e); void beginRun(const art::Run&); void endJob(); - bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, double &SPEpeak); + template + bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak); private: std::string _crvRecoPulsesModuleLabel; @@ -68,6 +71,7 @@ namespace mu2e double _histMaxPulseArea, _histMaxPulseHeight; double _fitRangeStart, _fitRangeEnd; int _minHistEntries; + double _minPeakPulseArea, _minPeakPulseHeight; int _spectrumNPeaks; double _spectrumPeakSigma; double _spectrumPeakThreshold; @@ -96,6 +100,8 @@ namespace mu2e _fitRangeStart(conf().fitRangeStart()), _fitRangeEnd(conf().fitRangeEnd()), _minHistEntries(conf().minHistEntries()), + _minPeakPulseArea(conf().minPeakPulseArea()), + _minPeakPulseHeight(conf().minPeakPulseHeight()), _spectrumNPeaks(conf().spectrumNPeaks()), _spectrumPeakSigma(conf().spectrumPeakSigma()), _spectrumPeakThreshold(conf().spectrumPeakThreshold()), @@ -143,7 +149,7 @@ namespace mu2e treePedestal->Branch("channel", &channel); treePedestal->Branch("pedestal", &pedestal); - TF1 funcCalib("SPEpeak", "gaus"); + std::array functions={TF1("calibPeak1","gaus"), TF1("calibPeak2","gaus"), TF1("calibPeak3","gaus")}; //only need to fit three peaks TSpectrum spectrum(_spectrumNPeaks); //any value of 3 or less results in a "Peak buffer full" warning. std::ofstream outputFile; @@ -160,22 +166,13 @@ namespace mu2e if(i==1) hist=_calibHistsPulseArea.at(channel); else hist=_calibHistsPulseHeight.at(channel); - double peakCalib=0; - if(!FindSPEpeak(hist, spectrum, peakCalib)) + double SPEpeak=-1; + if(!FindSPEpeak(hist, spectrum, functions, SPEpeak, (i==0?_minPeakPulseHeight:_minPeakPulseArea))) { calibValue[i]=-1; continue; } - - funcCalib.SetRange(peakCalib*_fitRangeStart,peakCalib*_fitRangeEnd); - if(hist->FindBin(peakCalib*_fitRangeStart)==hist->FindBin(peakCalib*_fitRangeEnd)) //fit range start/end are in the same bin - { - calibValue[i]=-1; - continue; - } - funcCalib.SetParameter(1,peakCalib); - hist->Fit(&funcCalib, "0QR"); - calibValue[i]=funcCalib.GetParameter(1); + calibValue[i]=SPEpeak; } pedestal=_pedestals.at(channel); @@ -241,29 +238,41 @@ namespace mu2e } } - bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, double &SPEpeak) + template + bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak) { if(hist->GetEntries()<_minHistEntries) return false; //not enough data - int nPeaks = spectrum.Search(hist,_spectrumPeakSigma,"nodraw",_spectrumPeakThreshold); + size_t nPeaks = spectrum.Search(hist,_spectrumPeakSigma,"nodraw",_spectrumPeakThreshold); if(nPeaks==0) return false; - //peaks are not returned sorted + //peaks are returned sorted by Y double *peaksX = spectrum.GetPositionX(); - double *peaksY = spectrum.GetPositionY(); - std::vector > peaks; - for(int iPeak=0; iPeak &a, const std::pair &b) {return a.first1 && peaks[0].first>0) //if more than one peak is found, the first peak could be due to baseline fluctuations - //never seen peaks at 0, but still checking to avoid division by 0. + std::vector fittedPeaks; + for(size_t iPeak=0; iPeak_peakRatioTolerance) peakToUse=1; //2nd peak is not twice the 1st peak, so the 1st peak is not the SPE peak - //assume that the 2nd peak is the SPE peak - //we have never seen that the 3rd peak was the SPE peak - no need to test it + double x=peaksX[iPeak]; + if(hist->FindBin(x*_fitRangeStart)==hist->FindBin(x*_fitRangeEnd)) continue; //fit range start/end are in the same bin + functions[iPeak].SetRange(x*_fitRangeStart,x*_fitRangeEnd); + functions[iPeak].SetParameter(1,x); + hist->Fit(&functions[iPeak], "QR+"); + fittedPeaks.emplace_back(functions[iPeak].GetParameter(1)); } - SPEpeak = peaks[peakToUse].first; + if(fittedPeaks.size()==0) return false; + + int peakToUse=-1; + //only need to test two highest peaks (=first two entries in vector) + //one of the peaks could be due to baseline fluctuations + for(size_t iPeak=0; iPeak Date: Tue, 6 Jan 2026 03:44:39 -0600 Subject: [PATCH 039/174] simplified CRV calibration --- CRVReco/src/CrvCalibration_module.cc | 39 +++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 6101e6f641..02e916d603 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -62,8 +62,9 @@ namespace mu2e void analyze(const art::Event& e); void beginRun(const art::Run&); void endJob(); - template - bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak); +// template +// bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak); + bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak); private: std::string _crvRecoPulsesModuleLabel; @@ -149,7 +150,8 @@ namespace mu2e treePedestal->Branch("channel", &channel); treePedestal->Branch("pedestal", &pedestal); - std::array functions={TF1("calibPeak1","gaus"), TF1("calibPeak2","gaus"), TF1("calibPeak3","gaus")}; //only need to fit three peaks +// std::array functions={TF1("calibPeak1","gaus"), TF1("calibPeak2","gaus"), TF1("calibPeak3","gaus")}; //only need to fit three peaks + TF1 function("calibPeak","gaus"); TSpectrum spectrum(_spectrumNPeaks); //any value of 3 or less results in a "Peak buffer full" warning. std::ofstream outputFile; @@ -167,7 +169,8 @@ namespace mu2e else hist=_calibHistsPulseHeight.at(channel); double SPEpeak=-1; - if(!FindSPEpeak(hist, spectrum, functions, SPEpeak, (i==0?_minPeakPulseHeight:_minPeakPulseArea))) +// if(!FindSPEpeak(hist, spectrum, functions, SPEpeak, (i==0?_minPeakPulseHeight:_minPeakPulseArea))) + if(!FindSPEpeak(hist, spectrum, function, SPEpeak, (i==0?_minPeakPulseHeight:_minPeakPulseArea))) { calibValue[i]=-1; continue; @@ -238,6 +241,33 @@ namespace mu2e } } + bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak) + { + if(hist->GetEntries()<_minHistEntries) return false; //not enough data + + size_t nPeaks = spectrum.Search(hist,_spectrumPeakSigma,"nodraw",_spectrumPeakThreshold); + if(nPeaks==0) return false; + + //peaks are returned sorted by Y + double *peaksX = spectrum.GetPositionX(); + double x=peaksX[0]; + if(xFindBin(x*_fitRangeStart)==hist->FindBin(x*_fitRangeEnd)) return false; //fit range start/end are in the same bin + function.SetRange(x*_fitRangeStart,x*_fitRangeEnd); + function.SetParameter(1,x); + hist->Fit(&function, "QR"); + SPEpeak = function.GetParameter(1); + + return true; + } + +/* template bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak) { @@ -275,6 +305,7 @@ namespace mu2e return true; } +*/ } // end namespace mu2e From 2709cea3107db90f975544077a0d53b8d171c082 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Tue, 6 Jan 2026 16:38:11 -0600 Subject: [PATCH 040/174] Update trigger results navigator interface, reduce string comparisons --- Filters/src/TriggerResultsFilter_module.cc | 18 ++- Mu2eUtilities/inc/TriggerResultsNavigator.hh | 56 ++++----- Mu2eUtilities/src/TriggerResultsNavigator.cc | 121 +++++++++++-------- Print/src/TriggerResultsPrinter.cc | 4 +- Trigger/src/ReadTriggerInfo_module.cc | 12 +- Trigger/src/ReadTriggerPath_module.cc | 12 +- 6 files changed, 115 insertions(+), 108 deletions(-) diff --git a/Filters/src/TriggerResultsFilter_module.cc b/Filters/src/TriggerResultsFilter_module.cc index aef812aeaf..aab642e41e 100644 --- a/Filters/src/TriggerResultsFilter_module.cc +++ b/Filters/src/TriggerResultsFilter_module.cc @@ -30,14 +30,12 @@ namespace mu2e { using Name=fhicl::Name; using Comment=fhicl::Comment; struct Config { - fhicl::Atom diagLevel{ Name("DiagLevel"), Comment("Diagonstic Level"), 0}; - fhicl::Atom printFirst{ Name("PrintFirst"), Comment("Print the TriggerResults on the first event"), false}; - fhicl::Atom noFilter{ Name("NoFilter"), Comment("If true, do not filter any events"), false}; - fhicl::Atom processName{Name("ProcessName"), Comment("Process which generated TriggerResults")}; - fhicl::Sequence triggerNames{ Name("TriggerNames"), - Comment("Trigger line names to test; if any of these are set the event will pass the filter"), vector()}; - fhicl::Sequence triggerBits{ Name("TriggerBits"), - Comment("Trigger line bits to test; if any of these are set the event will pass the filter"), vector()}; + fhicl::Atom diagLevel {Name("DiagLevel") , Comment("Diagonstic Level"), 0}; + fhicl::Atom printFirst {Name("PrintFirst") , Comment("Print the TriggerResults on the first event"), false}; + fhicl::Atom noFilter {Name("NoFilter") , Comment("If true, do not filter any events"), false}; + fhicl::Atom processName {Name("ProcessName") , Comment("Process which generated TriggerResults")}; + fhicl::Sequence triggerNames{Name("TriggerNames"), Comment("Trigger line names to test; if any of these are set the event will pass the filter"), vector()}; + fhicl::Sequence triggerBits {Name("TriggerBits") , Comment("Trigger line bits to test; if any of these are set the event will pass the filter"), vector()}; }; using Parameters = art::EDFilter::Table; @@ -96,10 +94,10 @@ namespace mu2e { const size_t nbits = (use_bits) ? _tbits.size() : _tnames.size(); for(size_t itrig = 0; itrig < nbits; itrig++) { try { - auto const& tname = (use_bits) ? tnav.getTrigNameByBit(_tbits[itrig]) : _tnames[itrig]; + auto const& tname = (use_bits) ? tnav.getTrigPathNameByBit(_tbits[itrig]) : _tnames[itrig]; const bool accepted = tnav.accepted(tname); if(_diag>1) printf("[TriggerResultsFilter::%s] Trigger %s (bit %zu) accepted = %o\n", - __func__, tname.c_str(), tnav.getTrigBit(tname), accepted); + __func__, tname.c_str(), tnav.getTrigBitByName(tname), accepted); if(accepted) { passed = true; _nset[itrig]++; diff --git a/Mu2eUtilities/inc/TriggerResultsNavigator.hh b/Mu2eUtilities/inc/TriggerResultsNavigator.hh index a738b12bae..74387fa927 100644 --- a/Mu2eUtilities/inc/TriggerResultsNavigator.hh +++ b/Mu2eUtilities/inc/TriggerResultsNavigator.hh @@ -7,6 +7,7 @@ #include "canvas/Persistency/Common/TriggerResults.h" #include +#include #include #include #include @@ -24,41 +25,27 @@ namespace mu2e { return _trigPathsNames.size(); } - std::vector const& getTrigPaths () const { return _trigPathsNames; } - std::string const& getTrigPath (unsigned int const i) const { return _trigPathsNames.at(i); } - std::string const getTrigPathName(unsigned int const i) const; - size_t getTrigBit (unsigned int const pathID) const; - size_t findTrigPath(std::string const& name) const; - size_t find(std::map const& posmap, std::string const& name) const; - size_t findTrigPathID(std::string const& name) const; + std::vector const& getTrigPaths() const { return _trigPathsNames; } + std::string const& getTrigPathByIndex(unsigned int const index) const { return _trigPathsNames.at(index); } + std::string const& getTrigPathNameByIndex(unsigned int const i) const; + std::string const& getTrigPathNameByBit(unsigned int const bit) const; + size_t getTrigBitByIndex(unsigned int const pathID) const; + size_t getTrigBitByName(const std::string& name) const; + size_t getTrigPathIndex(std::string const& name) const; + size_t getTrigPathIndex(const size_t bit) const; bool validPath(std::string const& name) const { - size_t path_index = findTrigPath(name); - return path_index < _trigPathsNames.size(); + return _trigMap.contains(name); } - - size_t getTrigBit(std::string const& name) const { - if(!validPath(name)) - throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Path name " << name << " not found"; - return findTrigPathID(name); - } - - std::string const& getTrigNameByBit(size_t const bit) const { - for (const auto& pair : _trigPathMap) { - if (pair.second == bit) { - return pair.first; - } - } - throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Bit " << bit << " not found"; + bool validPath(const unsigned int bit) { + return _bitToPathName.contains(bit); } - // Has ith path accepted the event? + // Did the path pass the event bool accepted(std::string const& name) const; - bool accepted(unsigned int const bit) const { - auto name = getTrigNameByBit(bit); - return accepted(name); - } + bool accepted(unsigned int const bit) const; + // Was the path run in the event bool wasrun(std::string const& name) const; //NOTE: the following three functions can be used only within the same job that runs the @@ -71,10 +58,15 @@ namespace mu2e { void print() const; private: - const art::TriggerResults* _trigResults; - std::vector _trigPathsNames; // vector of trigger path names - std::map _trigMap; // map of trigger path name to index in TriggerResults - std::map _trigPathMap; // map of trigger path name to path ID (bit) + const art::TriggerResults* _trigResults; // trigger results info + std::vector _trigPathsNames; // vector of trigger path names + std::unordered_map _trigMap; // map of trigger path name to index in the art::TriggerResults + std::unordered_map _trigPathMap; // map of trigger path name to path ID (bit) + std::unordered_map _indexToPathName; // trigger path index -> name map + std::unordered_map _bitToPathName; // trigger path bit -> name map + std::unordered_map _bitToIndex; // trigger path bit -> index map + + static constexpr size_t NOTFOUND = -1; // special bit/index value for no trigger was found }; diff --git a/Mu2eUtilities/src/TriggerResultsNavigator.cc b/Mu2eUtilities/src/TriggerResultsNavigator.cc index cad94bd119..ad41c4ea4b 100644 --- a/Mu2eUtilities/src/TriggerResultsNavigator.cc +++ b/Mu2eUtilities/src/TriggerResultsNavigator.cc @@ -21,8 +21,9 @@ namespace mu2e { TriggerResultsNavigator::TriggerResultsNavigator(const art::TriggerResults* trigResults): _trigResults(trigResults){ - auto const id = trigResults->parameterSetID(); + // Simplest thing: ParameterSetRegistry has correct ParameterSet + auto const id = trigResults->parameterSetID(); fhicl::ParameterSet pset; fhicl::ParameterSetRegistry::get(id, pset); @@ -32,89 +33,102 @@ namespace mu2e { auto nid = pset_pair.second.id(); assert(nid == pset_pair.first); + // if this is the trigger results parameter set ID, get the trigger path list if(nid == id) { pset = pset_pair.second; - if (pset.has_key("trigger_paths")){ - _trigPathsNames = pset.get>("trigger_paths",std::vector()); + if(pset.has_key("trigger_paths")) { + _trigPathsNames = pset.get>("trigger_paths"); } } } //loop over trigResults to fill the map std::string delimeter=":"; - for (unsigned int i=0; i< _trigPathsNames.size(); ++i){ - size_t pos = _trigPathsNames[i].find(delimeter); - unsigned int bit = std::stoi(_trigPathsNames[i].substr(0, pos)); - std::string pathName = _trigPathsNames[i].substr(pos+1, _trigPathsNames[i].length()); - _trigMap.insert(std::pair(pathName, i)); - _trigPathMap.insert(std::pair(pathName, bit)); + for (size_t index = 0; index < _trigPathsNames.size(); ++index){ + const std::string& path = _trigPathsNames.at(index); + size_t pos = path.find(delimeter); + if(pos == std::string::npos) + throw cet::exception("TRIGGER") << "No path bit found for path " << _trigPathsNames.at(index); + unsigned int bit = std::stoi(path.substr(0, pos)); + std::string pathName = path.substr(pos+1, path.length()); + _trigMap .insert(std::pair(pathName, index)); + _trigPathMap .insert(std::pair(pathName, bit)); + _indexToPathName.insert(std::pair(index, pathName)); + _bitToPathName .insert(std::pair(bit, pathName)); + _bitToIndex .insert(std::pair(bit, index)); } } - std::string const - TriggerResultsNavigator::getTrigPathName(unsigned int const i) const + std::string const& + TriggerResultsNavigator::getTrigPathNameByIndex(unsigned int const index) const { - if (i >= _trigPathsNames.size()) { - throw cet::exception("TRIGGER") << "TRIG PATHID " << i << " NOT FOUND"; + if(!_indexToPathName.contains(index)) { + throw cet::exception("TRIGGER") << "TRIG PATH INDEX " << index << " NOT FOUND"; } - std::string delimeter =":"; - size_t pos = _trigPathsNames[i].find(delimeter); - if (pos >= _trigPathsNames[i].length()) return "TRIG PATH NOT FOUND"; - return _trigPathsNames[i].substr(pos+1, _trigPathsNames[i].length()); + return _indexToPathName.at(index); } - size_t - TriggerResultsNavigator::getTrigBit(unsigned int const i) const + std::string const& + TriggerResultsNavigator::getTrigPathNameByBit(unsigned int const bit) const { - if (i>=_trigPathsNames.size()) { - throw cet::exception("TRIGGER") << "TRIG PATHID " << i << " NOT FOUND"; + if(!_bitToPathName.contains(bit)) { + throw cet::exception("TRIGGER") << "TRIG PATH BIT " << bit << " NOT FOUND"; } - std::string delimeter =":"; - size_t pos = _trigPathsNames[i].find(delimeter); - unsigned int bit = std::stoi(_trigPathsNames[i].substr(0, pos)); - return bit; + return _bitToPathName.at(bit); } size_t - TriggerResultsNavigator::findTrigPath(std::string const& name) const + TriggerResultsNavigator::getTrigBitByIndex(unsigned int const index) const { - return find(_trigMap, name); + if(!_indexToPathName.contains(index)) { + throw cet::exception("TRIGGER") << "TRIG PATH INDEX " << index << " NOT FOUND"; + } + return _trigPathMap.at(_indexToPathName.at(index)); } size_t - TriggerResultsNavigator::find(std::map const& posmap, std::string const& name) const + TriggerResultsNavigator::getTrigBitByName(const std::string& name) const { - auto const pos = posmap.find(name); - if (pos == posmap.cend()) { - return posmap.size(); - } else { - return pos->second; + if(!_trigPathMap.contains(name)) { + throw cet::exception("TRIGGER") << "TRIG PATH NAME " << name << " NOT FOUND"; } + return _trigPathMap.at(name); } + // Return the trigger path index, if found size_t - TriggerResultsNavigator::findTrigPathID(std::string const& name) const + TriggerResultsNavigator::getTrigPathIndex(std::string const& name) const { - if(!validPath(name)) - throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Path name " << name << " not found"; - return find(_trigPathMap, name); + if(!_trigMap.count(name)) return NOTFOUND; + return _trigMap.at(name); + } + size_t + TriggerResultsNavigator::getTrigPathIndex(const size_t bit) const + { + if(!_bitToPathName.count(bit)) return NOTFOUND; + return _trigMap.at(_bitToPathName.at(bit)); } // Has ith path accepted the event? bool TriggerResultsNavigator::accepted(std::string const& name) const { - size_t index = findTrigPath(name); - if (index == _trigResults->size()) return false; - return _trigResults->accept(index); + if(!_trigPathMap.count(name)) return false; + return _trigResults->accept(getTrigPathIndex(name)); + } + + bool + TriggerResultsNavigator::accepted(unsigned int const bit) const { + if(!_bitToIndex.count(bit)) return false; + return _trigResults->accept(getTrigPathIndex(bit)); } bool TriggerResultsNavigator::wasrun(std::string const& name) const { - size_t index = findTrigPath(name); - return _trigResults->wasrun(index); + if(!_trigPathMap.count(name)) return false; + return _trigResults->wasrun(getTrigPathIndex(name)); } std::vector @@ -134,28 +148,30 @@ namespace mu2e { unsigned TriggerResultsNavigator::indexLastModule(std::string const& name) const{ - size_t index = findTrigPath(name); - return _trigResults->index(index); + if(!_trigPathMap.count(name)) return -1; + return _trigResults->index(getTrigPathIndex(name)); } std::string TriggerResultsNavigator::nameLastModule (std::string const& name) const{ unsigned indexLast = indexLastModule(name); - std::vector modulesVec = triggerModules(name); + std::vector modulesVec; + if(indexLast != unsigned(-1)) modulesVec = triggerModules(name); - if ( modulesVec.size() == 0) { + if(modulesVec.empty()) { std::string nn = "PATH "+name+" NOT FOUND"; std::cout << "[TriggerResultsNavigator::nameLastModule] " << nn << std::endl; return nn; - }else { + } else { return modulesVec[indexLast]; } } art::hlt::HLTState TriggerResultsNavigator::state(std::string const& name) const{ - size_t index = findTrigPath(name); - return _trigResults->state(index); + if(!_trigPathMap.count(name)) + throw cet::exception("TRIGGER") << "Path " << name << " not found!"; + return _trigResults->state(getTrigPathIndex(name)); } void @@ -165,9 +181,10 @@ namespace mu2e { std::cout << "// trig_pathName id accepted //" << std::endl; std::cout << "//------------------------------------------------//" << std::endl; - for (unsigned i=0; i< getTrigPaths().size(); ++i) { - const std::string path = getTrigPathName(i); - const int bit = findTrigPathID(path); + const size_t npaths = getTrigPaths().size(); + for (size_t i = 0; i < npaths; ++i) { + const std::string path = getTrigPathNameByIndex(i); + const int bit = getTrigBitByName(path); const bool good = accepted(path); std::cout << std::right; std::cout <<"//"<Integral() <= 0.) { for (unsigned int i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); _sumHist._hTrigInfo[30]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[30]->FindBin(i), path.c_str()); } } //fill the histogram with the accepted trigger bits for (unsigned int i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); if(trigNavig.accepted(path)) { - _sumHist._hTrigBits->Fill(trigNavig.findTrigPath(path)); - _sumHist._hTrigInfo[15]->Fill(trigNavig.findTrigPathID(path)); //accepted path IDs + _sumHist._hTrigBits->Fill(trigNavig.getTrigPathIndex(path)); + _sumHist._hTrigInfo[15]->Fill(trigNavig.getTrigBitByName(path)); //accepted path IDs _sumHist._hTrigInfo[30]->Fill(i); } } @@ -863,7 +863,7 @@ namespace mu2e { // Loop through all trigger paths, storing trigger info for (unsigned i=0; i < _trigPaths.size(); ++i) { - std::string pathName = trigNavig.getTrigPathName(i); + std::string pathName = trigNavig.getTrigPathNameByIndex(i); std::string& path = pathName; if(_diagLevel > 1) printf("[ReadTriggerInfo::%s] : Checking path %s\n", __func__, path.c_str()); diff --git a/Trigger/src/ReadTriggerPath_module.cc b/Trigger/src/ReadTriggerPath_module.cc index c016a22097..af26649005 100644 --- a/Trigger/src/ReadTriggerPath_module.cc +++ b/Trigger/src/ReadTriggerPath_module.cc @@ -299,7 +299,7 @@ namespace mu2e { //--------------------------------------------------------------------------------// void ReadTriggerPath::trigPathVal(const int Index, TriggerResultsNavigator& trigNavig, summaryInfoHist_& Hist) { if(_diagLevel > 4) printf("[ReadTriggerPath::%s]\n", __func__); - const std::string path = trigNavig.getTrigPathName(Index); + const std::string path = trigNavig.getTrigPathNameByIndex(Index); const unsigned lastModule = trigNavig.indexLastModule(path); auto h = Hist._hTrigModules[Index]; if(!h) throw cet::exception("BADCONFIG") << __func__ << ": Trigger path index " << Index << " is out of bounds for initialized histograms\n"; @@ -455,7 +455,7 @@ namespace mu2e { //initialize bin labels if(_sumHist._hTrigInfo[0]->Integral() <= 0.) { for (unsigned int i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); _sumHist._hTrigInfo[0]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[0]->FindBin(i), path.c_str()); _sumHist._hTrigInfo[1]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[1]->FindBin(i), path.c_str()); _sumHist._hTrigInfo[4]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[4]->FindBin(i), path.c_str()); @@ -478,7 +478,7 @@ namespace mu2e { bool passed(false), track_passed(false), helix_passed(false), calo_passed(false), minbias_passed(false), unknown(false); unsigned naccept(0), exclusive_idx(-1); for (unsigned i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); if(_diagLevel > 4) { printf("[ReadTriggerPath::%s] Printing modules in path %s\n", __func__, path.c_str()); auto modules = trigNavig.triggerModules(path); @@ -486,8 +486,8 @@ namespace mu2e { } if(trigNavig.accepted(path)) { - _sumHist._hTrigBits->Fill(trigNavig.findTrigPathID(path)); - _sumHist._hTrigIndices->Fill(trigNavig.findTrigPath(path)); + _sumHist._hTrigBits->Fill(trigNavig.getTrigBitByName(path)); + _sumHist._hTrigIndices->Fill(trigNavig.getTrigPathIndex(path)); _sumHist._hTrigPaths ->Fill(path.c_str(), 1.); // _sumHist._hTrigPaths ->Fill(i); _sumHist._hTrigInfo[0]->Fill(i); @@ -516,7 +516,7 @@ namespace mu2e { } //Fill the correlation matrix for (unsigned j=0; j < trigNavig.getTrigPaths().size(); ++j) { - if(trigNavig.accepted(trigNavig.getTrigPathName(j)) && !skip_exclusive) _sumHist._hTrig2D->Fill(i,j); + if(trigNavig.accepted(trigNavig.getTrigPathNameByIndex(j)) && !skip_exclusive) _sumHist._hTrig2D->Fill(i,j); } } From c41285fd3e7bc7cb1d798bbbd7ea5b2ad0a98535 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Wed, 14 Jan 2026 17:21:35 -0600 Subject: [PATCH 041/174] Add EWM and PBT to prefetch, change to validated config --- DAQ/src/PrefetchDAQData_module.cc | 72 +++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/DAQ/src/PrefetchDAQData_module.cc b/DAQ/src/PrefetchDAQData_module.cc index 9a4275712e..a13ae7b27c 100644 --- a/DAQ/src/PrefetchDAQData_module.cc +++ b/DAQ/src/PrefetchDAQData_module.cc @@ -6,7 +6,9 @@ #include "art_root_io/TFileService.h" // data +#include "Offline/DataProducts/inc/EventWindowMarker.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" +#include "Offline/RecoDataProducts/inc/ProtonBunchTime.hh" #include "Offline/RecoDataProducts/inc/StrawDigi.hh" // DAQ data @@ -22,7 +24,27 @@ namespace mu2e { protected: public: - explicit PrefetchDAQData(fhicl::ParameterSet const&); + struct Config { + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Atom debugLevel {Name("debugLevel" ), Comment("debugLevel" ), 0}; + fhicl::Atom fetchCaloDigis {Name("fetchCaloDigis" ), Comment("fetchCaloDigis" )}; + fhicl::Atom fetchStrawDigis {Name("fetchStrawDigis" ), Comment("fetchStrawDigis" )}; + fhicl::Atom fetchCaloFragments {Name("fetchCaloFragments" ), Comment("fetchCaloFragments" )}; + fhicl::Atom fetchTrkFragments {Name("fetchTrkFragments" ), Comment("fetchTrkFragments" )}; + fhicl::Atom fetchAllFragments {Name("fetchAllFragments" ), Comment("fetchAllFragments" )}; + fhicl::Atom fetchEWM {Name("fetchEWM" ), Comment("fetchEWM" )}; + fhicl::Atom fetchPBT {Name("fetchPBT" ), Comment("fetchPBT" )}; + fhicl::Atom caloDigiCollectionTag {Name("caloDigiCollectionTag" ), Comment("caloDigiCollectionTag" )}; + fhicl::Atom strawDigiCollectionTag{Name("strawDigiCollectionTag"), Comment("strawDigiCollectionTag")}; + fhicl::Atom caloFragmentTag {Name("caloFragmentTag" ), Comment("caloFragmentTag" )}; + fhicl::Atom trkFragmentTag {Name("trkFragmentTag" ), Comment("trkFragmentTag" )}; + fhicl::Atom pbtTag {Name("pbtTag" ), Comment("pbtTag" )}; + fhicl::Atom ewmTag {Name("ewmTag" ), Comment("ewmTag" )}; + }; + + using Parameters = art::EDProducer::Table; + explicit PrefetchDAQData(const Parameters&); virtual ~PrefetchDAQData(); virtual void beginJob(); virtual void produce( art::Event& e); @@ -41,32 +63,42 @@ namespace mu2e { int _fetchCaloFragments; int _fetchTrkFragments; int _fetchAllFragments; + int _fetchEWM; + int _fetchPBT; art::InputTag _cdTag; art::InputTag _sdTag; art::InputTag _cfTag; art::InputTag _tfTag; + art::InputTag _ewmTag; + art::InputTag _pbtTag; // cache of event objects const CaloDigiCollection* _cdcol; const StrawDigiCollection* _sdcol; const artdaq::Fragments* _cfcol; const artdaq::Fragments* _tfcol; + const EventWindowMarker* _ewm; + const ProtonBunchTime* _pbt; int _eventNum; }; //----------------------------------------------------------------------------- - PrefetchDAQData::PrefetchDAQData(fhicl::ParameterSet const& pset): - art::EDProducer(pset), - _debugLevel (pset.get ("debugLevel")), - _fetchCaloDigis (pset.get ("fetchCaloDigis" )), - _fetchStrawDigis (pset.get ("fetchStrawDigis")), - _fetchCaloFragments(pset.get ("fetchCaloFragments")), - _fetchTrkFragments (pset.get ("fetchTrkFragments")), - _fetchAllFragments (pset.get ("fetchAllFragments")), - _cdTag (pset.get("caloDigiCollectionTag")), - _sdTag (pset.get("strawDigiCollectionTag")), - _cfTag (pset.get("caloFragmentTag")), - _tfTag (pset.get("trkFragmentTag")) + PrefetchDAQData::PrefetchDAQData(const Parameters& config): + art::EDProducer(config), + _debugLevel (config().debugLevel()), + _fetchCaloDigis (config().fetchCaloDigis()), + _fetchStrawDigis (config().fetchStrawDigis()), + _fetchCaloFragments(config().fetchCaloFragments()), + _fetchTrkFragments (config().fetchTrkFragments()), + _fetchAllFragments (config().fetchAllFragments()), + _fetchEWM (config().fetchEWM()), + _fetchPBT (config().fetchPBT()), + _cdTag (config().caloDigiCollectionTag()), + _sdTag (config().strawDigiCollectionTag()), + _cfTag (config().caloFragmentTag()), + _tfTag (config().trkFragmentTag()), + _ewmTag (config().ewmTag()), + _pbtTag (config().pbtTag()) {} PrefetchDAQData::~PrefetchDAQData() { @@ -93,6 +125,8 @@ namespace mu2e { _sdcol = 0; _cfcol = 0; _tfcol = 0; + _ewm = 0; + _pbt = 0; if (_fetchCaloDigis) { auto cdH = evt.getValidHandle(_cdTag); @@ -122,7 +156,17 @@ namespace mu2e { } } } - //----------------------------------------------------------------------------- + + if (_fetchEWM) { + auto handle = evt.getValidHandle(_ewmTag); + _ewm = handle.product(); + } + + if (_fetchPBT) { + auto handle = evt.getValidHandle(_pbtTag); + _pbt = handle.product(); + } +//----------------------------------------------------------------------------- // prefetch data //----------------------------------------------------------------------------- if (_cdcol) { From edaeab1ff2d11ea51d7d63e360b19ee7a57cecc5 Mon Sep 17 00:00:00 2001 From: edcallaghan Date: Thu, 15 Jan 2026 09:57:07 -0800 Subject: [PATCH 042/174] mark pointed-into stl-vector as const to guard against invalidating reallocations --- CaloMC/src/CaloDigiWrapperCollection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaloMC/src/CaloDigiWrapperCollection.cc b/CaloMC/src/CaloDigiWrapperCollection.cc index 9e4f86310f..9103b9f12c 100644 --- a/CaloMC/src/CaloDigiWrapperCollection.cc +++ b/CaloMC/src/CaloDigiWrapperCollection.cc @@ -112,7 +112,7 @@ namespace mu2e{ std::map wrappers_map; for (const auto& pair: unsorted_map){ const auto& id = pair.first; - auto& wrappers = pair.second; + const auto& wrappers = pair.second; std::vector sortable(wrappers.size()); for (size_t i = 0 ; i < wrappers.size() ; i++){ sortable[i] = const_cast(&wrappers[i]); From 0fcfd80275f99b6c9e88c4907f35977e6cbc40ae Mon Sep 17 00:00:00 2001 From: Eric Flumerfelt Date: Fri, 16 Jan 2026 11:14:54 -0600 Subject: [PATCH 043/174] Set WITH_G4 to FALSE when undefined --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73e2e9eecb..5c2ac76a1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ cet_set_compiler_flags(DIAGS VIGILANT -Wreorder ) + if(DEFINED Offline_UPS_QUALIFIER_STRING) string(FIND ${Offline_UPS_QUALIFIER_STRING} "trig" TRIG_BUILD) # TRIG_BUILD will be -1 if trig qualifier not found @@ -43,7 +44,12 @@ if(DEFINED Offline_UPS_QUALIFIER_STRING) endif() endif() -message("WITH_G4 SET TO ${WITH_G4}") +if(NOT DEFINED WITH_G4) + message("WITH_G4 UNDEFINED, SET TO FALSE") + set(WITH_G4 FALSE) +else() + message("WITH_G4 SET TO ${WITH_G4}") +endif() # Create a variable to hold optional Online libraries find_package(artdaq) From 3542f8e36b7e86dad03017e22720feb63af00b10 Mon Sep 17 00:00:00 2001 From: Eric Flumerfelt Date: Fri, 16 Jan 2026 12:35:26 -0600 Subject: [PATCH 044/174] Resolve missing CMake module definitions --- Filters/CMakeLists.txt | 8 ++++++++ TrackerMC/CMakeLists.txt | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/Filters/CMakeLists.txt b/Filters/CMakeLists.txt index 36de3d5376..6243f5aabb 100644 --- a/Filters/CMakeLists.txt +++ b/Filters/CMakeLists.txt @@ -237,6 +237,14 @@ cet_build_plugin(StrawDigiMCFilter art::module Offline::MCDataProducts ) +cet_build_plugin(StrawGasStepFilter art::module + REG_SOURCE src/StrawGasStepFilter_module.cc + LIBRARIES REG + Offline::MCDataProducts + Offline::ProditionsService + Offline::TrackerConditions +) + cet_build_plugin(TrackerStepPointFilter art::module REG_SOURCE src/TrackerStepPointFilter_module.cc LIBRARIES REG diff --git a/TrackerMC/CMakeLists.txt b/TrackerMC/CMakeLists.txt index 90b8d1d0f8..bc2414386e 100644 --- a/TrackerMC/CMakeLists.txt +++ b/TrackerMC/CMakeLists.txt @@ -55,6 +55,15 @@ cet_build_plugin(PoissonTrackerNoise art::module Offline::SeedService ) +cet_build_plugin(StationStepSelector art::module + REG_SOURCE src/StationStepSelector_module.cc + LIBRARIES REG + Offline::TrackerMC + + Offline::ProditionsService + Offline::SeedService +) + cet_build_plugin(StrawDigisFromStrawGasSteps art::module REG_SOURCE src/StrawDigisFromStrawGasSteps_module.cc LIBRARIES REG From efce606e17966b454ba70c84b6e4c96bcf20a6ca Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 17 Jan 2026 10:04:48 -0600 Subject: [PATCH 045/174] Switch int -> bool flags, add fhicl param comments --- DAQ/src/PrefetchDAQData_module.cc | 58 ++++++++++++++++--------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/DAQ/src/PrefetchDAQData_module.cc b/DAQ/src/PrefetchDAQData_module.cc index a13ae7b27c..aad9529446 100644 --- a/DAQ/src/PrefetchDAQData_module.cc +++ b/DAQ/src/PrefetchDAQData_module.cc @@ -1,3 +1,5 @@ +// Prefetch DAQ data to avoid fetch times impacting module timing evaluations + // framework #include "art/Framework/Principal/Event.h" #include "fhiclcpp/ParameterSet.h" @@ -12,8 +14,6 @@ #include "Offline/RecoDataProducts/inc/StrawDigi.hh" // DAQ data -//#include "artdaq-core-mu2e/Overlays/FragmentType.hh" -//#include "artdaq-core-mu2e/Overlays/TrackerDataDecoder.hh" #include @@ -27,20 +27,21 @@ namespace mu2e { struct Config { using Name = fhicl::Name; using Comment = fhicl::Comment; - fhicl::Atom debugLevel {Name("debugLevel" ), Comment("debugLevel" ), 0}; - fhicl::Atom fetchCaloDigis {Name("fetchCaloDigis" ), Comment("fetchCaloDigis" )}; - fhicl::Atom fetchStrawDigis {Name("fetchStrawDigis" ), Comment("fetchStrawDigis" )}; - fhicl::Atom fetchCaloFragments {Name("fetchCaloFragments" ), Comment("fetchCaloFragments" )}; - fhicl::Atom fetchTrkFragments {Name("fetchTrkFragments" ), Comment("fetchTrkFragments" )}; - fhicl::Atom fetchAllFragments {Name("fetchAllFragments" ), Comment("fetchAllFragments" )}; - fhicl::Atom fetchEWM {Name("fetchEWM" ), Comment("fetchEWM" )}; - fhicl::Atom fetchPBT {Name("fetchPBT" ), Comment("fetchPBT" )}; - fhicl::Atom caloDigiCollectionTag {Name("caloDigiCollectionTag" ), Comment("caloDigiCollectionTag" )}; - fhicl::Atom strawDigiCollectionTag{Name("strawDigiCollectionTag"), Comment("strawDigiCollectionTag")}; - fhicl::Atom caloFragmentTag {Name("caloFragmentTag" ), Comment("caloFragmentTag" )}; - fhicl::Atom trkFragmentTag {Name("trkFragmentTag" ), Comment("trkFragmentTag" )}; - fhicl::Atom pbtTag {Name("pbtTag" ), Comment("pbtTag" )}; - fhicl::Atom ewmTag {Name("ewmTag" ), Comment("ewmTag" )}; + + fhicl::Atom debugLevel {Name("debugLevel" ), Comment("Debug output verbosity level"), 0}; + fhicl::Atom fetchCaloDigis {Name("fetchCaloDigis" ), Comment("Prefetch calorimeter digi collections")}; + fhicl::Atom fetchStrawDigis {Name("fetchStrawDigis" ), Comment("Prefetch straw tracker digi collections")}; + fhicl::Atom fetchCaloFragments {Name("fetchCaloFragments" ), Comment("Prefetch calorimeter DAQ fragments")}; + fhicl::Atom fetchTrkFragments {Name("fetchTrkFragments" ), Comment("Prefetch tracker DAQ fragments")}; + fhicl::Atom fetchAllFragments {Name("fetchAllFragments" ), Comment("Prefetch all available DAQ fragments regardless of subdetector-specific fetch flags" )}; + fhicl::Atom fetchEWM {Name("fetchEWM" ), Comment("Prefetch EventWindowMarker")}; + fhicl::Atom fetchPBT {Name("fetchPBT" ), Comment("Prefetch ProtonBunchTime")}; + fhicl::Atom caloDigiCollectionTag {Name("caloDigiCollectionTag" ), Comment("Input tag for the calorimeter digi collection")}; + fhicl::Atom strawDigiCollectionTag{Name("strawDigiCollectionTag"), Comment("Input tag for the straw tracker digi collection")}; + fhicl::Atom caloFragmentTag {Name("caloFragmentTag" ), Comment("Input tag for the calorimeter DAQ fragment collection")}; + fhicl::Atom trkFragmentTag {Name("trkFragmentTag" ), Comment("Input tag for the tracker DAQ fragment collection")}; + fhicl::Atom pbtTag {Name("pbtTag" ), Comment("Input tag for the ProtonBunchTime")}; + fhicl::Atom ewmTag {Name("ewmTag" ), Comment("Input tag for the EventWindowMarker")}; }; using Parameters = art::EDProducer::Table; @@ -58,13 +59,13 @@ namespace mu2e { bool findData(const art::Event& e); // control flags int _debugLevel; - int _fetchCaloDigis; - int _fetchStrawDigis; - int _fetchCaloFragments; - int _fetchTrkFragments; - int _fetchAllFragments; - int _fetchEWM; - int _fetchPBT; + bool _fetchCaloDigis; + bool _fetchStrawDigis; + bool _fetchCaloFragments; + bool _fetchTrkFragments; + bool _fetchAllFragments; + bool _fetchEWM; + bool _fetchPBT; art::InputTag _cdTag; art::InputTag _sdTag; @@ -82,7 +83,7 @@ namespace mu2e { int _eventNum; }; - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- PrefetchDAQData::PrefetchDAQData(const Parameters& config): art::EDProducer(config), _debugLevel (config().debugLevel()), @@ -128,6 +129,9 @@ namespace mu2e { _ewm = 0; _pbt = 0; +//----------------------------------------------------------------------------- +// Retrieve the data from the event +//----------------------------------------------------------------------------- if (_fetchCaloDigis) { auto cdH = evt.getValidHandle(_cdTag); _cdcol = cdH.product(); @@ -166,8 +170,9 @@ namespace mu2e { auto handle = evt.getValidHandle(_pbtTag); _pbt = handle.product(); } + //----------------------------------------------------------------------------- -// prefetch data +// prefetch data within the collections //----------------------------------------------------------------------------- if (_cdcol) { int ncd = _cdcol->size(); @@ -218,6 +223,3 @@ namespace mu2e { DEFINE_ART_MODULE(PrefetchDAQData) } - - - From e0fd08bc8f1bb56b6c9f93fb14dc0e31057b5717 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sun, 18 Jan 2026 16:53:39 -0600 Subject: [PATCH 046/174] I don't think these are needed --- DataProducts/src/pywrap.i | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DataProducts/src/pywrap.i b/DataProducts/src/pywrap.i index a737f6297a..e1082d7a25 100644 --- a/DataProducts/src/pywrap.i +++ b/DataProducts/src/pywrap.i @@ -8,9 +8,7 @@ %include "math.i" %include "stdint.i" -%apply const std::string& {std::string* foo}; -%ignore operator <<; -%ignore operator int8_t; +%ignore *::operator<<; %{ #include "Offline/DataProducts/inc/StrawEnd.hh" From 64ba28079e61e709498ac098e7a2fa750eb87c60 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sun, 18 Jan 2026 16:54:21 -0600 Subject: [PATCH 047/174] cmake for swig --- CMakeLists.txt | 19 ++++++++++ scripts/build/cmake/Mu2eSwigHelper.cmake | 45 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 scripts/build/cmake/Mu2eSwigHelper.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c2ac76a1f..33494a5c99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,25 @@ if( ${WITH_G4} ) link_directories($ENV{CRYHOME}/lib) endif() +if( ${BUILD_PYTHON_INTERFACE} ) + message("--> Adding SWIG calls to generate Python interface") + find_package(SWIG REQUIRED EXPORT) + include(${SWIG_USE_FILE}) + + # Find the Python interpreter and development files + find_package(Python3 COMPONENTS Interpreter Development) + if(NOT Python3_FOUND) + message(FATAL_ERROR "Python3 not found. Please install Python3 development files.") + endif() + + # Define these ONCE here so they are available everywhere + set(PYTHON_VER "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") + set(PYTHON_INSTALL_DIR "lib/python${PYTHON_VER}/site-packages" CACHE INTERNAL "Python install destination") + + include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/build/cmake/Mu2eSwigHelper.cmake) + + message("--> Python install directory set to: ${PYTHON_INSTALL_DIR}") +endif() # BTrk and KinKal have non-standard Find*.cmake... if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../KinKal/KinKalTargets.cmake) diff --git a/scripts/build/cmake/Mu2eSwigHelper.cmake b/scripts/build/cmake/Mu2eSwigHelper.cmake new file mode 100644 index 0000000000..22fb7391c3 --- /dev/null +++ b/scripts/build/cmake/Mu2eSwigHelper.cmake @@ -0,0 +1,45 @@ +# cmake/Mu2eSwigHelper.cmake +# +# called from a Offline subdirectory +# PYTHON_INSTALL_DIR was set at top level + +function(mu2e_swig TARGET_NAME INTERFACE_FILE CPP_LIB_DEPENDENCY) + # Define the output directory for this specific sub-module + set(GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/swig_gen") + set(CMAKE_SWIG_OUTDIR ${GEN_DIR}) + + # Set C++ mode on the .i file + set_property(SOURCE ${INTERFACE_FILE} PROPERTY CPLUSPLUS ON) + + # Create the SWIG library + swig_add_library(${TARGET_NAME} + LANGUAGE Python + SOURCES ${INTERFACE_FILE} + ) + + # Inherit includes and link to the requested C++ library + Python + set_property(TARGET ${TARGET_NAME} PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) + + target_link_libraries(${TARGET_NAME} + PRIVATE + ${CPP_LIB_DEPENDENCY} + Python3::Module + Python3::Python + ) + + #target_compile_options(${TARGET_NAME} PRIVATE "-std=c++20") + + # Install both the .so and the .py file + install(TARGETS ${TARGET_NAME} + LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}) + + get_target_property(_py_dir ${TARGET_NAME} SWIG_SUPPORT_FILES_DIRECTORY) + + # Note: This assumes the .py filename matches the target name + # (or you can pass the module name as a 4th argument) + install(DIRECTORY ${_py_dir}/ + DESTINATION ${PYTHON_INSTALL_DIR} + FILES_MATCHING PATTERN "*.py") + +endfunction() + From b9ae45ed9095f74610cc68b865dd007181a9ddab Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sun, 18 Jan 2026 16:55:05 -0600 Subject: [PATCH 048/174] calls to build swig python --- DataProducts/CMakeLists.txt | 39 ++++++++++++++++++++++++++++++++- DbService/CMakeLists.txt | 5 +++++ DbTables/CMakeLists.txt | 4 ++++ GeneralUtilities/CMakeLists.txt | 4 ++++ MCDataProducts/CMakeLists.txt | 7 +++++- 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/DataProducts/CMakeLists.txt b/DataProducts/CMakeLists.txt index 26e1b37fad..5ed9c1df33 100644 --- a/DataProducts/CMakeLists.txt +++ b/DataProducts/CMakeLists.txt @@ -24,7 +24,44 @@ art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults CLASSES_DEF_XML ${CMAKE_CURRENT_SOURCE_DIR}/src/classes_def.xml CLASSES_H ${CMAKE_CURRENT_SOURCE_DIR}/src/classes.h DICTIONARY_LIBRARIES - Offline::DataProducts + Offline::DataProducts ) + +if( ${BUILD_PYTHON_INTERFACE} ) + mu2e_swig(DataProducts_swig src/pywrap.i DataProducts) +endif() + +#if( ${BUILD_PYTHON_INTERFACE} ) +# set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/swig_gen) +# +# # Compile the generated lib like c++ +# set_property(SOURCE src/pywrap.i PROPERTY CPLUSPLUS ON) +# +# # Define the swig gen library +# swig_add_library( +# DataProducts_swig +# LANGUAGE Python +# SOURCES src/pywrap.i +# ) +# +# # use the target's include directories +# set_property(TARGET DataProducts_swig PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) +# +# # Standard CMake command to add the include path to the target +# target_include_directories(DataProducts_swig PRIVATE ${PROJECT_SOURCE_DIR}) +# +# target_link_libraries(DataProducts_swig PUBLIC Python3::Module Python3::Python DataProducts) +# +# install(TARGETS DataProducts_swig +# LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}) +# +# # Find and install the proxy file (.py) +# get_target_property(_py_dir DataProducts_swig SWIG_SUPPORT_FILES_DIRECTORY) +# +# install(FILES "${_py_dir}/DataProducts.py" +# DESTINATION ${PYTHON_INSTALL_DIR}) +# +#endif() + install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/DbService/CMakeLists.txt b/DbService/CMakeLists.txt index 7b68bbf518..6c7cd375d1 100644 --- a/DbService/CMakeLists.txt +++ b/DbService/CMakeLists.txt @@ -81,6 +81,11 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/create.sql ${CURRENT_BINARY_DIR} install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Offline/DbService) +if( ${BUILD_PYTHON_INTERFACE} ) + mu2e_swig(DbService_swig src/pywrap.i DbService) +endif() + + install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) install_fhicl(SUBDIRS fcl SUBDIRNAME Offline/DbService/fcl) diff --git a/DbTables/CMakeLists.txt b/DbTables/CMakeLists.txt index db39970084..0fdde01e90 100644 --- a/DbTables/CMakeLists.txt +++ b/DbTables/CMakeLists.txt @@ -13,5 +13,9 @@ cet_make_library( Offline::GeneralUtilities ) +if( ${BUILD_PYTHON_INTERFACE} ) + mu2e_swig(DbTables_swig src/pywrap.i DbTables) +endif() + install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/GeneralUtilities/CMakeLists.txt b/GeneralUtilities/CMakeLists.txt index 0ef0facecb..60c435f543 100644 --- a/GeneralUtilities/CMakeLists.txt +++ b/GeneralUtilities/CMakeLists.txt @@ -47,5 +47,9 @@ cet_make_exec(NAME TwoDPointTest ) +if( ${BUILD_PYTHON_INTERFACE} ) + mu2e_swig(GeneralUtilities_swig src/pywrap.i GeneralUtilities) +endif() + install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/MCDataProducts/CMakeLists.txt b/MCDataProducts/CMakeLists.txt index 101f1ccfa9..b358ec9af2 100644 --- a/MCDataProducts/CMakeLists.txt +++ b/MCDataProducts/CMakeLists.txt @@ -34,6 +34,11 @@ art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults CLASSES_H ${CMAKE_CURRENT_SOURCE_DIR}/src/classes.h DICTIONARY_LIBRARIES Offline::MCDataProducts -) + ) + +if( ${BUILD_PYTHON_INTERFACE} ) + mu2e_swig(MCDataProducts_swig src/pywrap.i MCDataProducts) +endif() + install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) From bb175623cdc7418a203450972ccb7cd3c8be4d55 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sun, 18 Jan 2026 17:14:39 -0600 Subject: [PATCH 049/174] simplify --- CMakeLists.txt | 4 +++- DataProducts/CMakeLists.txt | 2 +- DbService/CMakeLists.txt | 2 +- DbTables/CMakeLists.txt | 2 +- GeneralUtilities/CMakeLists.txt | 2 +- MCDataProducts/CMakeLists.txt | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33494a5c99..eba698c257 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,9 @@ if( ${WITH_G4} ) link_directories($ENV{CRYHOME}/lib) endif() -if( ${BUILD_PYTHON_INTERFACE} ) +# empty defaults to off +option(BUILD_PYTHON_INTERFACE "Generate Python bindings via SWIG" FALSE) +if( BUILD_PYTHON_INTERFACE ) message("--> Adding SWIG calls to generate Python interface") find_package(SWIG REQUIRED EXPORT) include(${SWIG_USE_FILE}) diff --git a/DataProducts/CMakeLists.txt b/DataProducts/CMakeLists.txt index 5ed9c1df33..89b63e4d4b 100644 --- a/DataProducts/CMakeLists.txt +++ b/DataProducts/CMakeLists.txt @@ -27,7 +27,7 @@ art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults Offline::DataProducts ) -if( ${BUILD_PYTHON_INTERFACE} ) +if( BUILD_PYTHON_INTERFACE ) mu2e_swig(DataProducts_swig src/pywrap.i DataProducts) endif() diff --git a/DbService/CMakeLists.txt b/DbService/CMakeLists.txt index 6c7cd375d1..90ad703ce2 100644 --- a/DbService/CMakeLists.txt +++ b/DbService/CMakeLists.txt @@ -81,7 +81,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/create.sql ${CURRENT_BINARY_DIR} install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Offline/DbService) -if( ${BUILD_PYTHON_INTERFACE} ) +if( BUILD_PYTHON_INTERFACE ) mu2e_swig(DbService_swig src/pywrap.i DbService) endif() diff --git a/DbTables/CMakeLists.txt b/DbTables/CMakeLists.txt index 0fdde01e90..c6ddda4549 100644 --- a/DbTables/CMakeLists.txt +++ b/DbTables/CMakeLists.txt @@ -13,7 +13,7 @@ cet_make_library( Offline::GeneralUtilities ) -if( ${BUILD_PYTHON_INTERFACE} ) +if( BUILD_PYTHON_INTERFACE ) mu2e_swig(DbTables_swig src/pywrap.i DbTables) endif() diff --git a/GeneralUtilities/CMakeLists.txt b/GeneralUtilities/CMakeLists.txt index 60c435f543..4f2b28aa0d 100644 --- a/GeneralUtilities/CMakeLists.txt +++ b/GeneralUtilities/CMakeLists.txt @@ -47,7 +47,7 @@ cet_make_exec(NAME TwoDPointTest ) -if( ${BUILD_PYTHON_INTERFACE} ) +if( BUILD_PYTHON_INTERFACE ) mu2e_swig(GeneralUtilities_swig src/pywrap.i GeneralUtilities) endif() diff --git a/MCDataProducts/CMakeLists.txt b/MCDataProducts/CMakeLists.txt index b358ec9af2..a776b39505 100644 --- a/MCDataProducts/CMakeLists.txt +++ b/MCDataProducts/CMakeLists.txt @@ -36,7 +36,7 @@ art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults Offline::MCDataProducts ) -if( ${BUILD_PYTHON_INTERFACE} ) +if( BUILD_PYTHON_INTERFACE ) mu2e_swig(MCDataProducts_swig src/pywrap.i MCDataProducts) endif() From e7ea65e244435012f8c2ee7c7f86b9039a577efc Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Mon, 19 Jan 2026 12:11:06 -0600 Subject: [PATCH 050/174] Add calo and cosmic trigger info to deep clone and ptr collections --- RecoDataProducts/inc/CaloCluster.hh | 1 + RecoDataProducts/inc/CaloTrigSeed.hh | 1 + RecoDataProducts/inc/CosmicTrackSeed.hh | 1 + RecoDataProducts/src/classes_def.xml | 3 + Trigger/src/MergeTriggerInfo_module.cc | 52 +++++++++-------- .../src/TriggerInfoToCollections_module.cc | 57 ++++++++++++++----- 6 files changed, 78 insertions(+), 37 deletions(-) diff --git a/RecoDataProducts/inc/CaloCluster.hh b/RecoDataProducts/inc/CaloCluster.hh index afdb17ebfb..fb918a8858 100644 --- a/RecoDataProducts/inc/CaloCluster.hh +++ b/RecoDataProducts/inc/CaloCluster.hh @@ -54,6 +54,7 @@ namespace mu2e { }; using CaloClusterCollection = std::vector; + using CaloClusterPtrCollection = std::vector>; } #endif diff --git a/RecoDataProducts/inc/CaloTrigSeed.hh b/RecoDataProducts/inc/CaloTrigSeed.hh index dc91e7ea20..c798781b5d 100644 --- a/RecoDataProducts/inc/CaloTrigSeed.hh +++ b/RecoDataProducts/inc/CaloTrigSeed.hh @@ -49,6 +49,7 @@ namespace mu2e { typedef std::vector CaloTrigSeedCollection; + typedef std::vector> CaloTrigSeedPtrCollection; } #endif diff --git a/RecoDataProducts/inc/CosmicTrackSeed.hh b/RecoDataProducts/inc/CosmicTrackSeed.hh index e64693792e..b3f1111ffa 100644 --- a/RecoDataProducts/inc/CosmicTrackSeed.hh +++ b/RecoDataProducts/inc/CosmicTrackSeed.hh @@ -35,6 +35,7 @@ namespace mu2e { std::vector _trkstrawhits; //vector of associated trkstrawhits }; typedef std::vector CosmicTrackSeedCollection; + typedef std::vector> CosmicTrackSeedPtrCollection; } #endif /* RecoDataProducts_CosmicTrackSeed_hh */ diff --git a/RecoDataProducts/src/classes_def.xml b/RecoDataProducts/src/classes_def.xml index 8facbe04b3..7533a92f84 100644 --- a/RecoDataProducts/src/classes_def.xml +++ b/RecoDataProducts/src/classes_def.xml @@ -27,6 +27,7 @@ + @@ -62,12 +63,14 @@ + + diff --git a/Trigger/src/MergeTriggerInfo_module.cc b/Trigger/src/MergeTriggerInfo_module.cc index 297c1a909a..7cd7ca221a 100644 --- a/Trigger/src/MergeTriggerInfo_module.cc +++ b/Trigger/src/MergeTriggerInfo_module.cc @@ -14,6 +14,9 @@ #include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "Offline/RecoDataProducts/inc/HelixSeed.hh" #include "Offline/RecoDataProducts/inc/TimeCluster.hh" +#include "Offline/RecoDataProducts/inc/CaloCluster.hh" +#include "Offline/RecoDataProducts/inc/CaloTrigSeed.hh" +#include "Offline/RecoDataProducts/inc/CosmicTrackSeed.hh" // C++ #include #include @@ -28,8 +31,8 @@ namespace mu2e { using Name = fhicl::Name; using Comment = fhicl::Comment; struct Config { - fhicl::Atom debug { Name("debugLevel"), Comment("Debug Level"), 0}; - fhicl::Atom doDeepCopy{ Name("doDeepCopy") , Comment("Ntupleing mode"), 0}; + fhicl::Atom debug { Name("debugLevel"), Comment("Debug Level"), 0}; + fhicl::Atom doDeepCopy{ Name("doDeepCopy"), Comment("Produce cloned object collections"), 0}; }; using Parameters = art::EDProducer::Table; @@ -42,22 +45,28 @@ namespace mu2e { MergeTriggerInfo::MergeTriggerInfo(const Parameters& config) : art::EDProducer{config}, - _debug (config().debug()), + _debug (config().debug()), _doDeepCopy(config().doDeepCopy()) { - produces (); + produces(); if (_doDeepCopy == 1){ - produces(); - produces(); - produces(); + produces(); + produces(); + produces(); + produces(); + produces(); + produces(); } } void MergeTriggerInfo::produce(art::Event& event) { - std::unique_ptr tiCol(new TriggerInfoCollection); - std::unique_ptr ksCol(new KalSeedCollection); - std::unique_ptr hsCol(new HelixSeedCollection); - std::unique_ptr tcCol(new TimeClusterCollection); + std::unique_ptr tiCol(new TriggerInfoCollection); + std::unique_ptr ksCol((_doDeepCopy) ? new KalSeedCollection : nullptr); + std::unique_ptr hsCol((_doDeepCopy) ? new HelixSeedCollection : nullptr); + std::unique_ptr tcCol((_doDeepCopy) ? new TimeClusterCollection : nullptr); + std::unique_ptr ccCol((_doDeepCopy) ? new CaloClusterCollection : nullptr); + std::unique_ptr ctCol((_doDeepCopy) ? new CaloTrigSeedCollection : nullptr); + std::unique_ptr csCol((_doDeepCopy) ? new CosmicTrackSeedCollection : nullptr); std::vector > list_of_triggerInfo = event.getMany(); @@ -71,18 +80,12 @@ namespace mu2e { std::cout << "["<push_back(trk); - } - for (auto hsPtr : trigInfo.helixes()){ - HelixSeed hs(*hsPtr.get()); - hsCol->push_back(hs); - } - for (auto tcPtr : trigInfo.hitClusters()){ - TimeCluster tc(*tcPtr.get()); - tcCol->push_back(tc); - } + for(auto ptr : trigInfo.tracks ()) ksCol->push_back(*(ptr.get())); + for(auto ptr : trigInfo.helixes ()) hsCol->push_back(*(ptr.get())); + for(auto ptr : trigInfo.hitClusters ()) tcCol->push_back(*(ptr.get())); + for(auto ptr : trigInfo.caloClusters ()) ccCol->push_back(*(ptr.get())); + for(auto ptr : trigInfo.caloTrigSeeds()) ctCol->push_back(*(ptr.get())); + for(auto ptr : trigInfo.cosmics ()) csCol->push_back(*(ptr.get())); } tiCol->push_back(trigInfo); } @@ -92,6 +95,9 @@ namespace mu2e { event.put(std::move(ksCol)); event.put(std::move(hsCol)); event.put(std::move(tcCol)); + event.put(std::move(ccCol)); + event.put(std::move(ctCol)); + event.put(std::move(csCol)); } } } diff --git a/Trigger/src/TriggerInfoToCollections_module.cc b/Trigger/src/TriggerInfoToCollections_module.cc index 084b2ab96a..924083492c 100644 --- a/Trigger/src/TriggerInfoToCollections_module.cc +++ b/Trigger/src/TriggerInfoToCollections_module.cc @@ -17,6 +17,9 @@ #include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "Offline/RecoDataProducts/inc/HelixSeed.hh" #include "Offline/RecoDataProducts/inc/TimeCluster.hh" +#include "Offline/RecoDataProducts/inc/CaloCluster.hh" +#include "Offline/RecoDataProducts/inc/CaloTrigSeed.hh" +#include "Offline/RecoDataProducts/inc/CosmicTrackSeed.hh" // C++ #include @@ -37,9 +40,12 @@ namespace mu2e { void produce(art::Event& evt) override; void fillContainers(const TriggerInfo& info, - KalSeedPtrCollection& trkCol, - HelixSeedPtrCollection& hlxCol, - TimeClusterPtrCollection& tclCol); + KalSeedPtrCollection& trkCol, + HelixSeedPtrCollection& hlxCol, + TimeClusterPtrCollection& tclCol, + CaloClusterPtrCollection& cclCol, + CaloTrigSeedPtrCollection& ctsCol, + CosmicTrackSeedPtrCollection& csmCol); // Check if a given Ptr is already included in a vector of Ptrs template bool included(const art::Ptr& ptr, const std::vector>& vec) { @@ -59,16 +65,22 @@ namespace mu2e { , _tag(config().tag()) , _debug(config().debug()) { - produces(); - produces(); - produces(); + produces(); + produces(); + produces(); + produces(); + produces(); + produces(); } // Fill the output Ptr collections from a TriggerInfo object void TriggerInfoToCollections::fillContainers(const TriggerInfo& info, - KalSeedPtrCollection& trkCol, - HelixSeedPtrCollection& hlxCol, - TimeClusterPtrCollection& tclCol) { + KalSeedPtrCollection& trkCol, + HelixSeedPtrCollection& hlxCol, + TimeClusterPtrCollection& tclCol, + CaloClusterPtrCollection& cclCol, + CaloTrigSeedPtrCollection& ctsCol, + CosmicTrackSeedPtrCollection& csmCol) { // Add each trigger info object content to the output collections if not already included for(auto ptr : info.tracks()) { if(!included(ptr, trkCol)) trkCol.push_back(ptr); @@ -79,12 +91,24 @@ namespace mu2e { for(auto ptr : info.hitClusters()) { if(!included(ptr, tclCol)) tclCol.push_back(ptr); } + for(auto ptr : info.caloClusters()) { + if(!included(ptr, cclCol)) cclCol.push_back(ptr); + } + for(auto ptr : info.caloTrigSeeds()) { + if(!included(ptr, ctsCol)) ctsCol.push_back(ptr); + } + for(auto ptr : info.cosmics()) { + if(!included(ptr, csmCol)) csmCol.push_back(ptr); + } } void TriggerInfoToCollections::produce(art::Event& event) { - std::unique_ptr trkCol(new KalSeedPtrCollection ); - std::unique_ptr hlxCol(new HelixSeedPtrCollection ); - std::unique_ptr tclCol(new TimeClusterPtrCollection); + std::unique_ptr trkCol(new KalSeedPtrCollection ); + std::unique_ptr hlxCol(new HelixSeedPtrCollection ); + std::unique_ptr tclCol(new TimeClusterPtrCollection ); + std::unique_ptr cclCol(new CaloClusterPtrCollection ); + std::unique_ptr ctsCol(new CaloTrigSeedPtrCollection ); + std::unique_ptr csmCol(new CosmicTrackSeedPtrCollection); art::Handle info_coll_handle; // output from MergeTriggerInfo art::Handle info_handle; // output from a single trigger filter instance @@ -93,7 +117,8 @@ namespace mu2e { // fill the output Ptr collections with the trigger info collections for(const auto& info : *infos) { - fillContainers(info, *trkCol, *hlxCol, *tclCol); + fillContainers(info, *trkCol, *hlxCol, *tclCol, + *cclCol, *ctsCol, *csmCol); } // report information if requested @@ -102,7 +127,8 @@ namespace mu2e { __func__, moduleDescription().moduleLabel().c_str(), infos->size(), trkCol->size(), hlxCol->size(), tclCol->size()); } } else if(event.getByLabel(_tag, info_handle)) { // check for a single TriggerInfo object by this label - fillContainers(*info_handle.product(), *trkCol, *hlxCol, *tclCol); + fillContainers(*info_handle.product(), *trkCol, *hlxCol, *tclCol, + *cclCol, *ctsCol, *csmCol); // report information if requested if(_debug > 1 || (_debug > 0 && !trkCol->empty())) { @@ -120,6 +146,9 @@ namespace mu2e { event.put(std::move(trkCol)); event.put(std::move(hlxCol)); event.put(std::move(tclCol)); + event.put(std::move(cclCol)); + event.put(std::move(ctsCol)); + event.put(std::move(csmCol)); } } DEFINE_ART_MODULE(mu2e::TriggerInfoToCollections) From 1bf26f73502983e9d00d8a339fe794bb857e4f94 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Mon, 19 Jan 2026 19:11:00 -0600 Subject: [PATCH 051/174] create CalEnergCalib --- DbService/data/create.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DbService/data/create.sql b/DbService/data/create.sql index 9a548bd708..5c064c2577 100644 --- a/DbService/data/create.sql +++ b/DbService/data/create.sql @@ -425,3 +425,10 @@ CREATE TABLE cal.cosmicenergycalibinfo GRANT SELECT ON cal.cosmicenergycalibinfo TO PUBLIC; GRANT INSERT ON cal.cosmicenergycalibinfo TO cal_role; +CREATE TABLE cal.energycalib + (cid INTEGER, + roid INTEGER, adc2mev NUMERIC, + CONSTRAINT cal_energycalib_pk PRIMARY KEY (cid,roid) ); +GRANT SELECT ON cal.energycalib TO PUBLIC; +GRANT INSERT ON cal.energycalib TO cal_role; + From abd80ca9ea33ccea92dca2a99433a1f91f6ed40d Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Tue, 20 Jan 2026 04:55:19 -0600 Subject: [PATCH 052/174] small changes to CRV calibration --- CRVReco/src/CrvCalibration_module.cc | 17 +++++++++++------ CRVReco/src/CrvRecoPulsesFinder_module.cc | 4 ++++ CRVReco/src/CrvTimingStudies_module.cc | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 02e916d603..de324e7ec1 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -49,10 +49,10 @@ namespace mu2e fhicl::Atom minPeakPulseArea{Name("minPeakPulseArea"), Comment("minimum accepted SPE peak for pulseArea histogram"), 250.0}; fhicl::Atom minPeakPulseHeight{Name("minPeakPulseHeight"), Comment("minimum accepted SPE peak for pulseHeight histogram"), 10.0}; fhicl::Atom minHistEntries{Name("minHistEntries"), Comment("minimum number of entries required for a fit"), 100}; - fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum. numbers less then 4 result in warnings"), 100}; + fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; - fhicl::Atom peakRatioTolerance{Name("peakRatioTolerance"), Comment("allowed deviation of the ratio between 1PE peak and 2PE peak from 2.0"), 0.2}; + //fhicl::Atom peakRatioTolerance{Name("peakRatioTolerance"), Comment("allowed deviation of the ratio between 1PE peak and 2PE peak from 2.0"), 0.2}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; @@ -76,7 +76,7 @@ namespace mu2e int _spectrumNPeaks; double _spectrumPeakSigma; double _spectrumPeakThreshold; - double _peakRatioTolerance; +// double _peakRatioTolerance; std::string _tmpDBfileName; std::vector _calibHistsPulseArea; std::vector _calibHistsPulseHeight; @@ -106,7 +106,7 @@ namespace mu2e _spectrumNPeaks(conf().spectrumNPeaks()), _spectrumPeakSigma(conf().spectrumPeakSigma()), _spectrumPeakThreshold(conf().spectrumPeakThreshold()), - _peakRatioTolerance(conf().peakRatioTolerance()), +// _peakRatioTolerance(conf().peakRatioTolerance()), _tmpDBfileName(conf().tmpDBfileName()) { } @@ -245,10 +245,15 @@ namespace mu2e { if(hist->GetEntries()<_minHistEntries) return false; //not enough data - size_t nPeaks = spectrum.Search(hist,_spectrumPeakSigma,"nodraw",_spectrumPeakThreshold); - if(nPeaks==0) return false; + int nPeaks = spectrum.Search(hist,_spectrumPeakSigma,"nodraw",_spectrumPeakThreshold); + if(nPeaks<=0) return false; //peaks are returned sorted by Y + //from our long-time experience: + //-SPE peak is either the highest peak or second highest peak + //-if the SPE peak is the second highest, then the highest peak comes from the baseline + //-the peak from the baseline is always below the minPeak threshold, while the SPE peak is not + //-the minPeak threshold may have to be adjusted for non-standard bias voltages double *peaksX = spectrum.GetPositionX(); double x=peaksX[0]; if(xconf().minADCdifference()) + throw cet::exception("CRVRECO_BAD_CONFIG") + << "CrvRecoPulseFinder pulseAreaThreshold " << conf().pulseAreaThreshold() + << " larger than minADCdifference " << conf().minADCdifference(); produces(_NZSdata?"NZS":""); _makeCrvRecoPulses=boost::shared_ptr(new mu2eCrv::MakeCrvRecoPulses(conf().minADCdifference(), conf().defaultBeta(), diff --git a/CRVReco/src/CrvTimingStudies_module.cc b/CRVReco/src/CrvTimingStudies_module.cc index 13b5338aa2..c09549497e 100644 --- a/CRVReco/src/CrvTimingStudies_module.cc +++ b/CRVReco/src/CrvTimingStudies_module.cc @@ -113,6 +113,7 @@ namespace mu2e uint16_t febChannel = onlineChannel.FEBchannel(); uint16_t fpgaIndex = ((ROC-1)*CRVId::nFEBPerROC*CRVId::nChanPerFEB+(feb-1)*CRVId::nChanPerFEB+febChannel)/(CRVId::nChanPerFEB/CRVId::nFPGAPerFEB); +// uint16_t fpgaIndex = ((ROC-1)*CRVId::nFEBPerROC*CRVId::nChanPerFEB+(feb-1)*CRVId::nChanPerFEB+febChannel)/(CRVId::nChanPerFEB/8); fpgaTimes[fpgaIndex].push_back(recoPulseTime); } From bb6e95ecd1a2c14eaf97abca533e3880ec06ea7b Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Wed, 21 Jan 2026 13:07:34 -0600 Subject: [PATCH 053/174] Switch from typdef to using --- RecoDataProducts/inc/CaloTrigSeed.hh | 4 ++-- RecoDataProducts/inc/CosmicTrackSeed.hh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RecoDataProducts/inc/CaloTrigSeed.hh b/RecoDataProducts/inc/CaloTrigSeed.hh index c798781b5d..9e6143b5e1 100644 --- a/RecoDataProducts/inc/CaloTrigSeed.hh +++ b/RecoDataProducts/inc/CaloTrigSeed.hh @@ -48,8 +48,8 @@ namespace mu2e { }; - typedef std::vector CaloTrigSeedCollection; - typedef std::vector> CaloTrigSeedPtrCollection; + using CaloTrigSeedCollection = std::vector; + using CaloTrigSeedPtrCollection = std::vector>; } #endif diff --git a/RecoDataProducts/inc/CosmicTrackSeed.hh b/RecoDataProducts/inc/CosmicTrackSeed.hh index b3f1111ffa..d12e084764 100644 --- a/RecoDataProducts/inc/CosmicTrackSeed.hh +++ b/RecoDataProducts/inc/CosmicTrackSeed.hh @@ -34,8 +34,8 @@ namespace mu2e { std::vector const& trkstrawhits() const { return _trkstrawhits;} std::vector _trkstrawhits; //vector of associated trkstrawhits }; - typedef std::vector CosmicTrackSeedCollection; - typedef std::vector> CosmicTrackSeedPtrCollection; + using CosmicTrackSeedCollection = std::vector; + using CosmicTrackSeedPtrCollection = std::vector>; } #endif /* RecoDataProducts_CosmicTrackSeed_hh */ From 58d91838889d7fa267917cdf6cc6fb72c1711501 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Wed, 21 Jan 2026 15:41:14 -0600 Subject: [PATCH 054/174] remove development code --- DataProducts/CMakeLists.txt | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/DataProducts/CMakeLists.txt b/DataProducts/CMakeLists.txt index 89b63e4d4b..e0e4d33c2b 100644 --- a/DataProducts/CMakeLists.txt +++ b/DataProducts/CMakeLists.txt @@ -31,37 +31,6 @@ if( BUILD_PYTHON_INTERFACE ) mu2e_swig(DataProducts_swig src/pywrap.i DataProducts) endif() -#if( ${BUILD_PYTHON_INTERFACE} ) -# set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/swig_gen) -# -# # Compile the generated lib like c++ -# set_property(SOURCE src/pywrap.i PROPERTY CPLUSPLUS ON) -# -# # Define the swig gen library -# swig_add_library( -# DataProducts_swig -# LANGUAGE Python -# SOURCES src/pywrap.i -# ) -# -# # use the target's include directories -# set_property(TARGET DataProducts_swig PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) -# -# # Standard CMake command to add the include path to the target -# target_include_directories(DataProducts_swig PRIVATE ${PROJECT_SOURCE_DIR}) -# -# target_link_libraries(DataProducts_swig PUBLIC Python3::Module Python3::Python DataProducts) -# -# install(TARGETS DataProducts_swig -# LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}) -# -# # Find and install the proxy file (.py) -# get_target_property(_py_dir DataProducts_swig SWIG_SUPPORT_FILES_DIRECTORY) -# -# install(FILES "${_py_dir}/DataProducts.py" -# DESTINATION ${PYTHON_INSTALL_DIR}) -# -#endif() install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) From 65fcfedb6c36f2f4ae195c033a06eba81f9a035c Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Wed, 21 Jan 2026 16:37:47 -0600 Subject: [PATCH 055/174] Check if dz makes sense, minor edits --- CalPatRec/inc/CalHelixFinderAlg.hh | 12 ++++++- CalPatRec/src/CalHelixFinderAlg.cc | 58 ++++++++++++++++++------------ 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index 3bef9d79f5..9abd555b8f 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -20,6 +20,7 @@ #include "Offline/Mu2eUtilities/inc/LsqSums2.hh" #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" +#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" // #include "CalPatRec/inc/CalTimePeak.hh" //#include "CalPatRec/inc/CalHelixPoint.hh" #include "Offline/CalPatRec/inc/CalHelixFinderData.hh" @@ -93,6 +94,7 @@ namespace mu2e { float fCaloX; float fCaloY; float fCaloZ; + float fCaloOffset; // std::vector _xyzp; // normally includes only hits from the time peak //----------------------------------------------------------------------------- @@ -327,7 +329,15 @@ namespace mu2e { // setters //----------------------------------------------------------------------------- void setTracker (const Tracker* Tracker) { _tracker = Tracker; } - void setCalorimeter(const Calorimeter* Cal ) { _calorimeter = Cal ; } + void setCalorimeter(const Calorimeter* Cal ) { + _calorimeter = Cal; + fCaloOffset = (_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") + ); + } //----------------------------------------------------------------------------- // diagnostics //----------------------------------------------------------------------------- diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 1e89c6be8a..bcdaeb8c76 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -15,7 +15,6 @@ #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" #include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/RecoDataProducts/inc/StrawHit.hh" #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" @@ -191,6 +190,8 @@ namespace mu2e { bitnames.push_back("Outlier"); bitnames.push_back("OtherBackground"); //mu2e::ComboHit::_useflag = StrawHitFlag(bitnames); + _calorimeter = nullptr; + _tracker = nullptr; } //----------------------------------------------------------------------------- @@ -252,8 +253,7 @@ namespace mu2e { fCaloTime = cl->time(); fCaloX = tpos.x(); fCaloY = tpos.y(); - 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; + fCaloZ = tpos.z()-fCaloOffset; } @@ -754,8 +754,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[50], minX(0), maxX(0.025), stepX(0.0005), nbinsX(50); // make it 20 bins: gianipez test 2019-09-23 + constexpr int nbinsX(50); + float hist[nbinsX], minX(0), maxX(0.025), stepX((maxX - minX)/nbinsX); // histogram binning XYZVectorF* center = &Helix._center; XYZVectorF pos_ref; @@ -769,18 +769,21 @@ namespace mu2e { center->x(), center->y(), Helix._radius,Helix._nStrawHits); } - int nstations, nhits[30], nstations_with_hits(0); - float phiVec[30], zVec[30], weight(0); + constexpr int max_station_index = 30; // safe value, larger than N(stations) + const int nstations = StrawId::_nstations; + if(max_station_index < nstations) throw cet::exception("RECO") << "More stations than written to handle!"; + + int nhits [max_station_index], nstations_with_hits(0); + float phiVec[max_station_index], zVec[max_station_index], weight(0); - nstations = StrawId::_nstations; for (int i=0; ihasCaloCluster())) { - dz = -dz; + if (dz < 0.) { + if(!Helix._timeCluster->hasCaloCluster()) { // in the case we're using a tracker hit, just take the absolute |dz| + dz = -dz; + } else { // if not using a tracker hit as a cluster, then throw an error + throw cet::exception("RECO") << "Delta z < 0: z(cluster) = " << zCl + << " z(1) = " << z_ref << " z(2) = " << zVec[j] << "\n"; + } } float dphidz =dphi/dz*_dfdzsign; //HERE @@ -882,7 +890,7 @@ namespace mu2e { //----------------------------------------------------------------------------- int n(0), nmax(0), nmin(0), nchoices = 0; - float x = dphidz + n*2*M_PI/dz; + float x = dphidz; if (x < _minDfDz) { //----------------------------------------------------------------------------- // for n=0, x < _minDfDz @@ -899,11 +907,11 @@ namespace mu2e { //----------------------------------------------------------------------------- // for n=0, _xMin <= x < _xMax //----------------------------------------------------------------------------- - while (x < _maxDfDz) { - nmax = n; - if ((x > _minDfDz) && (x < _maxDfDz)) nchoices += 1; - n += 1; - x += 2*M_PI/dz; + while (x < _maxDfDz) { + nmax = n; + if ((x > _minDfDz) && (x < _maxDfDz)) nchoices += 1; + n += 1; + x += 2*M_PI/dz; } nmin = 0; @@ -936,8 +944,8 @@ namespace mu2e { // histogram is from //----------------------------------------------------------------------------- for (int n=nmin; n<=nmax; n++) { // - float x = dphidz + n*2*M_PI/dz; - int bin = (x-minX)/stepX; + const float x = dphidz + n*2.*M_PI/dz; + const int bin = std::min(nbinsX, int((x-minX)/stepX)); hist[bin] += weight; } } @@ -1582,6 +1590,12 @@ namespace mu2e { //------------------------------------------------------------------------- void CalHelixFinderAlg::fillFaceOrderedHits(CalHelixFinderData& Helix) { +//----------------------------------------------------------------------------- +// Ensure the tracker and calorimeter utils are available +//----------------------------------------------------------------------------- + if(!_tracker ) throw cet::exception("RECO") << ": Tracker util not initialized!\n"; + if(!_calorimeter) throw cet::exception("RECO") << ": Calorimeter util not initialized!\n"; + //----------------------------------------------------------------------------- // set the CaloCluster of CalHelixFinderAlg: this info is stored in the TimeCluster //----------------------------------------------------------------------------- From 5d02a3a96b3bd112c953b3b121074cd5a9a501b3 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Thu, 22 Jan 2026 16:03:32 -0600 Subject: [PATCH 056/174] Remove some while loops, remove old comments --- CalPatRec/inc/CalHelixFinderAlg.hh | 2 - CalPatRec/src/CalHelixFinderAlg.cc | 490 +++-------------------------- 2 files changed, 40 insertions(+), 452 deletions(-) diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index 9abd555b8f..7ae95ea396 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -316,8 +316,6 @@ namespace mu2e { // bool findHelix (CalHelixFinderData& Helix, const CalTimePeak* TimePeak); bool findHelix (CalHelixFinderData& Helix); int findDfDz (CalHelixFinderData& Helix, HitInfo_t SeedIndex, int Diag_flag=0); - int findDfDz_1 (CalHelixFinderData& Helix, HitInfo_t SeedIndex, int Diag_flag=0); - int findDfDz_2 (CalHelixFinderData& Helix, HitInfo_t SeedIndex, int Diag_flag=0); void findTrack (HitInfo_t& SeedIndex, CalHelixFinderData& Helix, int UseMPVdfdz = 0); diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index bcdaeb8c76..28f033073c 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -372,398 +372,19 @@ namespace mu2e { return retval; } -//----------------------------------------------------------------------------- - int CalHelixFinderAlg::findDfDz(CalHelixFinderData& Helix, - HitInfo_t SeedIndex, - // int *IndexVec, - int Diag_flag) { - // return findDfDz_1(Helix, SeedIndex, IndexVec, Diag_flag); - return findDfDz_2(Helix, SeedIndex, Diag_flag); - } - //---------------------------------------------------------------------------------------- // 2015-01-13 calculate track DphiDz using histogrammed distribution of the dfdz residuals //---------------------------------------------------------------------------------------- - int CalHelixFinderAlg::findDfDz_1(CalHelixFinderData& Helix, HitInfo_t SeedIndex, int Diag_flag) { - -// float phi, phi_ref(-1e10), z, z_ref, dphi, dz, dzOverHelPitch; - -// CLHEP::Hep3Vector* center = &Helix._center; -// CLHEP::Hep3Vector pos_ref; - -// _hDfDzRes->Reset(); -// _hPhi0Res->Reset(); -// // 2015 - 03 -30 G. Pezzu changed the value of tollMax. -// // using the initial value of dfdz we can set it more accuratelly: -// // tollMax = half-helix-step = Pi / dfdz -// float tollMin(100.); -// //----------------------------------------------------------------------------- -// // 2017-09-26 gianipez fixed a bug: in case the Helix phi-z fit didn't converge yet, -// // Helix._dfdz is set to -1e6, so we need to make a check here! -// // this is a tempOrary fix that doesn't take into account the particle helicity. FIX ME! -// //----------------------------------------------------------------------------- -// float helix_dfdz(_mpDfDz); -// // 2017-11-14 gianipez: findDfDz shoudl use the dfdz value obtained only from the linearFit -// if (Helix._szphi.qn() >= 10) helix_dfdz = Helix._szphi.dfdz(); -// // if (Helix._dfdz > 0) helix_dfdz = Helix._dfdz; -// float tollMax = 2.*M_PI / helix_dfdz; - -// if (_debug > 5) { -// printf("[CalHelixFinderAlg::findDfDz:BEGIN] x0 = %9.3f y0 = %9.3f Helix._radius = %9.3f", -// center->x(), center->y(), Helix._radius); -// printf("helix_dfdz = %9.6f Helix._nStrawHits = %3i tollMax = %8.6f\n",helix_dfdz, Helix._nStrawHits, tollMax); -// } - -// int nstations, nhits[30]; -// float phiVec[30], zVec[30], weight(0), weight_cl(0); -// PanelZ_t* panelz(0); - -// // np = _xyzp.size(); -// nstations = _tracker->nStations(); - -// for (int i=0; ifNHits; -// int seedPanelIndex(0); -// if (nhitsPerPanel == 0) continue; -// if (p==SeedIndex.Panel) seedPanelIndex = SeedIndex.PanelHitIndex; - -// for (int i=seedPanelIndex; i_chHitsToProcess.at(i); -// int index = p*FaceZ_t::kNMaxHitsPerPanel + i; -// if (Helix._hitsUsed[index] != 1) continue; - -// int ist = hit->_straw->id().getStation(); // station number -// phi = polyAtan2(hit->y()-center->y(),hit->x()-center->x()); // atan2 returns its result in [-pi,pi], convert to [0,2pi] -// if (phi < 0) phi += 2*M_PI; -// zVec [ist] += hit->z(); -// //----------------------------------------------------------------------------- -// // make sure there all hits within the station get close values of phi, although a -// // common 2pi ambiguity is still unresolved -// //----------------------------------------------------------------------------- -// if (nhits[ist] == 0) phiVec[ist] = phi; -// else { -// while (phi-phiVec[ist] > M_PI) phi -= 2*M_PI; -// while (phi-phiVec[ist] < -M_PI) phi += 2*M_PI; - -// phiVec[ist] = (phiVec[ist]*nhits[ist]+phi)/(nhits[ist]+1); -// } -// nhits [ist] += 1; -// } -// } - -// for (int i=0; i 0) { -// zVec [i] = zVec [i]/nhits[i]; -// } -// } - -// if (_debug >5) { -// printf("[CalHelixFinderAlg::findDfDz] StationID nhits z phi\n"); -// for (int i=0; i 0) printf("[CalHelixFinderAlg::findDfDz] %5i %6i %9.3f %8.5f\n", i,nhits[i],zVec[i],phiVec[i]); -// } -// } - -// int i0(-1), first_point(1); -// // add the cluster phi -// float zCl = fCaloZ; -// float phiCl = polyAtan2(fCaloY-center->y(),fCaloX-center->x()); -// if (phiCl < 0) phiCl += 2*M_PI; - -// for (int i=0; i -9999) && (dzOverHelPitch < _dzOverHelPitchCut) && (dz > tollMin)) { -// if (dz > tollMin) { -// dphi = phi-phi_ref; -// while (dphi > M_PI) dphi -= 2*M_PI; -// while (dphi < -M_PI) dphi += 2*M_PI; -// //----------------------------------------------------------------------------- -// // add 2*PI to take into account the fact we are in the second loop -// // FIX ME: what to do if we are in the third loop? -// //----------------------------------------------------------------------------- -// if (dz > tollMax) dphi += 2*M_PI*int(dz/tollMax); - -// float dphidz = dphi/dz; -// while (dphidz < 0.) { -// dphi = dphi+2.*M_PI; -// dphidz = dphi/dz; -// } -// _hDfDzRes->Fill(dphidz, weight); - -// float tmpphi0 = phi_ref - dphidz*z_ref; -// tmpphi0 = TVector2::Phi_0_2pi(tmpphi0); - -// if (_debug > 5) { -// printf("[CalHelixFinderAlg::findDfDz:1] z_ref: %9.3f z: %9.3f dz: %9.3f",z_ref,z,dz); -// printf(" phi_ref: %9.5f phi: %9.5f dphi: %9.5f dz/HelPitch: %10.3f dphi/dz: %9.5f phi0 = %9.6f\n", -// phi_ref,phi,dphi, dzOverHelPitch, dphidz, tmpphi0); -// } -// //----------------------------------------------------------------------------- -// // in case dfdz is out of limits, set tmpphi0 as negative -// //----------------------------------------------------------------------------- -// if ((dphidz < _minDfDz) || (dphidz > _maxDfDz)) tmpphi0 = -1; -// _hPhi0Res->Fill(tmpphi0, weight); -// } -// } -// //----------------------------------------------------------------------------- -// // include the calorimeter cluster phi -// //----------------------------------------------------------------------------- -// dz = zCl - z_ref; -// dzOverHelPitch = dz/tollMax - int(dz/tollMax); -// weight_cl = nhits[i]; - -// // if ((dzOverHelPitch < _dzOverHelPitchCut) && (dz > tollMin)) { -// if (dz > tollMin) { -// dphi = phiCl - phi_ref; -// dphi = TVector2::Phi_0_2pi(dphi); -// //----------------------------------------------------------------------------- -// // add 2 pi for taking into account the fact we are in the second loop -// // *FIX ME*: what if we are in the third loop? -// //----------------------------------------------------------------------------- -// if (dz > tollMax) dphi += 2*M_PI*int(dz/tollMax); - -// float dphidz = dphi/dz; -// while (dphidz < 0.) { -// dphi += 2.*M_PI; -// dphidz = dphi/dz; -// } - -// float tmpphi0 = phi_ref - dphidz*z_ref; -// tmpphi0 = TVector2::Phi_0_2pi(tmpphi0); - -// if (_debug > 5){ -// printf("[CalHelixFinderAlg::findDfDz:2] z_ref: %9.3f z: %9.3f dz: %9.3f",z_ref,zCl,dz); -// printf(" phi_ref: %9.5f phi: %9.5f dphi: %9.5f dz/HelPitch: %10.3f dphi/dz: %9.5f phi0 = %9.6f\n", -// phi_ref,phiCl,dphi, dzOverHelPitch, dphidz, tmpphi0); -// } - -// if (dzOverHelPitch < _dzOverHelPitchCut ) { -// _hDfDzRes->Fill(dphidz, weight_cl); -// if ((dphidz < _minDfDz) || (dphidz > _maxDfDz)) tmpphi0 = -1; -// _hPhi0Res->Fill(tmpphi0, weight_cl); -// } -// } -// } -// //----------------------------------------------------------------------------- -// // 2015 - 04- 02 G. Pezzu changed the way the maximum is searched -// // since sometimes a 2pi ambiguity creates two peaks in the histogram -// // we want to use the second, because it is the correct one -// //----------------------------------------------------------------------------- -// float maxContent = _hDfDzRes->GetMaximum() - 0.001; -// int maxBin = _hDfDzRes->FindLastBinAbove(maxContent);//GetMaximumBin(); -// _hdfdz = _hDfDzRes->GetBinCenter(maxBin);//_hDfDzRes->GetMean(); -// float dfdzmean = _hDfDzRes->GetMean(); -// int nentries = _hDfDzRes->GetEntries(); -// int overflows = _hDfDzRes->GetBinContent(0) + _hDfDzRes->GetBinContent(_hDfDzRes->GetNbinsX()+1); - -// maxContent = _hPhi0Res->GetMaximum() - 0.001; -// maxBin = _hPhi0Res->FindLastBinAbove(maxContent);//GetMaximumBin(); - -// float mpvphi0 = _hPhi0Res->GetBinCenter(maxBin); //_hPhi0Res->GetMean(); -// float menaphi0 = _hPhi0Res->GetMean(); -// int nentriesphi = _hPhi0Res->GetEntries(); - -// _hphi0 = mpvphi0; // 2018-01-05: *FLOAT_CHECK* - -// if (_debug > 5) { -// printf("[CalHelixFinderAlg::findDfDz:DFDZ] nent: %3i mpvDfDz: %9.6f meanDphiDz: %9.6f under: %3.0f over: %3.0f ENTRIES:", -// nentries, _hdfdz, dfdzmean, -// _hDfDzRes->GetBinContent(0),_hDfDzRes->GetBinContent(_hDfDzRes->GetNbinsX()+1) -// ); -// for (int i=0; i<_hDfDzRes->GetNbinsX(); i++) { -// printf(" %3.0f",_hDfDzRes->GetBinContent(i+1)); -// } -// printf("\n"); - -// printf("[CalHelixFinderAlg::findDfDz:PHI0] nent: %3i mpvPhi0: %9.6f meanPhi0 : %9.6f under: %3.0f over: %3.0f ENTRIES:", -// nentriesphi, mpvphi0, menaphi0, -// _hPhi0Res->GetBinContent(0),_hPhi0Res->GetBinContent(_hPhi0Res->GetNbinsX()+1) -// ); -// for (int i=0; i<_hPhi0Res->GetNbinsX(); i++) { -// printf(" %3.0f",_hPhi0Res->GetBinContent(i+1)); -// } -// printf("\n"); -// } -// //----------------------------------------------------------------------------- -// // Part 2: try to perform a more accurate estimate - straight line fit -// //----------------------------------------------------------------------------- -// float z0, phi0, dphidz, pred; - -// z0 = 0. ; -// phi0 = _hphi0; -// dphidz = _hdfdz; -// // _sdfdz = -1; - -// if (_debug > 5) { -// float tmpphi0=phi0+dphidz*z0; -// printf("[CalHelixFinderAlg::findDfDz:PART2] phi0 = %9.6f dfdz = %9.6f\n", tmpphi0, dphidz); -// } -// //-------------------------------------------------------------------------------- -// // 2015-03-25 G. Pezzu changed the way the 2PI ambiguity is resolved -// //-------------------------------------------------------------------------------- -// LsqSums4 szphi; - -// weight = 1./(_sigmaPhi*_sigmaPhi); - -// float xdphi, zLast(z0), zdist; - -// if (_debug > 5) { -// printf("[CalHelixFinderAlg::findDfDz:LOOP] i z dz phiVec phi szphi.dfdz dphi xdphi dfdz \n"); -// } - -// dz = zCl - z0; -// dphi = dz*dphidz + phi0 - phiCl; -// while (dphi > M_PI){ -// phiCl += 2*M_PI; -// dphi -= 2*M_PI; // dz*dphidz + phi0 - phiCl; -// } -// while (dphi < -M_PI){ -// phiCl -= 2*M_PI; -// dphi += 2*M_PI; // = dz*dphidz + phi0 - phiCl; -// } - -// float errCl = 2./30.; -// float weightCl = 1./(errCl*errCl); - -// xdphi = fabs(dphi)/errCl; -// //----------------------------------------------------------------------------- -// // 2015-04-21 Gianipez added the condition (xdphi < 2.*_maxXDPhi) for adding or not -// // the calorimeter point to the fitter. In case the particle scattered in the end of the tracker -// // the calorimeter point is dangerous. -// //----------------------------------------------------------------------------- -// if (xdphi < 2.*_maxXDPhi){ -// szphi.addPoint(zCl, phiCl, weightCl); -// } - -// if (_debug > 10) { -// printf("[CalHelixFinderAlg::findDfDz:LOOP] %3i %9.3f %9.3f %9.5f %9.5f %9.6f %9.6f %9.6f %9.6f\n", -// 0, zCl, dz, phiCl, phiCl, szphi.dfdz(), dphi, xdphi, dphidz); -// } - -// // 2015-07-06 Gianipez added the following line for avoiding infinite loops -// if ( i0 < 0 ) goto NEXT_STEP; - -// for (int i=i0; i 0) { -// z = zVec[i]; -// dz = z-z0; -// pred = phi0 + dz*dphidz; -// phi = phiVec[i]; -// dphi = phi - pred;//pred - phi; - -// while (dphi > M_PI){ -// phi -= 2*M_PI;//+= 2*M_PI; -// dphi = phi - pred;//pred - phi; -// } -// while (dphi < -M_PI){ -// phi += 2*M_PI;//-= 2*M_PI; -// dphi = phi - pred;//pred - phi; -// } - -// xdphi = fabs(dphi)/_sigmaPhi; - -// if (xdphi < 2.*_maxXDPhi){ -// szphi.addPoint(z, phi, weight); - -// zdist = z - zLast; - -// if ( (szphi.qn() >= 3.) && (zdist > 500.)){ -// z0 = 0.; -// phi0 = szphi.phi0(); -// dphidz = szphi.dfdz(); -// } -// } - -// if (_debug > 10) { -// float tmpDfDz = szphi.dfdz();//, Helix._szphi.chi2DofLine()); -// printf("[CalHelixFinderAlg::findDfDz:LOOP] %3i %9.3f %9.3f %9.5f %9.5f %9.6f %9.6f %9.6f %9.6f\n", -// i, z, dz, phiVec[i], phi, tmpDfDz, dphi, xdphi, dphidz); -// } -// } -// } - -// NEXT_STEP:; - -// if (szphi.qn() >= 3.) { -// _hdfdz = szphi.dfdz(); // sigxy/sigxx; -// _hphi0 = szphi.phi0(); // ymean - xmean*sigxy/sigxx; -// // _sdfdz = szphi.chi2DofLine(); -// } -// else { -// _hphi0 = phi0 + _hdfdz*z0; -// // _sdfdz = -1; -// } - -// int nActive_stations = nentries - overflows; - -// if (Diag_flag > 0){ -// Helix._diag.nStationPairs = nActive_stations; -// } - -// if (_debug > 5) { -// printf("[CalHelixFinderAlg::findDfDz] END: _hdfdz = %9.5f _hphi0 = %9.6f chi2 = %9.3f ", _hdfdz, -// _hphi0, -1.); -// printf(" FIT: szphi.dfdz() = %9.5f szphi.phi0() = %9.6f chi2 = %9.3f qn = %6.0f\n", szphi.dfdz(), -// szphi.phi0(), szphi.chi2DofLine(), szphi.qn()); -// } -// //----------------------------------------------------------------------------- -// // 2017-11-14 gianipez: in case of less than _minNSt active stations we should -// // probably use the _mpDfDz -// //----------------------------------------------------------------------------- -// if (nActive_stations < _minNSt) { -// _hdfdz = _mpDfDz; -// return 0; -// } - - return 1; - } - + int CalHelixFinderAlg::findDfDz(CalHelixFinderData& Helix, HitInfo_t SeedIndex, int Diag_flag) { - -//---------------------------------------------------------------------------------------- -// 2015-01-13 calculate track DphiDz using histogrammed distribution of the dfdz residuals -//---------------------------------------------------------------------------------------- - int CalHelixFinderAlg::findDfDz_2(CalHelixFinderData& Helix, HitInfo_t SeedIndex, int Diag_flag) { - - float phi, phi_ref(-1e10), z_ref, dphi, dz; + float phi, phi_ref(-1e10), z_ref, dphi, dz; // info for the current hits being checked constexpr int nbinsX(50); float hist[nbinsX], minX(0), maxX(0.025), stepX((maxX - minX)/nbinsX); // histogram binning + for (int i=0; i 5) { printf("[CalHelixFinderAlg::findDfDz:BEGIN] x0 = %9.3f y0 = %9.3f Helix._radius = %9.3f Helix._nStrawHits = %3i", center->x(), center->y(), Helix._radius,Helix._nStrawHits); @@ -771,33 +392,33 @@ namespace mu2e { constexpr int max_station_index = 30; // safe value, larger than N(stations) const int nstations = StrawId::_nstations; - if(max_station_index < nstations) throw cet::exception("RECO") << "More stations than written to handle!"; + if(max_station_index < nstations + 1) throw cet::exception("RECO") << "More stations than written to handle!"; + // Information by station int nhits [max_station_index], nstations_with_hits(0); - float phiVec[max_station_index], zVec[max_station_index], weight(0); - + float phiVec[max_station_index], zVec[max_station_index], weight(0.f); + // Initialize the by-station information to 0 for (int i=0; iy(),fCaloX-center->x()); + const float zCl = fCaloZ; + float phiCl = polyAtan2(fCaloY-center->y(),fCaloX-center->x()); if (phiCl < 0) phiCl += 2*M_PI; phiVec[nstations] = phiCl; zVec [nstations] = zCl; nhits [nstations] = 1; - //----------------------------------------------------------------------------- - // Step 1: for each station with track candidate hits, calculate average phi per station - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Step 1: for each station with track candidate hits, calculate average phi per station +//----------------------------------------------------------------------------- PanelZ_t* panelz(0); FaceZ_t* facez(0); @@ -812,7 +433,6 @@ namespace mu2e { int nhitsPerPanel = panelz->nChHits(); int seedPanelIndex(0); if (nhitsPerPanel == 0) continue; - // if ( (f == SeedIndex.face) && (p==SeedIndex.panel) ) seedPanelIndex = SeedIndex.panelHitIndex; if ( (f == SeedIndex.face) && (p==SeedIndex.panel) && (SeedIndex.panelHitIndex >=0)) seedPanelIndex = SeedIndex.panelHitIndex - panelz->idChBegin; for (int i=seedPanelIndex; i M_PI) phi -= 2*M_PI; - while (phi-phiVec[ist] < -M_PI) phi += 2*M_PI; + const float dphi = phi - phiVec[ist]; + const int nrot = std::abs((dphi + M_PI) / (2.*M_PI)); + if (dphi > M_PI) phi -= (nrot )*2.*M_PI; + else if(dphi < -M_PI) phi += (nrot+1)*2.*M_PI; phiVec[ist] = (phiVec[ist]*nhits[ist]+phi)/(nhits[ist]+1); } @@ -846,8 +468,8 @@ namespace mu2e { }//end face loop for (int i=0; i 0) { - zVec [i] = zVec [i]/nhits[i]; + if (nhits[i] > 1) { + zVec[i] /= nhits[i]; // divide by N(hits) to get the average z of the hits } } @@ -882,70 +504,30 @@ namespace mu2e { } } - float dphidz =dphi/dz*_dfdzsign; //HERE + float dphidz =dphi/dz*_dfdzsign; // get dphi/dz with the helix helicity included - weight = nhits[i] + nhits[j]; //----------------------------------------------------------------------------- // calculate N potential choices for 2*PI ambiguity resolution //----------------------------------------------------------------------------- - int n(0), nmax(0), nmin(0), nchoices = 0; - float x = dphidz; - if (x < _minDfDz) { -//----------------------------------------------------------------------------- -// for n=0, x < _minDfDz -//----------------------------------------------------------------------------- - while (x < _maxDfDz) { - if (x < _minDfDz) nmin = n+1; - nmax = n; - if ((x > _minDfDz) && (x < _maxDfDz)) nchoices += 1; - n += 1; - x += 2*M_PI/dz; - } - } - else if (x < _maxDfDz) { -//----------------------------------------------------------------------------- -// for n=0, _xMin <= x < _xMax -//----------------------------------------------------------------------------- - while (x < _maxDfDz) { - nmax = n; - if ((x > _minDfDz) && (x < _maxDfDz)) nchoices += 1; - n += 1; - x += 2*M_PI/dz; - } + const float x = dphidz; // nominal value + const float dx = 2.*M_PI/dz; // change in dphidz with turns + const float nmin_f = (_minDfDz - x) / dx; // min/max turns allowed (float version for comparisons) + const float nmax_f = (_maxDfDz - x) / dx; + const int nmin = (nmin_f < 0.f) ? nmin_f : nmin_f + 1.f; // actual step ranges + const int nmax = (nmax_f < 0.f) ? nmax_f - 1.f : nmax_f; + const int nchoices = (nmax_f < nmin_f || nmax < nmin) ? 0 : nmax - nmin + 1; - nmin = 0; - x = dphidz+(nmin-1)*2*M_PI/dz; + if (nchoices <= 0) continue; - while (x > _minDfDz) { - nchoices += 1; - nmin -= 1; - x -= 2*M_PI/dz; - } - } - else { -//----------------------------------------------------------------------------- -// for n=0, x >= _xMax -//----------------------------------------------------------------------------- - while (x > _minDfDz) { - if (x > _maxDfDz) nmax = n-1; - nmin = n; - if ((x > _minDfDz) && (x < _maxDfDz)) nchoices += 1; - n -= 1; - x -= 2*M_PI/dz; - } - } - - if (nchoices == 0) continue; - - weight = 1.; // 1./nchoices; + weight = 1.f; // 1./nchoices; //----------------------------------------------------------------------------- // loop again over all choices and fill a histogram // histogram is from //----------------------------------------------------------------------------- - for (int n=nmin; n<=nmax; n++) { // - const float x = dphidz + n*2.*M_PI/dz; - const int bin = std::min(nbinsX, int((x-minX)/stepX)); + for (int n=nmin; n<=nmax; n++) { + const float x = dphidz + n*dx; + const int bin = std::min(nbinsX-1, int((x-minX)/stepX)); hist[bin] += weight; } } @@ -1005,6 +587,14 @@ namespace mu2e { else break; } + const float phi0_shifted = phi0+zVec[i]*_hdfdz; + const float dphi_v2 = phiVec[i] - phi0_shifted; + // find the minimum delta phi between the two phi values + const int nrot = std::abs((dphi_v2 + M_PI) / (2.*M_PI)); + const float dphi_min_v2 = (dphi_v2 < -M_PI) ? dphi_v2 + (nrot+1)*2.*M_PI : dphi_v2 - nrot*2.*M_PI; + if(std::fabs(dphi_min_v2 - dphi_min) > 1.e-3) + printf("CalHelixFinder: dphi = %7.3f (%7.3f) pi, nrot = %3i, dphi_min = %6.3f (%6.3f) pi\n", dphi/M_PI, dphi_v2/M_PI, nrot, dphi_min/M_PI, dphi_min_v2/M_PI); + sdphi += dphi_min; sn += 1; } From 71594dfff814d19dc3744fbefbf1cf825210d241 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Thu, 22 Jan 2026 16:21:45 -0600 Subject: [PATCH 057/174] Remove more while loops --- CalPatRec/src/CalHelixFinderAlg.cc | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 28f033073c..3f87897fad 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -494,7 +494,10 @@ namespace mu2e { dphi = phiVec[j]-phi_ref; dz = zVec[j] - z_ref; + // ensure the z values are set and non-overlapping if(std::fabs(dz) < 10e-10) continue; + + // check the sign of the dz makes sense if (dz < 0.) { if(!Helix._timeCluster->hasCaloCluster()) { // in the case we're using a tracker hit, just take the absolute |dz| dz = -dz; @@ -568,32 +571,12 @@ namespace mu2e { //----------------------------------------------------------------------------- // for all points different from the first one need to choose the turn number //----------------------------------------------------------------------------- - dphi = phiVec[i]-(phi0+zVec[i]*_hdfdz); - float dphi_min = dphi; - - int n= 0; - while (1) { - n += 1; - float dphi = phiVec[i]+2*M_PI*n-(phi0+zVec[i]*_hdfdz); - if (fabs(dphi) < fabs(dphi_min)) dphi_min = dphi; - else break; - } - - n=0; - while (1) { - n -= 1; - float dphi = phiVec[i]+2*M_PI*n-(phi0+zVec[i]*_hdfdz); - if (fabs(dphi) < fabs(dphi_min)) dphi_min = dphi; - else break; - } const float phi0_shifted = phi0+zVec[i]*_hdfdz; - const float dphi_v2 = phiVec[i] - phi0_shifted; + dphi = phiVec[i] - phi0_shifted; // find the minimum delta phi between the two phi values - const int nrot = std::abs((dphi_v2 + M_PI) / (2.*M_PI)); - const float dphi_min_v2 = (dphi_v2 < -M_PI) ? dphi_v2 + (nrot+1)*2.*M_PI : dphi_v2 - nrot*2.*M_PI; - if(std::fabs(dphi_min_v2 - dphi_min) > 1.e-3) - printf("CalHelixFinder: dphi = %7.3f (%7.3f) pi, nrot = %3i, dphi_min = %6.3f (%6.3f) pi\n", dphi/M_PI, dphi_v2/M_PI, nrot, dphi_min/M_PI, dphi_min_v2/M_PI); + const int nrot = std::abs((dphi + M_PI) / (2.*M_PI)); + const float dphi_min = (dphi < -M_PI) ? dphi + (nrot+1)*2.*M_PI : dphi - nrot*2.*M_PI; sdphi += dphi_min; sn += 1; From d8beef2a4f906122b837a20d37e4196e8c457501 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Thu, 22 Jan 2026 17:33:18 -0600 Subject: [PATCH 058/174] Remove another while loop --- CalPatRec/src/CalHelixFinderAlg.cc | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 3f87897fad..dbcb0d5f78 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -834,24 +834,20 @@ namespace mu2e { helCenter = XYZVectorF( Helix._sxy.x0(), Helix._sxy.y0(), 0); } - float zCl = fCaloZ; - float dx = (fCaloX - helCenter.x()); - float dy = (fCaloY - helCenter.y()); - float phiCl = polyAtan2(dy, dx); - if (phiCl < 0) phiCl = phiCl + 2*M_PI; + const float zCl = fCaloZ; + const float dx = (fCaloX - helCenter.x()); + const float dy = (fCaloY - helCenter.y()); + const float phiCl0 = polyAtan2(dy, dx); - float deltaPhi = zCl*dfdz + phi0 - phiCl; - while (deltaPhi > M_PI){ - phiCl += 2*M_PI; - deltaPhi = zCl*dfdz + phi0 - phiCl; - } - while (deltaPhi < -M_PI){ - phiCl -= 2*M_PI; - deltaPhi = zCl*dfdz + phi0 - phiCl; - } + const float phi0_shifted = phi0 + zCl*dfdz; + const float dphi = phi0_shifted - phiCl0; + // find the minimum delta phi between the two phi values + const int nrot = std::abs((dphi + M_PI) / (2.*M_PI)); + const float dphi_min = (dphi < -M_PI) ? dphi + (nrot+1)*2.*M_PI : dphi - nrot*2.*M_PI; + const float phiCl = (dphi < -M_PI) ? phiCl0 - (nrot+1)*2.*M_PI : phiCl0 + nrot*2.*M_PI; -//check residual before adding to the LSqsum - float xdphi = fabs(deltaPhi)/_sigmaPhi; + //check residual before adding to the LSqsum + float xdphi = fabs(dphi_min)/_sigmaPhi; // weight_cl of 10 corresponds to an uncertainty of 0.1 in phi(cluster), // which means sigma(R-phi) of about 2-3 cm, about right @@ -864,7 +860,7 @@ namespace mu2e { if (_debug > 5) { printf("[CalHelixFinderAlg::doLinearFitPhiZ] %08x %2i %6i %3i %12.5f %12.5f %10.5f %10.3f %10.3f %10.3f %10.5f %10.5f %5.3f\n", - 0, 1, 0, 0, zCl, phiCl, deltaPhi, xdphi, 0., 0., dfdz, 0., 0.); + 0, 1, 0, 0, zCl, phiCl, dphi_min, xdphi, 0., 0., dfdz, 0., 0.); } } From 1244acf9829959fd68c314fd12f1b21690316664 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Fri, 23 Jan 2026 11:03:00 -0600 Subject: [PATCH 059/174] Remove another while loop --- CalPatRec/src/CalHelixFinderAlg.cc | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index dbcb0d5f78..6336e6dcaf 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -3406,22 +3406,19 @@ namespace mu2e { // //----------------------------------------------------------------------------- void CalHelixFinderAlg::resolve2PiAmbiguity(ComboHit* Hit, XYZVectorF& Center, float &Phi_ref, float &DPhi){ - float dx = (Hit->_pos.x() - Center.x()); - float dy = (Hit->_pos.y() - Center.y()); - float phi = polyAtan2(dy, dx); - if (phi < 0) phi = phi + 2*M_PI; - DPhi = Phi_ref - phi; - // resolve 2PI ambiguity - while (DPhi > M_PI) { - phi += 2*M_PI; - DPhi = Phi_ref - phi; - } - while (DPhi < -M_PI) { - phi -= 2*M_PI; - DPhi = Phi_ref - phi; - } + const float dx = (Hit->_pos.x() - Center.x()); + const float dy = (Hit->_pos.y() - Center.y()); + const float phi = polyAtan2(dy, dx); + + const float dphi = Phi_ref - phi; + // find the minimum delta phi between the two phi values + const int nrot = std::abs((dphi + M_PI) / (2.*M_PI)); + const float dphi_min = (dphi < -M_PI) ? dphi + (nrot+1)*2.*M_PI : dphi - nrot*2.*M_PI; + const float phi_rot = (dphi < -M_PI) ? phi - (nrot+1)*2.*M_PI : phi + nrot*2.*M_PI; + // store the corrected value of phi - Hit->_hphi = phi; + Hit->_hphi = phi_rot; + DPhi = dphi_min; } // void CalHelixFinderAlg::resolve2PiAmbiguity(CalHelixFinderData& Helix,const XYZVectorF& Center, float DfDz, float Phi0){ From dd6f78a40b096d4fd9b441a0406d44c0e4142047 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Fri, 23 Jan 2026 11:29:49 -0600 Subject: [PATCH 060/174] Updated nominal calorimeter channel maps --- ...DMAP_20250827.dat => caloDMAP_nominal.dat} | 60 +- CaloConditions/data/nominal.txt | 6436 ++++++++--------- 2 files changed, 3248 insertions(+), 3248 deletions(-) rename CaloConditions/data/{caloDMAP_20250827.dat => caloDMAP_nominal.dat} (99%) diff --git a/CaloConditions/data/caloDMAP_20250827.dat b/CaloConditions/data/caloDMAP_nominal.dat similarity index 99% rename from CaloConditions/data/caloDMAP_20250827.dat rename to CaloConditions/data/caloDMAP_nominal.dat index 0f15126903..88fc947436 100644 --- a/CaloConditions/data/caloDMAP_20250827.dat +++ b/CaloConditions/data/caloDMAP_nominal.dat @@ -53,7 +53,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 3 9 0 0 0 3 0 6 3 2 8 128 -51.5 -514.5 276 0 552 CAL 3 10 0 0 0 3 0 6 3 3 9 129 -17.1 -514.5 275 0 550 CAL 3 11 0 1 0 3 0 46 4 2 12 932 17.1 -514.5 274 0 548 CAL -3 12 0 1 0 3 1 46 4 3 13 933 51.5 -514.5 273 0 546 CAL +3 12 0 1 0 3 1 46 4 3 13 933 51.5 -514.5 273 1 547 CAL 3 13 0 1 0 2 0 44 2 5 7 887 85.8 -514.5 272 0 544 CAL 3 14 0 1 0 2 0 44 3 2 8 888 120.1 -514.5 271 0 542 CAL 3 15 0 1 0 2 0 44 3 3 9 889 154.4 -514.5 270 0 540 CAL @@ -600,7 +600,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 32 13 0 1 4 0 0 72 2 2 4 1444 34.3 480.2 146 0 292 CAL 32 14 0 1 4 0 0 72 2 3 5 1445 68.6 480.2 147 0 294 CAL 32 15 0 1 4 1 0 74 2 5 7 1487 102.9 480.2 148 0 296 CAL -32 16 0 1 4 1 1 74 3 2 8 1488 137.2 480.2 149 0 298 CAL +32 16 0 1 4 1 1 74 3 2 8 1488 137.2 480.2 149 1 299 CAL 32 17 0 1 4 1 0 74 3 3 9 1489 171.5 480.2 150 0 300 CAL 32 18 0 1 4 2 0 76 3 3 9 1529 205.8 480.2 151 0 302 CAL 32 19 0 1 4 2 0 76 3 4 10 1530 240.1 480.2 152 0 304 CAL @@ -727,7 +727,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 3 9 0 0 0 3 1 7 3 2 8 148 -51.5 -514.5 276 1 553 CAL 3 10 0 0 0 3 1 7 3 3 9 149 -17.1 -514.5 275 1 551 CAL 3 11 0 1 0 3 1 47 4 2 12 952 17.1 -514.5 274 1 549 CAL -3 12 0 1 0 3 0 47 4 3 13 953 51.5 -514.5 273 1 547 CAL +3 12 0 1 0 3 0 47 4 3 13 953 51.5 -514.5 273 0 546 CAL 3 13 0 1 0 2 1 45 2 5 7 907 85.8 -514.5 272 1 545 CAL 3 14 0 1 0 2 1 45 3 2 8 908 120.1 -514.5 271 1 543 CAL 3 15 0 1 0 2 1 45 3 3 9 909 154.4 -514.5 270 1 541 CAL @@ -1274,7 +1274,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 32 13 0 1 4 0 1 73 2 2 4 1464 34.3 480.2 146 1 293 CAL 32 14 0 1 4 0 1 73 2 3 5 1465 68.6 480.2 147 1 295 CAL 32 15 0 1 4 1 1 75 2 5 7 1507 102.9 480.2 148 1 297 CAL -32 16 0 1 4 1 0 75 3 2 8 1508 137.2 480.2 149 1 299 CAL +32 16 0 1 4 1 0 75 3 2 8 1508 137.2 480.2 149 0 298 CAL 32 17 0 1 4 1 1 75 3 3 9 1509 171.5 480.2 150 1 301 CAL 32 18 0 1 4 2 1 77 3 3 9 1549 205.8 480.2 151 1 303 CAL 32 19 0 1 4 2 1 77 3 4 10 1550 240.1 480.2 152 1 305 CAL @@ -1355,10 +1355,10 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar -99 -99 0 1 1 1 1 51 1 2 0 1020 700 -50 3101 1 2701 PIN-DIODE -99 -99 0 1 1 1 0 50 1 2 0 1000 700 50 3111 0 2702 PIN-DIODE -99 -99 0 1 1 0 1 49 1 2 0 980 700 50 3110 1 2703 PIN-DIODE --99 -99 0 0 1 0 0 8 -99 -99 18 -99 -999 -999 9999 -99 9999 EMPTY --99 -99 0 1 1 0 0 48 -99 -99 19 -99 -999 -999 9999 -99 9999 EMPTY --99 -99 0 0 1 0 0 9 -99 -99 18 -99 -999 -999 9999 -99 9999 EMPTY --99 -99 0 1 1 0 0 49 -99 -99 19 -99 -999 -999 9999 -99 9999 EMPTY +-99 -99 0 0 1 0 0 8 -99 -99 18 178 -999 -999 9999 0 9999 EMPTY +-99 -99 0 1 1 0 0 48 -99 -99 19 979 -999 -999 9999 0 9999 EMPTY +-99 -99 0 0 1 0 0 9 -99 -99 18 198 -999 -999 9999 0 9999 EMPTY +-99 -99 0 1 1 0 0 49 -99 -99 19 999 -999 -999 9999 0 9999 EMPTY 0 0 1 0 0 2 0 84 5 5 19 1699 -137.2 -617.4 1224 0 2448 CAL 0 1 1 0 0 3 0 86 5 2 16 1736 -102.9 -617.4 1223 0 2446 CAL 0 2 1 0 0 3 0 86 5 3 17 1737 -68.6 -617.4 1222 0 2444 CAL @@ -1418,7 +1418,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 3 14 1 1 0 2 0 124 3 2 8 2488 120.1 -514.5 945 0 1890 CAL 3 15 1 1 0 2 0 124 3 3 9 2489 154.4 -514.5 944 0 1888 CAL 3 16 1 1 0 2 0 124 3 4 10 2490 188.6 -514.5 943 0 1886 CAL -3 17 1 1 0 1 0 122 1 4 2 2442 222.9 -514.5 942 0 1884 CAL +5 18 1 1 0 1 0 122 1 4 2 2442 188.6 -445.9 774 0 1548 CAL 3 18 1 1 0 1 0 122 1 5 3 2443 257.2 -514.5 941 0 1882 CAL 3 19 1 1 0 1 0 122 2 2 4 2444 291.5 -514.5 1033 0 2066 CAL 3 20 1 1 0 1 0 122 2 3 5 2445 325.9 -514.5 1127 0 2254 CAL @@ -1466,7 +1466,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 5 15 1 1 0 2 0 124 4 4 14 2494 85.8 -445.9 777 0 1554 CAL 5 16 1 1 0 2 0 124 4 5 15 2495 120.1 -445.9 776 0 1552 CAL 5 17 1 1 0 2 0 124 5 2 16 2496 154.4 -445.9 775 0 1550 CAL -5 18 1 1 0 1 0 122 3 4 10 2450 188.6 -445.9 774 0 1548 CAL +3 17 1 1 0 1 0 122 3 4 10 2450 222.9 -514.5 942 0 1884 CAL 5 19 1 1 0 1 0 122 3 5 11 2451 222.9 -445.9 773 0 1546 CAL 5 20 1 1 0 1 0 122 4 2 12 2452 257.2 -445.9 853 0 1706 CAL 5 21 1 1 0 1 0 122 4 3 13 2453 291.5 -445.9 939 0 1878 CAL @@ -1635,13 +1635,13 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 14 3 1 0 1 0 0 88 3 2 8 1768 -514.5 -137.2 1155 0 2310 CAL 14 4 1 0 1 1 0 90 1 5 3 1803 -480.2 -137.2 1062 0 2124 CAL 14 5 1 0 1 1 0 90 1 4 2 1802 -445.9 -137.2 967 0 1934 CAL -14 6 1 0 1 1 1 90 1 3 1 1801 -411.6 -137.2 878 0 1756 CAL +14 6 1 0 1 1 1 90 1 3 1 1801 -411.6 -137.2 878 1 1757 CAL 14 7 1 0 1 1 0 90 1 2 0 1800 -377.3 -137.2 795 0 1590 CAL 14 8 1 1 1 1 0 130 5 5 19 2619 377.3 -137.2 764 0 1528 CAL 14 9 1 1 1 1 0 130 5 4 18 2618 411.6 -137.2 844 0 1688 CAL 14 10 1 1 1 1 0 130 5 3 17 2617 445.9 -137.2 930 0 1860 CAL 14 11 1 1 1 1 0 130 5 2 16 2616 480.2 -137.2 1022 0 2044 CAL -14 12 1 1 1 0 0 128 3 4 10 2570 514.5 -137.2 1116 0 2232 CAL +16 11 1 1 1 0 0 128 3 4 10 2570 548.8 -68.6 1114 0 2228 CAL 14 13 1 1 1 0 0 128 2 5 7 2567 548.8 -137.2 1204 0 2408 CAL 14 14 1 1 1 0 0 128 2 2 4 2564 583.1 -137.2 1273 0 2546 CAL 14 15 1 1 1 0 0 128 1 3 1 2561 617.4 -137.2 1321 0 2642 CAL @@ -1656,7 +1656,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 15 8 1 1 1 0 0 128 4 5 15 2575 428.8 -102.9 843 0 1686 CAL 15 9 1 1 1 0 0 128 4 3 13 2573 463 -102.9 929 0 1858 CAL 15 10 1 1 1 0 0 128 3 5 11 2571 497.4 -102.9 1021 0 2042 CAL -15 11 1 1 1 0 0 128 3 2 8 2568 531.7 -102.9 1115 0 2230 CAL +14 12 1 1 1 0 0 128 3 2 8 2568 514.5 -137.2 1116 0 2232 CAL 15 12 1 1 1 0 0 128 2 3 5 2565 566 -102.9 1203 0 2406 CAL 15 13 1 1 1 0 0 128 1 4 2 2562 600.2 -102.9 1272 0 2544 CAL 16 0 1 0 1 0 0 88 4 5 15 1775 -617.4 -68.6 1296 0 2592 CAL @@ -1670,7 +1670,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 16 8 1 1 1 0 0 128 5 2 16 2576 445.9 -68.6 842 0 1684 CAL 16 9 1 1 1 0 0 128 4 4 14 2574 480.2 -68.6 928 0 1856 CAL 16 10 1 1 1 0 0 128 4 2 12 2572 514.5 -68.6 1020 0 2040 CAL -16 11 1 1 1 0 0 128 3 3 9 2569 548.8 -68.6 1114 0 2228 CAL +15 11 1 1 1 0 0 128 3 3 9 2569 531.7 -102.9 1115 0 2230 CAL 16 12 1 1 1 0 0 128 2 4 6 2566 583.1 -68.6 1202 0 2404 CAL 16 13 1 1 1 0 0 128 1 5 3 2563 617.4 -68.6 1271 0 2542 CAL 17 0 1 0 2 2 0 100 5 5 19 2019 -634.5 -34.3 1297 0 2594 CAL @@ -1798,7 +1798,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 25 0 1 0 2 0 0 96 5 3 17 1937 -566 240.1 1342 0 2684 CAL 25 1 1 0 3 2 0 108 5 4 18 2178 -531.7 240.1 1304 0 2608 CAL 25 2 1 0 3 2 0 108 5 3 17 2177 -497.4 240.1 1247 0 2494 CAL -25 3 1 0 3 2 1 108 5 2 16 2176 -463 240.1 1166 0 2332 CAL +25 3 1 0 3 2 1 108 5 2 16 2176 -463 240.1 1166 1 2333 CAL 25 4 1 0 3 2 0 108 2 3 5 2165 -428.8 240.1 1073 0 2146 CAL 25 5 1 0 3 2 0 108 2 2 4 2164 -394.5 240.1 978 0 1956 CAL 25 6 1 0 3 2 0 108 1 5 3 2163 -360.1 240.1 889 0 1778 CAL @@ -1977,7 +1977,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 33 5 1 0 4 1 0 114 2 5 7 2287 -188.6 514.5 898 0 1796 CAL 33 6 1 0 4 1 0 114 3 2 8 2288 -154.4 514.5 899 0 1798 CAL 33 7 1 0 4 1 0 114 3 3 9 2289 -120.1 514.5 900 0 1800 CAL -33 8 1 0 4 0 1 112 3 5 13 2251 -85.8 514.5 901 0 1802 CAL +33 8 1 0 4 0 1 112 3 5 13 2251 -85.8 514.5 901 1 1803 CAL 33 9 1 0 4 0 0 112 4 2 12 2252 -51.5 514.5 902 0 1804 CAL 33 10 1 0 4 0 0 112 4 3 11 2253 -17.1 514.5 903 0 1806 CAL 33 11 1 1 4 0 0 152 2 4 6 3046 17.1 514.5 904 0 1808 CAL @@ -2026,7 +2026,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 35 13 1 1 4 1 0 154 5 4 18 3098 222.9 583.1 1095 0 2190 CAL 36 0 1 0 4 0 0 112 1 2 3 2240 -137.2 617.4 1176 0 2352 CAL 36 1 1 0 4 0 0 112 1 3 2 2241 -102.9 617.4 1177 0 2354 CAL -36 2 1 0 4 0 1 112 1 4 1 2242 -68.6 617.4 1178 0 2356 CAL +36 2 1 0 4 0 1 112 1 4 1 2242 -68.6 617.4 1178 1 2357 CAL 36 3 1 0 4 0 0 112 1 5 0 2243 -34.3 617.4 1179 0 2358 CAL 36 4 1 1 4 0 0 152 5 2 16 3056 0 617.4 1180 0 2360 CAL 36 5 1 1 4 0 0 152 5 3 17 3057 34.3 617.4 1181 0 2362 CAL @@ -2092,7 +2092,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 3 14 1 1 0 2 1 125 3 2 8 2508 120.1 -514.5 945 1 1891 CAL 3 15 1 1 0 2 1 125 3 3 9 2509 154.4 -514.5 944 1 1889 CAL 3 16 1 1 0 2 1 125 3 4 10 2510 188.6 -514.5 943 1 1887 CAL -3 17 1 1 0 1 1 123 1 4 2 2462 222.9 -514.5 942 1 1885 CAL +5 18 1 1 0 1 1 123 1 4 2 2462 188.6 -445.9 774 1 1549 CAL 3 18 1 1 0 1 1 123 1 5 3 2463 257.2 -514.5 941 1 1883 CAL 3 19 1 1 0 1 1 123 2 2 4 2464 291.5 -514.5 1033 1 2067 CAL 3 20 1 1 0 1 1 123 2 3 5 2465 325.9 -514.5 1127 1 2255 CAL @@ -2140,7 +2140,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 5 15 1 1 0 2 1 125 4 4 14 2514 85.8 -445.9 777 1 1555 CAL 5 16 1 1 0 2 1 125 4 5 15 2515 120.1 -445.9 776 1 1553 CAL 5 17 1 1 0 2 1 125 5 2 16 2516 154.4 -445.9 775 1 1551 CAL -5 18 1 1 0 1 1 123 3 4 10 2470 188.6 -445.9 774 1 1549 CAL +3 17 1 1 0 1 1 123 3 4 10 2470 222.9 -514.5 942 1 1885 CAL 5 19 1 1 0 1 1 123 3 5 11 2471 222.9 -445.9 773 1 1547 CAL 5 20 1 1 0 1 1 123 4 2 12 2472 257.2 -445.9 853 1 1707 CAL 5 21 1 1 0 1 1 123 4 3 13 2473 291.5 -445.9 939 1 1879 CAL @@ -2309,13 +2309,13 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 14 3 1 0 1 0 1 89 3 2 8 1788 -514.5 -137.2 1155 1 2311 CAL 14 4 1 0 1 1 1 91 1 5 3 1823 -480.2 -137.2 1062 1 2125 CAL 14 5 1 0 1 1 1 91 1 4 2 1822 -445.9 -137.2 967 1 1935 CAL -14 6 1 0 1 1 0 91 1 3 1 1821 -411.6 -137.2 878 1 1757 CAL +14 6 1 0 1 1 0 91 1 3 1 1821 -411.6 -137.2 878 0 1756 CAL 14 7 1 0 1 1 1 91 1 2 0 1820 -377.3 -137.2 795 1 1591 CAL 14 8 1 1 1 1 1 131 5 5 19 2639 377.3 -137.2 764 1 1529 CAL 14 9 1 1 1 1 1 131 5 4 18 2638 411.6 -137.2 844 1 1689 CAL 14 10 1 1 1 1 1 131 5 3 17 2637 445.9 -137.2 930 1 1861 CAL 14 11 1 1 1 1 1 131 5 2 16 2636 480.2 -137.2 1022 1 2045 CAL -14 12 1 1 1 0 1 129 3 4 10 2590 514.5 -137.2 1116 1 2233 CAL +16 11 1 1 1 0 1 129 3 4 10 2590 548.8 -68.6 1114 1 2229 CAL 14 13 1 1 1 0 1 129 2 5 7 2587 548.8 -137.2 1204 1 2409 CAL 14 14 1 1 1 0 1 129 2 2 4 2584 583.1 -137.2 1273 1 2547 CAL 14 15 1 1 1 0 1 129 1 3 1 2581 617.4 -137.2 1321 1 2643 CAL @@ -2330,7 +2330,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 15 8 1 1 1 0 1 129 4 5 15 2595 428.8 -102.9 843 1 1687 CAL 15 9 1 1 1 0 1 129 4 3 13 2593 463 -102.9 929 1 1859 CAL 15 10 1 1 1 0 1 129 3 5 11 2591 497.4 -102.9 1021 1 2043 CAL -15 11 1 1 1 0 1 129 3 2 8 2588 531.7 -102.9 1115 1 2231 CAL +14 12 1 1 1 0 1 129 3 2 8 2588 514.5 -137.2 1116 1 2233 CAL 15 12 1 1 1 0 1 129 2 3 5 2585 566 -102.9 1203 1 2407 CAL 15 13 1 1 1 0 1 129 1 4 2 2582 600.2 -102.9 1272 1 2545 CAL 16 0 1 0 1 0 1 89 4 5 15 1795 -617.4 -68.6 1296 1 2593 CAL @@ -2344,7 +2344,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 16 8 1 1 1 0 1 129 5 2 16 2596 445.9 -68.6 842 1 1685 CAL 16 9 1 1 1 0 1 129 4 4 14 2594 480.2 -68.6 928 1 1857 CAL 16 10 1 1 1 0 1 129 4 2 12 2592 514.5 -68.6 1020 1 2041 CAL -16 11 1 1 1 0 1 129 3 3 9 2589 548.8 -68.6 1114 1 2229 CAL +15 11 1 1 1 0 1 129 3 3 9 2589 531.7 -102.9 1115 1 2231 CAL 16 12 1 1 1 0 1 129 2 4 6 2586 583.1 -68.6 1202 1 2405 CAL 16 13 1 1 1 0 1 129 1 5 3 2583 617.4 -68.6 1271 1 2543 CAL 17 0 1 0 2 2 1 101 5 5 19 2039 -634.5 -34.3 1297 1 2595 CAL @@ -2472,7 +2472,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 25 0 1 0 2 0 1 97 5 3 17 1957 -566 240.1 1342 1 2685 CAL 25 1 1 0 3 2 1 109 5 4 18 2198 -531.7 240.1 1304 1 2609 CAL 25 2 1 0 3 2 1 109 5 3 17 2197 -497.4 240.1 1247 1 2495 CAL -25 3 1 0 3 2 0 109 5 2 16 2196 -463 240.1 1166 1 2333 CAL +25 3 1 0 3 2 0 109 5 2 16 2196 -463 240.1 1166 0 2332 CAL 25 4 1 0 3 2 1 109 2 3 5 2185 -428.8 240.1 1073 1 2147 CAL 25 5 1 0 3 2 1 109 2 2 4 2184 -394.5 240.1 978 1 1957 CAL 25 6 1 0 3 2 1 109 1 5 3 2183 -360.1 240.1 889 1 1779 CAL @@ -2651,7 +2651,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 33 5 1 0 4 1 1 115 2 5 7 2307 -188.6 514.5 898 1 1797 CAL 33 6 1 0 4 1 1 115 3 2 8 2308 -154.4 514.5 899 1 1799 CAL 33 7 1 0 4 1 1 115 3 3 9 2309 -120.1 514.5 900 1 1801 CAL -33 8 1 0 4 0 0 113 3 5 13 2271 -85.8 514.5 901 1 1803 CAL +33 8 1 0 4 0 0 113 3 5 13 2271 -85.8 514.5 901 0 1802 CAL 33 9 1 0 4 0 1 113 4 2 12 2272 -51.5 514.5 902 1 1805 CAL 33 10 1 0 4 0 1 113 4 3 11 2273 -17.1 514.5 903 1 1807 CAL 33 11 1 1 4 0 1 153 2 4 6 3066 17.1 514.5 904 1 1809 CAL @@ -2700,7 +2700,7 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar 35 13 1 1 4 1 1 155 5 4 18 3118 222.9 583.1 1095 1 2191 CAL 36 0 1 0 4 0 1 113 1 2 3 2260 -137.2 617.4 1176 1 2353 CAL 36 1 1 0 4 0 1 113 1 3 2 2261 -102.9 617.4 1177 1 2355 CAL -36 2 1 0 4 0 0 113 1 4 1 2262 -68.6 617.4 1178 1 2357 CAL +36 2 1 0 4 0 0 113 1 4 1 2262 -68.6 617.4 1178 0 2356 CAL 36 3 1 0 4 0 1 113 1 5 0 2263 -34.3 617.4 1179 1 2359 CAL 36 4 1 1 4 0 1 153 5 2 16 3076 0 617.4 1180 1 2361 CAL 36 5 1 1 4 0 1 153 5 3 17 3077 34.3 617.4 1181 1 2363 CAL @@ -2715,10 +2715,10 @@ y x disk phi crate board sensor BoardIdx MBconn ConnIdx Boar -99 -99 1 1 1 0 1 129 1 2 0 2580 700 50 4101 1 2709 PIN-DIODE -99 -99 1 1 1 1 0 130 1 2 0 2600 700 -50 4111 0 2710 PIN-DIODE -99 -99 1 1 1 1 1 131 1 2 0 2620 700 -50 4110 1 2711 PIN-DIODE --99 -99 1 0 1 0 0 88 -99 -99 18 -99 -999 -999 9999 -99 9999 EMPTY --99 -99 1 1 1 0 0 128 -99 -99 19 -99 -999 -999 9999 -99 9999 EMPTY --99 -99 1 0 1 0 0 89 -99 -99 18 -99 -999 -999 9999 -99 9999 EMPTY --99 -99 1 1 1 0 0 129 -99 -99 19 -99 -999 -999 9999 -99 9999 EMPTY +-99 -99 1 0 1 0 0 88 -99 -99 18 1778 -999 -999 9999 0 9999 EMPTY +-99 -99 1 1 1 0 0 128 -99 -99 19 2579 -999 -999 9999 0 9999 EMPTY +-99 -99 1 0 1 0 0 89 -99 -99 18 1798 -999 -999 9999 0 9999 EMPTY +-99 -99 1 1 1 0 0 129 -99 -99 19 2599 -999 -999 9999 0 9999 EMPTY -99 -99 -99 -99 -99 -99 -99 160 -99 -99 0 3200 -700 700 5000 0 2712 PIN-DIODE -99 -99 -99 -99 -99 -99 -99 160 -99 -99 1 3201 -700 700 5001 1 2713 PIN-DIODE -99 -99 -99 -99 -99 -99 -99 160 -99 -99 2 3202 700 700 5010 0 2714 PIN-DIODE diff --git a/CaloConditions/data/nominal.txt b/CaloConditions/data/nominal.txt index c432f9fdd5..436da45a21 100644 --- a/CaloConditions/data/nominal.txt +++ b/CaloConditions/data/nominal.txt @@ -1,3220 +1,3220 @@ -0 738 -1 758 -2 739 -3 759 -4 699 -5 719 -6 1480 -7 1500 -8 1520 -9 1540 -10 1521 -11 1541 -12 1299 -13 1319 -14 816 -15 836 -16 859 -17 879 -18 858 -19 878 -20 857 -21 877 -22 44 -23 64 -24 43 -25 63 -26 42 -27 62 -28 40 -29 60 -30 480 -31 500 -32 735 -33 755 -34 736 -35 756 -36 696 -37 716 -38 697 -39 717 -40 698 -41 718 -42 658 -43 678 -44 659 -45 679 -46 1440 -47 1460 -48 1481 -49 1501 -50 1482 -51 1502 -52 1483 -53 1503 -54 1523 -55 1543 -56 1524 -57 1544 -58 1522 -59 1542 -60 1298 -61 1318 -62 1337 -63 1357 -64 1218 -65 1238 -66 1217 -67 1237 -68 1219 -69 1239 -70 819 -71 839 -72 817 -73 837 -74 812 -75 832 -76 855 -77 875 -78 854 -79 874 -80 899 -81 919 -82 898 -83 918 -84 897 -85 917 -86 939 -87 959 -88 938 -89 958 -90 121 -91 141 -92 120 -93 140 -94 81 -95 101 -96 80 -97 100 -98 47 -99 67 -100 46 -101 66 -102 41 -103 61 -104 3 -105 23 -106 0 -107 20 -108 402 -109 422 -110 401 -111 421 -112 400 -113 420 -114 522 -115 542 -116 481 -117 501 -118 737 -119 757 -120 732 -121 752 -122 733 -123 753 -124 693 -125 713 -126 694 -127 714 -128 695 -129 715 -130 656 -131 676 -132 657 -133 677 -134 1441 -135 1461 -136 1442 -137 1462 -138 1484 -139 1504 -140 1485 -141 1505 -142 1486 -143 1506 -144 1526 -145 1546 -146 1527 -147 1547 -148 1525 -149 1545 -150 1295 -151 1315 -152 1297 -153 1317 -154 1336 -155 1356 -156 1339 -157 1359 -158 1377 -159 1397 -160 1379 -161 1399 -162 1139 -163 1159 -164 1138 -165 1158 -166 1179 -167 1199 -168 1178 -169 1198 -170 1215 -171 1235 -172 1214 -173 1234 -174 1216 -175 1236 -176 978 -177 998 -178 977 -179 997 -180 1019 -181 1039 -182 1015 -183 1035 -184 1059 -185 1079 -186 1055 -187 1075 -188 1099 -189 1119 -190 1096 -191 1116 -192 818 -193 838 -194 813 -195 833 -196 856 -197 876 -198 851 -199 871 -200 850 -201 870 -202 896 -203 916 -204 895 -205 915 -206 894 -207 914 -208 937 -209 957 -210 936 -211 956 -212 123 -213 143 -214 122 -215 142 -216 84 -217 104 -218 83 -219 103 -220 82 -221 102 -222 50 -223 70 -224 49 -225 69 -226 45 -227 65 -228 6 -229 26 -230 2 -231 22 -232 282 -233 302 -234 280 -235 300 -236 244 -237 264 -238 240 -239 260 -240 204 -241 224 -242 200 -243 220 -244 161 -245 181 -246 160 -247 180 -248 405 -249 425 -250 404 -251 424 -252 403 -253 423 -254 362 -255 382 -256 360 -257 380 -258 321 -259 341 -260 320 -261 340 -262 560 -263 580 -264 562 -265 582 -266 520 -267 540 -268 523 -269 543 -270 482 -271 502 -272 484 -273 504 -274 734 -275 754 -276 729 -277 749 -278 730 -279 750 -280 690 -281 710 -282 691 -283 711 -284 692 -285 712 -286 654 -287 674 -288 655 -289 675 -290 1443 -291 1463 -292 1444 -293 1464 -294 1445 -295 1465 -296 1487 -297 1507 -298 1488 -299 1508 -300 1489 -301 1509 -302 1529 -303 1549 -304 1530 -305 1550 -306 1528 -307 1548 -308 1291 -309 1311 -310 1294 -311 1314 -312 1296 -313 1316 -314 1335 -315 1355 -316 1338 -317 1358 -318 1376 -319 1396 -320 1378 -321 1398 -322 1137 -323 1157 -324 1136 -325 1156 -326 1177 -327 1197 -328 1176 -329 1196 -330 1212 -331 1232 -332 1211 -333 1231 -334 1213 -335 1233 -336 976 -337 996 -338 975 -339 995 -340 1018 -341 1038 -342 1014 -343 1034 -344 1058 -345 1078 -346 1054 -347 1074 -348 1098 -349 1118 -350 1095 -351 1115 -352 1092 -353 1112 -354 814 -355 834 -356 808 -357 828 -358 852 -359 872 -360 847 -361 867 -362 846 -363 866 -364 893 -365 913 -366 892 -367 912 -368 891 -369 911 -370 935 -371 955 -372 934 -373 954 -374 126 -375 146 -376 125 -377 145 -378 124 -379 144 -380 87 -381 107 -382 86 -383 106 -384 85 -385 105 -386 53 -387 73 -388 52 -389 72 -390 48 -391 68 -392 10 -393 30 -394 5 -395 25 -396 1 -397 21 -398 283 -399 303 -400 281 -401 301 -402 245 -403 265 -404 241 -405 261 -406 205 -407 225 -408 201 -409 221 -410 163 -411 183 -412 162 -413 182 -414 408 -415 428 -416 407 -417 427 -418 406 -419 426 -420 363 -421 383 -422 361 -423 381 -424 323 -425 343 -426 322 -427 342 -428 561 -429 581 -430 563 -431 583 -432 521 -433 541 -434 524 -435 544 -436 483 -437 503 -438 485 -439 505 -440 488 -441 508 -442 731 -443 751 -444 725 -445 745 -446 726 -447 746 -448 687 -449 707 -450 688 -451 708 -452 689 -453 709 -454 651 -455 671 -456 652 -457 672 -458 653 -459 673 -460 1446 -461 1466 -462 1447 -463 1467 -464 1448 -465 1468 -466 1490 -467 1510 -468 1491 -469 1511 -470 1492 -471 1512 -472 1533 -473 1553 -474 1534 -475 1554 -476 1531 -477 1551 -478 1287 -479 1307 -480 1290 -481 1310 -482 1293 -483 1313 -484 1332 -485 1352 -486 1334 -487 1354 -488 1373 -489 1393 -490 1375 -491 1395 -492 1135 -493 1155 -494 1134 -495 1154 -496 1133 -497 1153 -498 1175 -499 1195 -500 1174 -501 1194 -502 1209 -503 1229 -504 1208 -505 1228 -506 1210 -507 1230 -508 974 -509 994 -510 973 -511 993 -512 1017 -513 1037 -514 1013 -515 1033 -516 1057 -517 1077 -518 1053 -519 1073 -520 1097 -521 1117 -522 1094 -523 1114 -524 1091 -525 1111 -526 815 -527 835 -528 809 -529 829 -530 853 -531 873 -532 848 -533 868 -534 843 -535 863 -536 842 -537 862 -538 890 -539 910 -540 889 -541 909 -542 888 -543 908 -544 887 -545 907 -546 933 -547 953 -548 932 -549 952 -550 129 -551 149 -552 128 -553 148 -554 127 -555 147 -556 90 -557 110 -558 89 -559 109 -560 88 -561 108 -562 57 -563 77 -564 56 -565 76 -566 51 -567 71 -568 14 -569 34 -570 9 -571 29 -572 4 -573 24 -574 286 -575 306 -576 284 -577 304 -578 249 -579 269 -580 246 -581 266 -582 242 -583 262 -584 206 -585 226 -586 202 -587 222 -588 165 -589 185 -590 164 -591 184 -592 411 -593 431 -594 410 -595 430 -596 409 -597 429 -598 366 -599 386 -600 364 -601 384 -602 326 -603 346 -604 325 -605 345 -606 324 -607 344 -608 564 -609 584 -610 566 -611 586 -612 525 -613 545 -614 527 -615 547 -616 486 -617 506 -618 489 -619 509 -620 492 -621 512 -622 728 -623 748 -624 721 -625 741 -626 722 -627 742 -628 683 -629 703 -630 684 -631 704 -632 685 -633 705 -634 686 -635 706 -636 648 -637 668 -638 649 -639 669 -640 650 -641 670 -642 1449 -643 1469 -644 1450 -645 1470 -646 1451 -647 1471 -648 1493 -649 1513 -650 1494 -651 1514 -652 1495 -653 1515 -654 1537 -655 1557 -656 1538 -657 1558 -658 1535 -659 1555 -660 1532 -661 1552 -662 1286 -663 1306 -664 1289 -665 1309 -666 1292 -667 1312 -668 1331 -669 1351 -670 1333 -671 1353 -672 1372 -673 1392 -674 1374 -675 1394 -676 1132 -677 1152 -678 1131 -679 1151 -680 1130 -681 1150 -682 1173 -683 1193 -684 1172 -685 1192 -686 1206 -687 1226 -688 1205 -689 1225 -690 1207 -691 1227 -692 972 -693 992 -694 971 -695 991 -696 1016 -697 1036 -698 1012 -699 1032 -700 1056 -701 1076 -702 1052 -703 1072 -704 1050 -705 1070 -706 1093 -707 1113 -708 1090 -709 1110 -710 1087 -711 1107 -712 810 -713 830 -714 804 -715 824 -716 849 -717 869 -718 844 -719 864 -720 840 -721 860 -722 886 -723 906 -724 885 -725 905 -726 884 -727 904 -728 883 -729 903 -730 931 -731 951 -732 930 -733 950 -734 929 -735 949 -736 928 -737 948 -738 132 -739 152 -740 131 -741 151 -742 130 -743 150 -744 94 -745 114 -746 93 -747 113 -748 92 -749 112 -750 91 -751 111 -752 59 -753 79 -754 55 -755 75 -756 18 -757 38 -758 13 -759 33 -760 8 -761 28 -762 291 -763 311 -764 287 -765 307 -766 285 -767 305 -768 250 -769 270 -770 247 -771 267 -772 243 -773 263 -774 207 -775 227 -776 203 -777 223 -778 167 -779 187 -780 166 -781 186 -782 414 -783 434 -784 413 -785 433 -786 412 -787 432 -788 367 -789 387 -790 365 -791 385 -792 329 -793 349 -794 328 -795 348 -796 327 -797 347 -798 565 -799 585 -800 567 -801 587 -802 526 -803 546 -804 528 -805 548 -806 487 -807 507 -808 490 -809 510 -810 493 -811 513 -812 727 -813 747 -814 724 -815 744 -816 680 -817 700 -818 681 -819 701 -820 682 -821 702 -822 644 -823 664 -824 645 -825 665 -826 646 -827 666 -828 647 -829 667 -830 1452 -831 1472 -832 1453 -833 1473 -834 1454 -835 1474 -836 1455 -837 1475 -838 1496 -839 1516 -840 1497 -841 1517 -842 1498 -843 1518 -844 1539 -845 1559 -846 1536 -847 1556 -848 1283 -849 1303 -850 1285 -851 1305 -852 1288 -853 1308 -854 1327 -855 1347 -856 1330 -857 1350 -858 1371 -859 1391 -860 1367 -861 1387 -862 1363 -863 1383 -864 1129 -865 1149 -866 1128 -867 1148 -868 1127 -869 1147 -870 1170 -871 1190 -872 1169 -873 1189 -874 1162 -875 1182 -876 1203 -877 1223 -878 1204 -879 1224 -880 969 -881 989 -882 968 -883 988 -884 970 -885 990 -886 1011 -887 1031 -888 1007 -889 1027 -890 1051 -891 1071 -892 1049 -893 1069 -894 1045 -895 1065 -896 1089 -897 1109 -898 1086 -899 1106 -900 811 -901 831 -902 805 -903 825 -904 801 -905 821 -906 845 -907 865 -908 841 -909 861 -910 882 -911 902 -912 881 -913 901 -914 880 -915 900 -916 927 -917 947 -918 926 -919 946 -920 925 -921 945 -922 924 -923 944 -924 135 -925 155 -926 134 -927 154 -928 133 -929 153 -930 98 -931 118 -932 97 -933 117 -934 96 -935 116 -936 95 -937 115 -938 58 -939 78 -940 54 -941 74 -942 17 -943 37 -944 12 -945 32 -946 7 -947 27 -948 292 -949 312 -950 288 -951 308 -952 255 -953 275 -954 251 -955 271 -956 248 -957 268 -958 212 -959 232 -960 208 -961 228 -962 168 -963 188 -964 170 -965 190 -966 169 -967 189 -968 416 -969 436 -970 415 -971 435 -972 374 -973 394 -974 372 -975 392 -976 368 -977 388 -978 332 -979 352 -980 331 -981 351 -982 330 -983 350 -984 576 -985 596 -986 572 -987 592 -988 568 -989 588 -990 529 -991 549 -992 532 -993 552 -994 491 -995 511 -996 494 -997 514 -998 496 -999 516 -1000 723 -1001 743 -1002 720 -1003 740 -1004 640 -1005 660 -1006 641 -1007 661 -1008 642 -1009 662 -1010 643 -1011 663 -1012 1456 -1013 1476 -1014 1457 -1015 1477 -1016 1458 -1017 1478 -1018 1459 -1019 1479 -1020 1499 -1021 1519 -1022 1280 -1023 1300 -1024 1282 -1025 1302 -1026 1284 -1027 1304 -1028 1323 -1029 1343 -1030 1326 -1031 1346 -1032 1329 -1033 1349 -1034 1370 -1035 1390 -1036 1366 -1037 1386 -1038 1362 -1039 1382 -1040 1126 -1041 1146 -1042 1125 -1043 1145 -1044 1171 -1045 1191 -1046 1167 -1047 1187 -1048 1166 -1049 1186 -1050 1161 -1051 1181 -1052 1201 -1053 1221 -1054 1202 -1055 1222 -1056 966 -1057 986 -1058 965 -1059 985 -1060 967 -1061 987 -1062 1010 -1063 1030 -1064 1006 -1065 1026 -1066 1003 -1067 1023 -1068 1048 -1069 1068 -1070 1044 -1071 1064 -1072 1088 -1073 1108 -1074 1085 -1075 1105 -1076 1082 -1077 1102 -1078 806 -1079 826 -1080 802 -1081 822 -1082 800 -1083 820 -1084 923 -1085 943 -1086 922 -1087 942 -1088 921 -1089 941 -1090 920 -1091 940 -1092 139 -1093 159 -1094 138 -1095 158 -1096 137 -1097 157 -1098 136 -1099 156 -1100 99 -1101 119 -1102 19 -1103 39 -1104 16 -1105 36 -1106 11 -1107 31 -1108 296 -1109 316 -1110 293 -1111 313 -1112 289 -1113 309 -1114 256 -1115 276 -1116 252 -1117 272 -1118 216 -1119 236 -1120 213 -1121 233 -1122 209 -1123 229 -1124 171 -1125 191 -1126 173 -1127 193 -1128 172 -1129 192 -1130 418 -1131 438 -1132 417 -1133 437 -1134 375 -1135 395 -1136 373 -1137 393 -1138 369 -1139 389 -1140 370 -1141 390 -1142 334 -1143 354 -1144 333 -1145 353 -1146 577 -1147 597 -1148 573 -1149 593 -1150 569 -1151 589 -1152 530 -1153 550 -1154 533 -1155 553 -1156 536 -1157 556 -1158 495 -1159 515 -1160 497 -1161 517 -1162 499 -1163 519 -1164 1281 -1165 1301 -1166 1320 -1167 1340 -1168 1322 -1169 1342 -1170 1325 -1171 1345 -1172 1328 -1173 1348 -1174 1369 -1175 1389 -1176 1365 -1177 1385 -1178 1361 -1179 1381 -1180 1124 -1181 1144 -1182 1123 -1183 1143 -1184 1168 -1185 1188 -1186 1164 -1187 1184 -1188 1163 -1189 1183 -1190 1160 -1191 1180 -1192 1200 -1193 1220 -1194 963 -1195 983 -1196 962 -1197 982 -1198 964 -1199 984 -1200 1009 -1201 1029 -1202 1005 -1203 1025 -1204 1002 -1205 1022 -1206 1047 -1207 1067 -1208 1043 -1209 1063 -1210 1041 -1211 1061 -1212 1084 -1213 1104 -1214 1081 -1215 1101 -1216 807 -1217 827 -1218 803 -1219 823 -1220 15 -1221 35 -1222 299 -1223 319 -1224 297 -1225 317 -1226 294 -1227 314 -1228 290 -1229 310 -1230 257 -1231 277 -1232 253 -1233 273 -1234 217 -1235 237 -1236 214 -1237 234 -1238 210 -1239 230 -1240 174 -1241 194 -1242 176 -1243 196 -1244 175 -1245 195 -1246 419 -1247 439 -1248 379 -1249 399 -1250 378 -1251 398 -1252 377 -1253 397 -1254 371 -1255 391 -1256 336 -1257 356 -1258 335 -1259 355 -1260 578 -1261 598 -1262 574 -1263 594 -1264 570 -1265 590 -1266 531 -1267 551 -1268 534 -1269 554 -1270 537 -1271 557 -1272 539 -1273 559 -1274 498 -1275 518 -1276 1321 -1277 1341 -1278 1324 -1279 1344 -1280 1368 -1281 1388 -1282 1364 -1283 1384 -1284 1360 -1285 1380 -1286 1122 -1287 1142 -1288 1121 -1289 1141 -1290 1120 -1291 1140 -1292 1165 -1293 1185 -1294 961 -1295 981 -1296 1008 -1297 1028 -1298 1004 -1299 1024 -1300 1001 -1301 1021 -1302 1046 -1303 1066 -1304 1042 -1305 1062 -1306 1040 -1307 1060 -1308 1083 -1309 1103 -1310 1080 -1311 1100 -1312 298 -1313 318 -1314 295 -1315 315 -1316 259 -1317 279 -1318 258 -1319 278 -1320 254 -1321 274 -1322 218 -1323 238 -1324 215 -1325 235 -1326 211 -1327 231 -1328 177 -1329 197 -1330 376 -1331 396 -1332 339 -1333 359 -1334 338 -1335 358 -1336 337 -1337 357 -1338 579 -1339 599 -1340 575 -1341 595 -1342 571 -1343 591 -1344 535 -1345 555 -1346 538 -1347 558 -1348 2338 -1349 2358 -1350 2339 -1351 2359 -1352 2299 -1353 2319 -1354 3080 -1355 3100 -1356 3120 -1357 3140 -1358 3121 -1359 3141 -1360 2899 -1361 2919 -1362 2416 -1363 2436 -1364 2459 -1365 2479 -1366 2458 -1367 2478 -1368 2457 -1369 2477 -1370 1644 -1371 1664 -1372 1643 -1373 1663 -1374 1642 -1375 1662 -1376 1640 -1377 1660 -1378 2080 -1379 2100 -1380 2335 -1381 2355 -1382 2336 -1383 2356 -1384 2296 -1385 2316 -1386 2297 -1387 2317 -1388 2298 -1389 2318 -1390 2258 -1391 2278 -1392 2259 -1393 2279 -1394 3040 -1395 3060 -1396 3081 -1397 3101 -1398 3082 -1399 3102 -1400 3083 -1401 3103 -1402 3123 -1403 3143 -1404 3124 -1405 3144 -1406 3122 -1407 3142 -1408 2898 -1409 2918 -1410 2937 -1411 2957 -1412 2818 -1413 2838 -1414 2817 -1415 2837 -1416 2819 -1417 2839 -1418 2419 -1419 2439 -1420 2417 -1421 2437 -1422 2412 -1423 2432 -1424 2455 -1425 2475 -1426 2454 -1427 2474 -1428 2499 -1429 2519 -1430 2498 -1431 2518 -1432 2497 -1433 2517 -1434 2539 -1435 2559 -1436 2538 -1437 2558 -1438 1721 -1439 1741 -1440 1720 -1441 1740 -1442 1681 -1443 1701 -1444 1680 -1445 1700 -1446 1647 -1447 1667 -1448 1646 -1449 1666 -1450 1641 -1451 1661 -1452 1603 -1453 1623 -1454 1600 -1455 1620 -1456 2002 -1457 2022 -1458 2001 -1459 2021 -1460 2000 -1461 2020 -1462 2122 -1463 2142 -1464 2081 -1465 2101 -1466 2337 -1467 2357 -1468 2332 -1469 2352 -1470 2333 -1471 2353 -1472 2293 -1473 2313 -1474 2294 -1475 2314 -1476 2295 -1477 2315 -1478 2256 -1479 2276 -1480 2257 -1481 2277 -1482 3041 -1483 3061 -1484 3042 -1485 3062 -1486 3084 -1487 3104 -1488 3085 -1489 3105 -1490 3086 -1491 3106 -1492 3126 -1493 3146 -1494 3127 -1495 3147 -1496 3125 -1497 3145 -1498 2895 -1499 2915 -1500 2897 -1501 2917 -1502 2936 -1503 2956 -1504 2939 -1505 2959 -1506 2977 -1507 2997 -1508 2979 -1509 2999 -1510 2739 -1511 2759 -1512 2738 -1513 2758 -1514 2779 -1515 2799 -1516 2778 -1517 2798 -1518 2815 -1519 2835 -1520 2814 -1521 2834 -1522 2816 -1523 2836 -1524 2578 -1525 2598 -1526 2577 -1527 2597 -1528 2619 -1529 2639 -1530 2615 -1531 2635 -1532 2659 -1533 2679 -1534 2655 -1535 2675 -1536 2699 -1537 2719 -1538 2696 -1539 2716 -1540 2418 -1541 2438 -1542 2413 -1543 2433 -1544 2456 -1545 2476 -1546 2451 -1547 2471 -1548 2450 -1549 2470 -1550 2496 -1551 2516 -1552 2495 -1553 2515 -1554 2494 -1555 2514 -1556 2537 -1557 2557 -1558 2536 -1559 2556 -1560 1723 -1561 1743 -1562 1722 -1563 1742 -1564 1684 -1565 1704 -1566 1683 -1567 1703 -1568 1682 -1569 1702 -1570 1650 -1571 1670 -1572 1649 -1573 1669 -1574 1645 -1575 1665 -1576 1606 -1577 1626 -1578 1602 -1579 1622 -1580 1882 -1581 1902 -1582 1880 -1583 1900 -1584 1844 -1585 1864 -1586 1840 -1587 1860 -1588 1804 -1589 1824 -1590 1800 -1591 1820 -1592 1761 -1593 1781 -1594 1760 -1595 1780 -1596 2005 -1597 2025 -1598 2004 -1599 2024 -1600 2003 -1601 2023 -1602 1962 -1603 1982 -1604 1960 -1605 1980 -1606 1921 -1607 1941 -1608 1920 -1609 1940 -1610 2160 -1611 2180 -1612 2162 -1613 2182 -1614 2120 -1615 2140 -1616 2123 -1617 2143 -1618 2082 -1619 2102 -1620 2084 -1621 2104 -1622 2334 -1623 2354 -1624 2329 -1625 2349 -1626 2330 -1627 2350 -1628 2290 -1629 2310 -1630 2291 -1631 2311 -1632 2292 -1633 2312 -1634 2254 -1635 2274 -1636 2255 -1637 2275 -1638 3043 -1639 3063 -1640 3044 -1641 3064 -1642 3045 -1643 3065 -1644 3087 -1645 3107 -1646 3088 -1647 3108 -1648 3089 -1649 3109 -1650 3129 -1651 3149 -1652 3130 -1653 3150 -1654 3128 -1655 3148 -1656 2891 -1657 2911 -1658 2894 -1659 2914 -1660 2896 -1661 2916 -1662 2935 -1663 2955 -1664 2938 -1665 2958 -1666 2976 -1667 2996 -1668 2978 -1669 2998 -1670 2737 -1671 2757 -1672 2736 -1673 2756 -1674 2777 -1675 2797 -1676 2776 -1677 2796 -1678 2812 -1679 2832 -1680 2811 -1681 2831 -1682 2813 -1683 2833 -1684 2576 -1685 2596 -1686 2575 -1687 2595 -1688 2618 -1689 2638 -1690 2614 -1691 2634 -1692 2658 -1693 2678 -1694 2654 -1695 2674 -1696 2698 -1697 2718 -1698 2695 -1699 2715 -1700 2692 -1701 2712 -1702 2414 -1703 2434 -1704 2408 -1705 2428 -1706 2452 -1707 2472 -1708 2447 -1709 2467 -1710 2446 -1711 2466 -1712 2493 -1713 2513 -1714 2492 -1715 2512 -1716 2491 -1717 2511 -1718 2535 -1719 2555 -1720 2534 -1721 2554 -1722 1726 -1723 1746 -1724 1725 -1725 1745 -1726 1724 -1727 1744 -1728 1687 -1729 1707 -1730 1686 -1731 1706 -1732 1685 -1733 1705 -1734 1653 -1735 1673 -1736 1652 -1737 1672 -1738 1648 -1739 1668 -1740 1610 -1741 1630 -1742 1605 -1743 1625 -1744 1601 -1745 1621 -1746 1883 +0 106 +1 396 +2 230 +3 104 +4 572 +5 394 +6 228 +7 946 +8 760 +9 570 +10 392 +11 1106 +12 944 +13 758 +14 568 +15 1220 +16 1104 +17 942 +18 756 +19 1102 +20 107 +21 397 +22 231 +23 105 +24 573 +25 395 +26 229 +27 947 +28 761 +29 571 +30 393 +31 1107 +32 945 +33 759 +34 569 +35 1221 +36 1105 +37 943 +38 757 +39 1103 +40 28 +41 102 +42 26 +43 24 +44 22 +45 226 +46 100 +47 98 +48 390 +49 224 +50 222 +51 566 +52 388 +53 386 +54 940 +55 754 +56 564 +57 562 +58 938 +59 752 +60 29 +61 103 +62 27 +63 25 +64 23 +65 227 +66 101 +67 99 +68 391 +69 225 +70 223 +71 567 +72 389 +73 387 +74 941 +75 755 +76 565 +77 563 +78 939 +79 753 +80 96 +81 94 +82 220 +83 218 +84 216 +85 384 +86 382 +87 380 +88 560 +89 558 +90 556 +91 750 +92 748 +93 746 +94 744 +95 936 +96 934 +97 932 +98 930 +99 1100 +100 97 +101 95 +102 221 +103 219 +104 217 +105 385 +106 383 +107 381 +108 561 +109 559 +110 557 +111 751 +112 749 +113 747 +114 745 +115 937 +116 935 +117 933 +118 931 +119 1101 +120 92 +121 90 +122 214 +123 212 +124 378 +125 376 +126 374 +127 554 +128 552 +129 550 +130 742 +131 740 +132 738 +133 928 +134 926 +135 924 +136 1098 +137 1096 +138 1094 +139 1092 +140 93 +141 91 +142 215 +143 213 +144 379 +145 377 +146 375 +147 555 +148 553 +149 551 +150 743 +151 741 +152 739 +153 929 +154 927 +155 925 +156 1099 +157 1097 +158 1095 +159 1093 +160 246 +161 244 +162 412 +163 410 +164 590 +165 588 +166 780 +167 778 +168 962 +169 966 +170 964 +171 1124 +172 1128 +173 1126 +174 1240 +175 1244 +176 1242 +177 1328 +178 9999 +179 2698 +180 247 +181 245 +182 413 +183 411 +184 591 +185 589 +186 781 +187 779 +188 963 +189 967 +190 965 +191 1125 +192 1129 +193 1127 +194 1241 +195 1245 +196 1243 +197 1329 +198 9999 +199 2697 +200 242 +201 408 +202 586 +203 776 +204 240 +205 406 +206 584 +207 774 +208 960 +209 1122 +210 1238 +211 1326 +212 958 +213 1120 +214 1236 +215 1324 +216 1118 +217 1234 +218 1322 +219 2696 +220 243 +221 409 +222 587 +223 777 +224 241 +225 407 +226 585 +227 775 +228 961 +229 1123 +230 1239 +231 1327 +232 959 +233 1121 +234 1237 +235 1325 +236 1119 +237 1235 +238 1323 +239 2699 +240 238 +241 404 +242 582 +243 772 +244 236 +245 402 +246 580 +247 770 +248 956 +249 578 +250 768 +251 954 +252 1116 +253 1232 +254 1320 +255 952 +256 1114 +257 1230 +258 1318 +259 1316 +260 239 +261 405 +262 583 +263 773 +264 237 +265 403 +266 581 +267 771 +268 957 +269 579 +270 769 +271 955 +272 1117 +273 1233 +274 1321 +275 953 +276 1115 +277 1231 +278 1319 +279 1317 +280 234 +281 400 +282 232 +283 398 +284 576 +285 766 +286 574 +287 764 +288 950 +289 1112 +290 1228 +291 762 +292 948 +293 1110 +294 1226 +295 1314 +296 1108 +297 1224 +298 1312 +299 1222 +300 235 +301 401 +302 233 +303 399 +304 577 +305 767 +306 575 +307 765 +308 951 +309 1113 +310 1229 +311 763 +312 949 +313 1111 +314 1227 +315 1315 +316 1109 +317 1225 +318 1313 +319 1223 +320 260 +321 258 +322 426 +323 424 +324 606 +325 604 +326 602 +327 796 +328 794 +329 792 +330 982 +331 980 +332 978 +333 1144 +334 1142 +335 1258 +336 1256 +337 1336 +338 1334 +339 1332 +340 261 +341 259 +342 427 +343 425 +344 607 +345 605 +346 603 +347 797 +348 795 +349 793 +350 983 +351 981 +352 979 +353 1145 +354 1143 +355 1259 +356 1257 +357 1337 +358 1335 +359 1333 +360 256 +361 422 +362 254 +363 420 +364 600 +365 790 +366 598 +367 788 +368 976 +369 1138 +370 1140 +371 1254 +372 974 +373 1136 +374 972 +375 1134 +376 1330 +377 1252 +378 1250 +379 1248 +380 257 +381 423 +382 255 +383 421 +384 601 +385 791 +386 599 +387 789 +388 977 +389 1139 +390 1141 +391 1255 +392 975 +393 1137 +394 973 +395 1135 +396 1331 +397 1253 +398 1251 +399 1249 +400 112 +401 110 +402 108 +403 252 +404 250 +405 248 +406 418 +407 416 +408 414 +409 596 +410 594 +411 592 +412 786 +413 784 +414 782 +415 970 +416 968 +417 1132 +418 1130 +419 1246 +420 113 +421 111 +422 109 +423 253 +424 251 +425 249 +426 419 +427 417 +428 415 +429 597 +430 595 +431 593 +432 787 +433 785 +434 783 +435 971 +436 969 +437 1133 +438 1131 +439 1247 +440 9999 +441 9999 +442 9999 +443 9999 +444 9999 +445 9999 +446 9999 +447 9999 +448 9999 +449 9999 +450 9999 +451 9999 +452 9999 +453 9999 +454 9999 +455 9999 +456 9999 +457 9999 +458 9999 +459 9999 +460 9999 +461 9999 +462 9999 +463 9999 +464 9999 +465 9999 +466 9999 +467 9999 +468 9999 +469 9999 +470 9999 +471 9999 +472 9999 +473 9999 +474 9999 +475 9999 +476 9999 +477 9999 +478 9999 +479 9999 +480 30 +481 116 +482 270 +483 436 +484 272 +485 438 +486 616 +487 806 +488 440 +489 618 +490 808 +491 994 +492 620 +493 810 +494 996 +495 1158 +496 998 +497 1160 +498 1274 +499 1162 +500 31 +501 117 +502 271 +503 437 +504 273 +505 439 +506 617 +507 807 +508 441 +509 619 +510 809 +511 995 +512 621 +513 811 +514 997 +515 1159 +516 999 +517 1161 +518 1275 +519 1163 +520 266 +521 432 +522 114 +523 268 +524 434 +525 612 +526 802 +527 614 +528 804 +529 990 +530 1152 +531 1266 +532 992 +533 1154 +534 1268 +535 1344 +536 1156 +537 1270 +538 1346 +539 1272 +540 267 +541 433 +542 115 +543 269 +544 435 +545 613 +546 803 +547 615 +548 805 +549 991 +550 1153 +551 1267 +552 993 +553 1155 +554 1269 +555 1345 +556 1157 +557 1271 +558 1347 +559 1273 +560 262 +561 428 +562 264 +563 430 +564 608 +565 798 +566 610 +567 800 +568 988 +569 1150 +570 1264 +571 1342 +572 986 +573 1148 +574 1262 +575 1340 +576 984 +577 1146 +578 1260 +579 1338 +580 263 +581 429 +582 265 +583 431 +584 609 +585 799 +586 611 +587 801 +588 989 +589 1151 +590 1265 +591 1343 +592 987 +593 1149 +594 1263 +595 1341 +596 985 +597 1147 +598 1261 +599 1339 +600 9999 +601 9999 +602 9999 +603 9999 +604 9999 +605 9999 +606 9999 +607 9999 +608 9999 +609 9999 +610 9999 +611 9999 +612 9999 +613 9999 +614 9999 +615 9999 +616 9999 +617 9999 +618 9999 +619 9999 +620 9999 +621 9999 +622 9999 +623 9999 +624 9999 +625 9999 +626 9999 +627 9999 +628 9999 +629 9999 +630 9999 +631 9999 +632 9999 +633 9999 +634 9999 +635 9999 +636 9999 +637 9999 +638 9999 +639 9999 +640 1004 +641 1006 +642 1008 +643 1010 +644 822 +645 824 +646 826 +647 828 +648 636 +649 638 +650 640 +651 454 +652 456 +653 458 +654 286 +655 288 +656 130 +657 132 +658 42 +659 44 +660 1005 +661 1007 +662 1009 +663 1011 +664 823 +665 825 +666 827 +667 829 +668 637 +669 639 +670 641 +671 455 +672 457 +673 459 +674 287 +675 289 +676 131 +677 133 +678 43 +679 45 +680 816 +681 818 +682 820 +683 628 +684 630 +685 632 +686 634 +687 448 +688 450 +689 452 +690 280 +691 282 +692 284 +693 124 +694 126 +695 128 +696 36 +697 38 +698 40 +699 4 +700 817 +701 819 +702 821 +703 629 +704 631 +705 633 +706 635 +707 449 +708 451 +709 453 +710 281 +711 283 +712 285 +713 125 +714 127 +715 129 +716 37 +717 39 +718 41 +719 5 +720 1002 +721 624 +722 626 +723 1000 +724 814 +725 444 +726 446 +727 812 +728 622 +729 276 +730 278 +731 442 +732 120 +733 122 +734 274 +735 32 +736 34 +737 118 +738 0 +739 2 +740 1003 +741 625 +742 627 +743 1001 +744 815 +745 445 +746 447 +747 813 +748 623 +749 277 +750 279 +751 443 +752 121 +753 123 +754 275 +755 33 +756 35 +757 119 +758 1 +759 3 +760 9999 +761 9999 +762 9999 +763 9999 +764 9999 +765 9999 +766 9999 +767 9999 +768 9999 +769 9999 +770 9999 +771 9999 +772 9999 +773 9999 +774 9999 +775 9999 +776 9999 +777 9999 +778 9999 +779 9999 +780 9999 +781 9999 +782 9999 +783 9999 +784 9999 +785 9999 +786 9999 +787 9999 +788 9999 +789 9999 +790 9999 +791 9999 +792 9999 +793 9999 +794 9999 +795 9999 +796 9999 +797 9999 +798 9999 +799 9999 +800 1082 +801 904 +802 1080 +803 1218 +804 714 +805 902 +806 1078 +807 1216 +808 356 +809 528 +810 712 +811 900 +812 74 +813 194 +814 354 +815 526 +816 14 +817 72 +818 192 +819 70 +820 1083 +821 905 +822 1081 +823 1219 +824 715 +825 903 +826 1079 +827 1217 +828 357 +829 529 +830 713 +831 901 +832 75 +833 195 +834 355 +835 527 +836 15 +837 73 +838 193 +839 71 +840 720 +841 908 +842 536 +843 534 +844 718 +845 906 +846 362 +847 360 +848 532 +849 716 +850 200 +851 198 +852 358 +853 530 +854 78 +855 76 +856 196 +857 20 +858 18 +859 16 +860 721 +861 909 +862 537 +863 535 +864 719 +865 907 +866 363 +867 361 +868 533 +869 717 +870 201 +871 199 +872 359 +873 531 +874 79 +875 77 +876 197 +877 21 +878 19 +879 17 +880 914 +881 912 +882 910 +883 728 +884 726 +885 724 +886 722 +887 544 +888 542 +889 540 +890 538 +891 368 +892 366 +893 364 +894 206 +895 204 +896 202 +897 84 +898 82 +899 80 +900 915 +901 913 +902 911 +903 729 +904 727 +905 725 +906 723 +907 545 +908 543 +909 541 +910 539 +911 369 +912 367 +913 365 +914 207 +915 205 +916 203 +917 85 +918 83 +919 81 +920 1090 +921 1088 +922 1086 +923 1084 +924 922 +925 920 +926 918 +927 916 +928 736 +929 734 +930 732 +931 730 +932 548 +933 547 +934 372 +935 370 +936 210 +937 208 +938 88 +939 86 +940 1091 +941 1089 +942 1087 +943 1085 +944 923 +945 921 +946 919 +947 917 +948 737 +949 735 +950 733 +951 731 +952 549 +953 546 +954 373 +955 371 +956 211 +957 209 +958 89 +959 87 +960 2700 +961 1294 +962 1196 +963 1194 +964 1198 +965 1058 +966 1056 +967 1060 +968 882 +969 880 +970 884 +971 694 +972 692 +973 510 +974 508 +975 338 +976 336 +977 178 +978 176 +979 9999 +980 2703 +981 1295 +982 1197 +983 1195 +984 1199 +985 1059 +986 1057 +987 1061 +988 883 +989 881 +990 885 +991 695 +992 693 +993 511 +994 509 +995 339 +996 337 +997 179 +998 177 +999 9999 +1000 2702 +1001 1300 +1002 1204 +1003 1066 +1004 1298 +1005 1202 +1006 1064 +1007 888 +1008 1296 +1009 1200 +1010 1062 +1011 886 +1012 698 +1013 514 +1014 342 +1015 182 +1016 696 +1017 512 +1018 340 +1019 180 +1020 2701 +1021 1301 +1022 1205 +1023 1067 +1024 1299 +1025 1203 +1026 1065 +1027 889 +1028 1297 +1029 1201 +1030 1063 +1031 887 +1032 699 +1033 515 +1034 343 +1035 183 +1036 697 +1037 513 +1038 341 +1039 181 +1040 1306 +1041 1210 +1042 1304 +1043 1208 +1044 1070 +1045 894 +1046 1302 +1047 1206 +1048 1068 +1049 892 +1050 704 +1051 890 +1052 702 +1053 518 +1054 346 +1055 186 +1056 700 +1057 516 +1058 344 +1059 184 +1060 1307 +1061 1211 +1062 1305 +1063 1209 +1064 1071 +1065 895 +1066 1303 +1067 1207 +1068 1069 +1069 893 +1070 705 +1071 891 +1072 703 +1073 519 +1074 347 +1075 187 +1076 701 +1077 517 +1078 345 +1079 185 +1080 1310 +1081 1214 +1082 1076 +1083 1308 +1084 1212 +1085 1074 +1086 898 +1087 710 +1088 1072 +1089 896 +1090 708 +1091 524 +1092 352 +1093 706 +1094 522 +1095 350 +1096 190 +1097 520 +1098 348 +1099 188 +1100 1311 +1101 1215 +1102 1077 +1103 1309 +1104 1213 +1105 1075 +1106 899 +1107 711 +1108 1073 +1109 897 +1110 709 +1111 525 +1112 353 +1113 707 +1114 523 +1115 351 +1116 191 +1117 521 +1118 349 +1119 189 +1120 1290 +1121 1288 +1122 1286 +1123 1182 +1124 1180 +1125 1042 +1126 1040 +1127 868 +1128 866 +1129 864 +1130 680 +1131 678 +1132 676 +1133 496 +1134 494 +1135 492 +1136 324 +1137 322 +1138 164 +1139 162 +1140 1291 +1141 1289 +1142 1287 +1143 1183 +1144 1181 +1145 1043 +1146 1041 +1147 869 +1148 867 +1149 865 +1150 681 +1151 679 +1152 677 +1153 497 +1154 495 +1155 493 +1156 325 +1157 323 +1158 165 +1159 163 +1160 1190 +1161 1050 +1162 874 +1163 1188 +1164 1186 +1165 1292 +1166 1048 +1167 1046 +1168 1184 +1169 872 +1170 870 +1171 1044 +1172 684 +1173 682 +1174 500 +1175 498 +1176 328 +1177 326 +1178 168 +1179 166 +1180 1191 +1181 1051 +1182 875 +1183 1189 +1184 1187 +1185 1293 +1186 1049 +1187 1047 +1188 1185 +1189 873 +1190 871 +1191 1045 +1192 685 +1193 683 +1194 501 +1195 499 +1196 329 +1197 327 +1198 169 +1199 167 +1200 1192 +1201 1052 +1202 1054 +1203 876 +1204 878 +1205 688 +1206 686 +1207 690 +1208 504 +1209 502 +1210 506 +1211 332 +1212 330 +1213 334 +1214 172 +1215 170 +1216 174 +1217 66 +1218 64 +1219 68 +1220 1193 +1221 1053 +1222 1055 +1223 877 +1224 879 +1225 689 +1226 687 +1227 691 +1228 505 +1229 503 +1230 507 +1231 333 +1232 331 +1233 335 +1234 173 +1235 171 +1236 175 +1237 67 +1238 65 +1239 69 +1240 9999 +1241 9999 +1242 9999 +1243 9999 +1244 9999 +1245 9999 +1246 9999 +1247 9999 +1248 9999 +1249 9999 +1250 9999 +1251 9999 +1252 9999 +1253 9999 +1254 9999 +1255 9999 +1256 9999 +1257 9999 +1258 9999 +1259 9999 +1260 9999 +1261 9999 +1262 9999 +1263 9999 +1264 9999 +1265 9999 +1266 9999 +1267 9999 +1268 9999 +1269 9999 +1270 9999 +1271 9999 +1272 9999 +1273 9999 +1274 9999 +1275 9999 +1276 9999 +1277 9999 +1278 9999 +1279 9999 +1280 1022 +1281 1164 +1282 1024 +1283 848 +1284 1026 +1285 850 +1286 662 +1287 478 +1288 852 +1289 664 +1290 480 +1291 308 +1292 666 +1293 482 +1294 310 +1295 150 +1296 312 +1297 152 +1298 60 +1299 12 +1300 1023 +1301 1165 +1302 1025 +1303 849 +1304 1027 +1305 851 +1306 663 +1307 479 +1308 853 +1309 665 +1310 481 +1311 309 +1312 667 +1313 483 +1314 311 +1315 151 +1316 313 +1317 153 +1318 61 +1319 13 +1320 1166 +1321 1276 +1322 1168 +1323 1028 +1324 1278 +1325 1170 +1326 1030 +1327 854 +1328 1172 +1329 1032 +1330 856 +1331 668 +1332 484 +1333 670 +1334 486 +1335 314 +1336 154 +1337 62 +1338 316 +1339 156 +1340 1167 +1341 1277 +1342 1169 +1343 1029 +1344 1279 +1345 1171 +1346 1031 +1347 855 +1348 1173 +1349 1033 +1350 857 +1351 669 +1352 485 +1353 671 +1354 487 +1355 315 +1356 155 +1357 63 +1358 317 +1359 157 +1360 1284 +1361 1178 +1362 1038 +1363 862 +1364 1282 +1365 1176 +1366 1036 +1367 860 +1368 1280 +1369 1174 +1370 1034 +1371 858 +1372 672 +1373 488 +1374 674 +1375 490 +1376 318 +1377 158 +1378 320 +1379 160 +1380 1285 +1381 1179 +1382 1039 +1383 863 +1384 1283 +1385 1177 +1386 1037 +1387 861 +1388 1281 +1389 1175 +1390 1035 +1391 859 +1392 673 +1393 489 +1394 675 +1395 491 +1396 319 +1397 159 +1398 321 +1399 161 +1400 9999 +1401 9999 +1402 9999 +1403 9999 +1404 9999 +1405 9999 +1406 9999 +1407 9999 +1408 9999 +1409 9999 +1410 9999 +1411 9999 +1412 9999 +1413 9999 +1414 9999 +1415 9999 +1416 9999 +1417 9999 +1418 9999 +1419 9999 +1420 9999 +1421 9999 +1422 9999 +1423 9999 +1424 9999 +1425 9999 +1426 9999 +1427 9999 +1428 9999 +1429 9999 +1430 9999 +1431 9999 +1432 9999 +1433 9999 +1434 9999 +1435 9999 +1436 9999 +1437 9999 +1438 9999 +1439 9999 +1440 46 +1441 134 +1442 136 +1443 290 +1444 292 +1445 294 +1446 460 +1447 462 +1448 464 +1449 642 +1450 644 +1451 646 +1452 830 +1453 832 +1454 834 +1455 836 +1456 1012 +1457 1014 +1458 1016 +1459 1018 +1460 47 +1461 135 +1462 137 +1463 291 +1464 293 +1465 295 +1466 461 +1467 463 +1468 465 +1469 643 +1470 645 +1471 647 +1472 831 +1473 833 +1474 835 +1475 837 +1476 1013 +1477 1015 +1478 1017 +1479 1019 +1480 6 +1481 48 +1482 50 +1483 52 +1484 138 +1485 140 +1486 142 +1487 296 +1488 299 +1489 300 +1490 466 +1491 468 +1492 470 +1493 648 +1494 650 +1495 652 +1496 838 +1497 840 +1498 842 +1499 1020 +1500 7 +1501 49 +1502 51 +1503 53 +1504 139 +1505 141 +1506 143 +1507 297 +1508 298 +1509 301 +1510 467 +1511 469 +1512 471 +1513 649 +1514 651 +1515 653 +1516 839 +1517 841 +1518 843 +1519 1021 +1520 8 +1521 10 +1522 58 +1523 54 +1524 56 +1525 148 +1526 144 +1527 146 +1528 306 +1529 302 +1530 304 +1531 476 +1532 660 +1533 472 +1534 474 +1535 658 +1536 846 +1537 654 +1538 656 +1539 844 +1540 9 +1541 11 +1542 59 +1543 55 +1544 57 +1545 149 +1546 145 +1547 147 +1548 307 +1549 303 +1550 305 +1551 477 +1552 661 +1553 473 +1554 475 +1555 659 +1556 847 +1557 655 +1558 657 +1559 845 +1560 9999 +1561 9999 +1562 9999 +1563 9999 +1564 9999 +1565 9999 +1566 9999 +1567 9999 +1568 9999 +1569 9999 +1570 9999 +1571 9999 +1572 9999 +1573 9999 +1574 9999 +1575 9999 +1576 9999 +1577 9999 +1578 9999 +1579 9999 +1580 9999 +1581 9999 +1582 9999 +1583 9999 +1584 9999 +1585 9999 +1586 9999 +1587 9999 +1588 9999 +1589 9999 +1590 9999 +1591 9999 +1592 9999 +1593 9999 +1594 9999 +1595 9999 +1596 9999 +1597 9999 +1598 9999 +1599 9999 +1600 1454 +1601 1744 +1602 1578 +1603 1452 +1604 1920 +1605 1742 +1606 1576 +1607 2294 +1608 2108 +1609 1918 +1610 1740 +1611 2454 +1612 2292 +1613 2106 +1614 1916 +1615 2568 +1616 2452 +1617 2290 +1618 2104 +1619 2450 +1620 1455 +1621 1745 +1622 1579 +1623 1453 +1624 1921 +1625 1743 +1626 1577 +1627 2295 +1628 2109 +1629 1919 +1630 1741 +1631 2455 +1632 2293 +1633 2107 +1634 1917 +1635 2569 +1636 2453 +1637 2291 +1638 2105 +1639 2451 +1640 1376 +1641 1450 +1642 1374 +1643 1372 +1644 1370 +1645 1574 +1646 1448 +1647 1446 +1648 1738 +1649 1572 +1650 1570 +1651 1914 +1652 1736 +1653 1734 +1654 2288 +1655 2102 +1656 1912 +1657 1910 +1658 2286 +1659 2100 +1660 1377 +1661 1451 +1662 1375 +1663 1373 +1664 1371 +1665 1575 +1666 1449 +1667 1447 +1668 1739 +1669 1573 +1670 1571 +1671 1915 +1672 1737 +1673 1735 +1674 2289 +1675 2103 +1676 1913 +1677 1911 +1678 2287 +1679 2101 +1680 1444 +1681 1442 +1682 1568 +1683 1566 +1684 1564 +1685 1732 +1686 1730 +1687 1728 +1688 1908 +1689 1906 +1690 1904 +1691 2098 +1692 2096 +1693 2094 +1694 2092 +1695 2284 +1696 2282 +1697 2280 +1698 2278 +1699 2448 +1700 1445 +1701 1443 +1702 1569 +1703 1567 +1704 1565 +1705 1733 +1706 1731 +1707 1729 +1708 1909 +1709 1907 +1710 1905 +1711 2099 +1712 2097 +1713 2095 +1714 2093 +1715 2285 +1716 2283 +1717 2281 +1718 2279 +1719 2449 +1720 1440 +1721 1438 +1722 1562 +1723 1560 +1724 1726 +1725 1724 +1726 1722 +1727 1902 +1728 1900 +1729 1898 +1730 2090 +1731 2088 +1732 2086 +1733 2276 +1734 2274 +1735 2272 +1736 2446 +1737 2444 +1738 2442 +1739 2440 +1740 1441 +1741 1439 +1742 1563 +1743 1561 +1744 1727 +1745 1725 +1746 1723 1747 1903 -1748 1881 -1749 1901 -1750 1845 -1751 1865 -1752 1841 -1753 1861 -1754 1805 -1755 1825 -1756 1801 -1757 1821 -1758 1763 -1759 1783 -1760 1762 -1761 1782 -1762 2008 -1763 2028 -1764 2007 -1765 2027 -1766 2006 -1767 2026 -1768 1963 -1769 1983 -1770 1961 -1771 1981 -1772 1923 -1773 1943 -1774 1922 -1775 1942 -1776 2161 -1777 2181 -1778 2163 -1779 2183 -1780 2121 -1781 2141 -1782 2124 -1783 2144 -1784 2083 -1785 2103 -1786 2085 -1787 2105 -1788 2088 -1789 2108 -1790 2331 -1791 2351 -1792 2325 -1793 2345 -1794 2326 -1795 2346 -1796 2287 -1797 2307 -1798 2288 -1799 2308 -1800 2289 -1801 2309 -1802 2251 -1803 2271 -1804 2252 -1805 2272 -1806 2253 -1807 2273 -1808 3046 -1809 3066 -1810 3047 -1811 3067 -1812 3048 -1813 3068 -1814 3090 -1815 3110 -1816 3091 -1817 3111 -1818 3092 -1819 3112 -1820 3133 -1821 3153 -1822 3134 -1823 3154 -1824 3131 -1825 3151 -1826 2887 -1827 2907 -1828 2890 -1829 2910 -1830 2893 -1831 2913 -1832 2932 -1833 2952 -1834 2934 -1835 2954 -1836 2973 -1837 2993 -1838 2975 -1839 2995 -1840 2735 -1841 2755 -1842 2734 -1843 2754 -1844 2733 -1845 2753 -1846 2775 -1847 2795 -1848 2774 -1849 2794 -1850 2809 -1851 2829 -1852 2808 -1853 2828 -1854 2810 -1855 2830 -1856 2574 -1857 2594 -1858 2573 -1859 2593 -1860 2617 -1861 2637 -1862 2613 -1863 2633 -1864 2657 -1865 2677 -1866 2653 -1867 2673 -1868 2697 -1869 2717 -1870 2694 -1871 2714 -1872 2691 -1873 2711 -1874 2415 -1875 2435 -1876 2409 -1877 2429 -1878 2453 -1879 2473 -1880 2448 -1881 2468 -1882 2443 -1883 2463 -1884 2442 -1885 2462 -1886 2490 -1887 2510 -1888 2489 -1889 2509 -1890 2488 -1891 2508 -1892 2487 -1893 2507 -1894 2533 -1895 2553 -1896 2532 -1897 2552 -1898 1729 -1899 1749 -1900 1728 -1901 1748 -1902 1727 +1748 1901 +1749 1899 +1750 2091 +1751 2089 +1752 2087 +1753 2277 +1754 2275 +1755 2273 +1756 2447 +1757 2445 +1758 2443 +1759 2441 +1760 1594 +1761 1592 +1762 1760 +1763 1758 +1764 1938 +1765 1936 +1766 2128 +1767 2126 +1768 2310 +1769 2314 +1770 2312 +1771 2472 +1772 2476 +1773 2474 +1774 2588 +1775 2592 +1776 2590 +1777 2676 +1778 9999 +1779 2706 +1780 1595 +1781 1593 +1782 1761 +1783 1759 +1784 1939 +1785 1937 +1786 2129 +1787 2127 +1788 2311 +1789 2315 +1790 2313 +1791 2473 +1792 2477 +1793 2475 +1794 2589 +1795 2593 +1796 2591 +1797 2677 +1798 9999 +1799 2705 +1800 1590 +1801 1757 +1802 1934 +1803 2124 +1804 1588 +1805 1754 +1806 1932 +1807 2122 +1808 2308 +1809 2470 +1810 2586 +1811 2674 +1812 2306 +1813 2468 +1814 2584 +1815 2672 +1816 2466 +1817 2582 +1818 2670 +1819 2704 +1820 1591 +1821 1756 +1822 1935 +1823 2125 +1824 1589 +1825 1755 +1826 1933 +1827 2123 +1828 2309 +1829 2471 +1830 2587 +1831 2675 +1832 2307 +1833 2469 +1834 2585 +1835 2673 +1836 2467 +1837 2583 +1838 2671 +1839 2707 +1840 1586 +1841 1752 +1842 1930 +1843 2120 +1844 1584 +1845 1750 +1846 1928 +1847 2118 +1848 2304 +1849 1926 +1850 2116 +1851 2302 +1852 2464 +1853 2580 +1854 2668 +1855 2300 +1856 2462 +1857 2578 +1858 2666 +1859 2664 +1860 1587 +1861 1753 +1862 1931 +1863 2121 +1864 1585 +1865 1751 +1866 1929 +1867 2119 +1868 2305 +1869 1927 +1870 2117 +1871 2303 +1872 2465 +1873 2581 +1874 2669 +1875 2301 +1876 2463 +1877 2579 +1878 2667 +1879 2665 +1880 1582 +1881 1748 +1882 1580 +1883 1746 +1884 1924 +1885 2114 +1886 1922 +1887 2112 +1888 2298 +1889 2460 +1890 2576 +1891 2110 +1892 2296 +1893 2458 +1894 2574 +1895 2662 +1896 2456 +1897 2572 +1898 2660 +1899 2570 +1900 1583 +1901 1749 +1902 1581 1903 1747 -1904 1690 -1905 1710 -1906 1689 -1907 1709 -1908 1688 -1909 1708 -1910 1657 -1911 1677 -1912 1656 -1913 1676 -1914 1651 -1915 1671 -1916 1614 -1917 1634 -1918 1609 -1919 1629 -1920 1604 -1921 1624 -1922 1886 -1923 1906 -1924 1884 -1925 1904 -1926 1849 -1927 1869 -1928 1846 -1929 1866 -1930 1842 -1931 1862 -1932 1806 -1933 1826 -1934 1802 -1935 1822 -1936 1765 -1937 1785 -1938 1764 -1939 1784 -1940 2011 -1941 2031 -1942 2010 -1943 2030 -1944 2009 -1945 2029 -1946 1966 -1947 1986 -1948 1964 -1949 1984 -1950 1926 -1951 1946 -1952 1925 -1953 1945 -1954 1924 -1955 1944 -1956 2164 -1957 2184 -1958 2166 -1959 2186 -1960 2125 -1961 2145 -1962 2127 -1963 2147 -1964 2086 -1965 2106 -1966 2089 -1967 2109 -1968 2092 -1969 2112 -1970 2328 -1971 2348 -1972 2321 -1973 2341 -1974 2322 -1975 2342 -1976 2283 -1977 2303 -1978 2284 -1979 2304 -1980 2285 -1981 2305 -1982 2286 -1983 2306 -1984 2248 -1985 2268 -1986 2249 -1987 2269 -1988 2250 -1989 2270 -1990 3049 -1991 3069 -1992 3050 -1993 3070 -1994 3051 -1995 3071 -1996 3093 -1997 3113 -1998 3094 -1999 3114 -2000 3095 -2001 3115 -2002 3137 -2003 3157 -2004 3138 -2005 3158 -2006 3135 -2007 3155 -2008 3132 -2009 3152 -2010 2886 -2011 2906 -2012 2889 -2013 2909 -2014 2892 -2015 2912 -2016 2931 -2017 2951 -2018 2933 -2019 2953 -2020 2972 -2021 2992 -2022 2974 -2023 2994 -2024 2732 -2025 2752 -2026 2731 -2027 2751 -2028 2730 -2029 2750 -2030 2773 -2031 2793 -2032 2772 -2033 2792 -2034 2806 -2035 2826 -2036 2805 -2037 2825 -2038 2807 -2039 2827 -2040 2572 -2041 2592 -2042 2571 -2043 2591 -2044 2616 -2045 2636 -2046 2612 -2047 2632 -2048 2656 -2049 2676 -2050 2652 -2051 2672 -2052 2650 -2053 2670 -2054 2693 -2055 2713 -2056 2690 -2057 2710 -2058 2687 -2059 2707 -2060 2410 -2061 2430 -2062 2404 -2063 2424 -2064 2449 -2065 2469 -2066 2444 -2067 2464 -2068 2440 -2069 2460 -2070 2486 -2071 2506 -2072 2485 -2073 2505 -2074 2484 -2075 2504 -2076 2483 -2077 2503 -2078 2531 -2079 2551 -2080 2530 -2081 2550 -2082 2529 -2083 2549 -2084 2528 -2085 2548 -2086 1732 -2087 1752 -2088 1731 -2089 1751 -2090 1730 -2091 1750 -2092 1694 -2093 1714 -2094 1693 -2095 1713 -2096 1692 -2097 1712 -2098 1691 -2099 1711 -2100 1659 -2101 1679 -2102 1655 -2103 1675 -2104 1618 -2105 1638 -2106 1613 -2107 1633 -2108 1608 -2109 1628 -2110 1891 -2111 1911 -2112 1887 -2113 1907 -2114 1885 -2115 1905 -2116 1850 -2117 1870 -2118 1847 -2119 1867 -2120 1843 -2121 1863 -2122 1807 -2123 1827 -2124 1803 -2125 1823 -2126 1767 -2127 1787 -2128 1766 -2129 1786 -2130 2014 -2131 2034 -2132 2013 -2133 2033 -2134 2012 -2135 2032 -2136 1967 -2137 1987 -2138 1965 -2139 1985 -2140 1929 -2141 1949 -2142 1928 -2143 1948 -2144 1927 -2145 1947 -2146 2165 -2147 2185 -2148 2167 -2149 2187 -2150 2126 -2151 2146 -2152 2128 -2153 2148 -2154 2087 -2155 2107 -2156 2090 -2157 2110 -2158 2093 -2159 2113 -2160 2327 -2161 2347 -2162 2324 -2163 2344 -2164 2280 -2165 2300 -2166 2281 -2167 2301 -2168 2282 -2169 2302 -2170 2244 -2171 2264 -2172 2245 -2173 2265 -2174 2246 -2175 2266 -2176 2247 -2177 2267 -2178 3052 -2179 3072 -2180 3053 -2181 3073 -2182 3054 -2183 3074 -2184 3055 -2185 3075 -2186 3096 -2187 3116 -2188 3097 -2189 3117 -2190 3098 -2191 3118 -2192 3139 -2193 3159 -2194 3136 -2195 3156 -2196 2883 -2197 2903 -2198 2885 -2199 2905 -2200 2888 -2201 2908 -2202 2927 -2203 2947 -2204 2930 -2205 2950 -2206 2971 -2207 2991 -2208 2967 -2209 2987 -2210 2963 -2211 2983 -2212 2729 -2213 2749 -2214 2728 -2215 2748 -2216 2727 -2217 2747 -2218 2770 -2219 2790 -2220 2769 -2221 2789 -2222 2762 -2223 2782 -2224 2803 -2225 2823 -2226 2804 -2227 2824 -2228 2569 -2229 2589 -2230 2568 -2231 2588 -2232 2570 -2233 2590 -2234 2611 -2235 2631 -2236 2607 -2237 2627 -2238 2651 -2239 2671 -2240 2649 -2241 2669 -2242 2645 -2243 2665 -2244 2689 -2245 2709 -2246 2686 -2247 2706 -2248 2411 -2249 2431 -2250 2405 -2251 2425 -2252 2401 -2253 2421 -2254 2445 -2255 2465 -2256 2441 -2257 2461 -2258 2482 -2259 2502 -2260 2481 -2261 2501 -2262 2480 -2263 2500 -2264 2527 -2265 2547 -2266 2526 -2267 2546 -2268 2525 -2269 2545 -2270 2524 -2271 2544 -2272 1735 -2273 1755 -2274 1734 -2275 1754 -2276 1733 -2277 1753 -2278 1698 -2279 1718 -2280 1697 -2281 1717 -2282 1696 -2283 1716 -2284 1695 -2285 1715 -2286 1658 -2287 1678 -2288 1654 -2289 1674 -2290 1617 -2291 1637 -2292 1612 -2293 1632 -2294 1607 -2295 1627 -2296 1892 -2297 1912 -2298 1888 -2299 1908 -2300 1855 -2301 1875 -2302 1851 -2303 1871 -2304 1848 -2305 1868 -2306 1812 -2307 1832 -2308 1808 -2309 1828 -2310 1768 -2311 1788 -2312 1770 -2313 1790 -2314 1769 -2315 1789 -2316 2016 -2317 2036 -2318 2015 -2319 2035 -2320 1974 -2321 1994 -2322 1972 -2323 1992 -2324 1968 -2325 1988 -2326 1932 -2327 1952 -2328 1931 -2329 1951 -2330 1930 -2331 1950 -2332 2176 -2333 2196 -2334 2172 -2335 2192 -2336 2168 -2337 2188 -2338 2129 -2339 2149 -2340 2132 -2341 2152 -2342 2091 -2343 2111 -2344 2094 -2345 2114 -2346 2096 -2347 2116 -2348 2323 -2349 2343 -2350 2320 -2351 2340 -2352 2240 -2353 2260 -2354 2241 -2355 2261 -2356 2242 -2357 2262 -2358 2243 -2359 2263 -2360 3056 -2361 3076 -2362 3057 -2363 3077 -2364 3058 -2365 3078 -2366 3059 -2367 3079 -2368 3099 -2369 3119 -2370 2880 -2371 2900 -2372 2882 -2373 2902 -2374 2884 -2375 2904 -2376 2923 -2377 2943 -2378 2926 -2379 2946 -2380 2929 -2381 2949 -2382 2970 -2383 2990 -2384 2966 -2385 2986 -2386 2962 -2387 2982 -2388 2726 -2389 2746 -2390 2725 -2391 2745 -2392 2771 -2393 2791 -2394 2767 -2395 2787 -2396 2766 -2397 2786 -2398 2761 -2399 2781 -2400 2801 -2401 2821 -2402 2802 -2403 2822 -2404 2566 -2405 2586 -2406 2565 -2407 2585 -2408 2567 -2409 2587 -2410 2610 -2411 2630 -2412 2606 -2413 2626 -2414 2603 -2415 2623 -2416 2648 -2417 2668 -2418 2644 -2419 2664 -2420 2688 -2421 2708 -2422 2685 -2423 2705 -2424 2682 -2425 2702 -2426 2406 -2427 2426 -2428 2402 -2429 2422 -2430 2400 -2431 2420 -2432 2523 -2433 2543 -2434 2522 -2435 2542 -2436 2521 -2437 2541 -2438 2520 -2439 2540 -2440 1739 -2441 1759 -2442 1738 -2443 1758 -2444 1737 -2445 1757 -2446 1736 -2447 1756 -2448 1699 -2449 1719 -2450 1619 -2451 1639 -2452 1616 -2453 1636 -2454 1611 -2455 1631 -2456 1896 -2457 1916 -2458 1893 -2459 1913 -2460 1889 -2461 1909 -2462 1856 -2463 1876 -2464 1852 -2465 1872 -2466 1816 -2467 1836 -2468 1813 -2469 1833 -2470 1809 -2471 1829 -2472 1771 -2473 1791 -2474 1773 -2475 1793 -2476 1772 -2477 1792 -2478 2018 -2479 2038 -2480 2017 -2481 2037 -2482 1975 -2483 1995 -2484 1973 -2485 1993 -2486 1969 -2487 1989 -2488 1970 -2489 1990 -2490 1934 -2491 1954 -2492 1933 -2493 1953 -2494 2177 -2495 2197 -2496 2173 -2497 2193 -2498 2169 -2499 2189 -2500 2130 -2501 2150 -2502 2133 -2503 2153 -2504 2136 -2505 2156 -2506 2095 -2507 2115 -2508 2097 -2509 2117 -2510 2099 -2511 2119 -2512 2881 -2513 2901 -2514 2920 -2515 2940 -2516 2922 -2517 2942 -2518 2925 -2519 2945 -2520 2928 -2521 2948 -2522 2969 -2523 2989 -2524 2965 -2525 2985 -2526 2961 -2527 2981 -2528 2724 -2529 2744 -2530 2723 -2531 2743 -2532 2768 -2533 2788 -2534 2764 -2535 2784 -2536 2763 -2537 2783 -2538 2760 -2539 2780 -2540 2800 -2541 2820 -2542 2563 -2543 2583 -2544 2562 -2545 2582 -2546 2564 -2547 2584 -2548 2609 -2549 2629 -2550 2605 -2551 2625 -2552 2602 -2553 2622 -2554 2647 -2555 2667 -2556 2643 -2557 2663 -2558 2641 -2559 2661 -2560 2684 -2561 2704 -2562 2681 -2563 2701 -2564 2407 -2565 2427 -2566 2403 -2567 2423 -2568 1615 -2569 1635 -2570 1899 -2571 1919 -2572 1897 -2573 1917 -2574 1894 -2575 1914 -2576 1890 -2577 1910 -2578 1857 -2579 1877 -2580 1853 -2581 1873 -2582 1817 -2583 1837 -2584 1814 -2585 1834 -2586 1810 -2587 1830 -2588 1774 -2589 1794 -2590 1776 -2591 1796 -2592 1775 -2593 1795 -2594 2019 -2595 2039 -2596 1979 -2597 1999 -2598 1978 -2599 1998 -2600 1977 -2601 1997 -2602 1971 -2603 1991 -2604 1936 -2605 1956 -2606 1935 -2607 1955 -2608 2178 -2609 2198 -2610 2174 -2611 2194 -2612 2170 -2613 2190 -2614 2131 -2615 2151 -2616 2134 -2617 2154 -2618 2137 -2619 2157 -2620 2139 -2621 2159 -2622 2098 -2623 2118 -2624 2921 -2625 2941 -2626 2924 -2627 2944 -2628 2968 -2629 2988 -2630 2964 -2631 2984 -2632 2960 -2633 2980 -2634 2722 -2635 2742 -2636 2721 -2637 2741 -2638 2720 -2639 2740 -2640 2765 -2641 2785 -2642 2561 -2643 2581 -2644 2608 -2645 2628 -2646 2604 -2647 2624 -2648 2601 -2649 2621 -2650 2646 -2651 2666 -2652 2642 -2653 2662 -2654 2640 -2655 2660 -2656 2683 -2657 2703 -2658 2680 -2659 2700 -2660 1898 -2661 1918 -2662 1895 -2663 1915 -2664 1859 -2665 1879 -2666 1858 -2667 1878 -2668 1854 -2669 1874 -2670 1818 -2671 1838 -2672 1815 -2673 1835 -2674 1811 -2675 1831 -2676 1777 -2677 1797 -2678 1976 -2679 1996 -2680 1939 -2681 1959 -2682 1938 -2683 1958 -2684 1937 -2685 1957 -2686 2179 -2687 2199 -2688 2175 -2689 2195 -2690 2171 -2691 2191 -2692 2135 -2693 2155 -2694 2138 -2695 2158 -2696 219 -2697 199 -2698 179 -2699 239 -2700 960 -2701 1020 -2702 1000 -2703 980 -2704 1819 -2705 1799 -2706 1779 -2707 1839 -2708 2560 -2709 2580 -2710 2600 -2711 2620 -2712 3200 -2713 3201 -2714 3202 -2715 3203 -9999 1240 -9999 1241 -9999 1242 -9999 1243 -9999 1244 -9999 1245 -9999 1246 -9999 1247 -9999 1248 -9999 1249 -9999 1250 -9999 1251 -9999 1252 -9999 1253 -9999 1254 -9999 1255 -9999 1256 -9999 1257 -9999 1258 -9999 1259 -9999 1260 -9999 1261 -9999 1262 -9999 1263 -9999 1264 -9999 1265 -9999 1266 -9999 1267 -9999 1268 -9999 1269 -9999 1270 -9999 1271 -9999 1272 -9999 1273 -9999 1274 -9999 1275 -9999 1276 -9999 1277 -9999 1278 -9999 1279 -9999 1400 -9999 1401 -9999 1402 -9999 1403 -9999 1404 -9999 1405 -9999 1406 -9999 1407 -9999 1408 -9999 1409 -9999 1410 -9999 1411 -9999 1412 -9999 1413 -9999 1414 -9999 1415 -9999 1416 -9999 1417 -9999 1418 -9999 1419 -9999 1420 -9999 1421 -9999 1422 -9999 1423 -9999 1424 -9999 1425 -9999 1426 -9999 1427 -9999 1428 -9999 1429 -9999 1430 -9999 1431 -9999 1432 -9999 1433 -9999 1434 -9999 1435 -9999 1436 -9999 1437 -9999 1438 -9999 1439 -9999 1560 -9999 1561 -9999 1562 -9999 1563 -9999 1564 -9999 1565 -9999 1566 -9999 1567 -9999 1568 -9999 1569 -9999 1570 -9999 1571 -9999 1572 -9999 1573 -9999 1574 -9999 1575 -9999 1576 -9999 1577 -9999 1578 -9999 1579 -9999 1580 -9999 1581 -9999 1582 -9999 1583 -9999 1584 -9999 1585 -9999 1586 -9999 1587 -9999 1588 -9999 1589 -9999 1590 -9999 1591 -9999 1592 -9999 1593 -9999 1594 -9999 1595 -9999 1596 -9999 1597 -9999 1598 -9999 1599 -9999 1778 -9999 178 -9999 1798 -9999 198 -9999 2040 -9999 2041 -9999 2042 -9999 2043 -9999 2044 -9999 2045 -9999 2046 -9999 2047 -9999 2048 -9999 2049 -9999 2050 -9999 2051 -9999 2052 -9999 2053 -9999 2054 -9999 2055 -9999 2056 -9999 2057 -9999 2058 -9999 2059 -9999 2060 -9999 2061 -9999 2062 -9999 2063 -9999 2064 -9999 2065 -9999 2066 -9999 2067 -9999 2068 -9999 2069 -9999 2070 -9999 2071 -9999 2072 -9999 2073 -9999 2074 -9999 2075 -9999 2076 -9999 2077 -9999 2078 -9999 2079 -9999 2200 -9999 2201 -9999 2202 -9999 2203 -9999 2204 -9999 2205 -9999 2206 -9999 2207 -9999 2208 -9999 2209 -9999 2210 -9999 2211 -9999 2212 -9999 2213 -9999 2214 -9999 2215 -9999 2216 -9999 2217 -9999 2218 -9999 2219 -9999 2220 -9999 2221 -9999 2222 -9999 2223 -9999 2224 -9999 2225 -9999 2226 -9999 2227 -9999 2228 -9999 2229 -9999 2230 -9999 2231 -9999 2232 -9999 2233 -9999 2234 -9999 2235 -9999 2236 -9999 2237 -9999 2238 -9999 2239 -9999 2360 -9999 2361 -9999 2362 -9999 2363 -9999 2364 -9999 2365 -9999 2366 -9999 2367 -9999 2368 -9999 2369 -9999 2370 -9999 2371 -9999 2372 -9999 2373 -9999 2374 -9999 2375 -9999 2376 -9999 2377 -9999 2378 -9999 2379 -9999 2380 -9999 2381 -9999 2382 -9999 2383 -9999 2384 -9999 2385 -9999 2386 -9999 2387 -9999 2388 -9999 2389 -9999 2390 -9999 2391 -9999 2392 -9999 2393 -9999 2394 -9999 2395 -9999 2396 -9999 2397 -9999 2398 -9999 2399 -9999 2579 -9999 2599 -9999 2840 -9999 2841 -9999 2842 -9999 2843 -9999 2844 -9999 2845 -9999 2846 -9999 2847 -9999 2848 -9999 2849 -9999 2850 -9999 2851 -9999 2852 -9999 2853 -9999 2854 -9999 2855 -9999 2856 -9999 2857 -9999 2858 -9999 2859 -9999 2860 -9999 2861 -9999 2862 -9999 2863 -9999 2864 -9999 2865 -9999 2866 -9999 2867 -9999 2868 -9999 2869 -9999 2870 -9999 2871 -9999 2872 -9999 2873 -9999 2874 -9999 2875 -9999 2876 -9999 2877 -9999 2878 -9999 2879 -9999 3000 -9999 3001 -9999 3002 -9999 3003 -9999 3004 -9999 3005 -9999 3006 -9999 3007 -9999 3008 -9999 3009 -9999 3010 -9999 3011 -9999 3012 -9999 3013 -9999 3014 -9999 3015 -9999 3016 -9999 3017 -9999 3018 -9999 3019 -9999 3020 -9999 3021 -9999 3022 -9999 3023 -9999 3024 -9999 3025 -9999 3026 -9999 3027 -9999 3028 -9999 3029 -9999 3030 -9999 3031 -9999 3032 -9999 3033 -9999 3034 -9999 3035 -9999 3036 -9999 3037 -9999 3038 -9999 3039 -9999 3160 -9999 3161 -9999 3162 -9999 3163 -9999 3164 -9999 3165 -9999 3166 -9999 3167 -9999 3168 -9999 3169 -9999 3170 -9999 3171 -9999 3172 -9999 3173 -9999 3174 -9999 3175 -9999 3176 -9999 3177 -9999 3178 -9999 3179 -9999 3180 -9999 3181 -9999 3182 -9999 3183 -9999 3184 -9999 3185 -9999 3186 -9999 3187 -9999 3188 -9999 3189 -9999 3190 -9999 3191 -9999 3192 -9999 3193 -9999 3194 -9999 3195 -9999 3196 -9999 3197 -9999 3198 -9999 3199 -9999 440 -9999 441 -9999 442 -9999 443 -9999 444 -9999 445 -9999 446 -9999 447 -9999 448 -9999 449 -9999 450 -9999 451 -9999 452 -9999 453 -9999 454 -9999 455 -9999 456 -9999 457 -9999 458 -9999 459 -9999 460 -9999 461 -9999 462 -9999 463 -9999 464 -9999 465 -9999 466 -9999 467 -9999 468 -9999 469 -9999 470 -9999 471 -9999 472 -9999 473 -9999 474 -9999 475 -9999 476 -9999 477 -9999 478 -9999 479 -9999 600 -9999 601 -9999 602 -9999 603 -9999 604 -9999 605 -9999 606 -9999 607 -9999 608 -9999 609 -9999 610 -9999 611 -9999 612 -9999 613 -9999 614 -9999 615 -9999 616 -9999 617 -9999 618 -9999 619 -9999 620 -9999 621 -9999 622 -9999 623 -9999 624 -9999 625 -9999 626 -9999 627 -9999 628 -9999 629 -9999 630 -9999 631 -9999 632 -9999 633 -9999 634 -9999 635 -9999 636 -9999 637 -9999 638 -9999 639 -9999 760 -9999 761 -9999 762 -9999 763 -9999 764 -9999 765 -9999 766 -9999 767 -9999 768 -9999 769 -9999 770 -9999 771 -9999 772 -9999 773 -9999 774 -9999 775 -9999 776 -9999 777 -9999 778 -9999 779 -9999 780 -9999 781 -9999 782 -9999 783 -9999 784 -9999 785 -9999 786 -9999 787 -9999 788 -9999 789 -9999 790 -9999 791 -9999 792 -9999 793 -9999 794 -9999 795 -9999 796 -9999 797 -9999 798 -9999 799 -9999 979 -9999 999 -9999 3204 -9999 3205 -9999 3206 -9999 3207 -9999 3208 -9999 3209 -9999 3210 -9999 3211 -9999 3212 -9999 3213 -9999 3214 -9999 3215 -9999 3216 -9999 3217 -9999 3218 -9999 3219 +1904 1925 +1905 2115 +1906 1923 +1907 2113 +1908 2299 +1909 2461 +1910 2577 +1911 2111 +1912 2297 +1913 2459 +1914 2575 +1915 2663 +1916 2457 +1917 2573 +1918 2661 +1919 2571 +1920 1608 +1921 1606 +1922 1774 +1923 1772 +1924 1954 +1925 1952 +1926 1950 +1927 2144 +1928 2142 +1929 2140 +1930 2330 +1931 2328 +1932 2326 +1933 2492 +1934 2490 +1935 2606 +1936 2604 +1937 2684 +1938 2682 +1939 2680 +1940 1609 +1941 1607 +1942 1775 +1943 1773 +1944 1951 +1945 1953 +1946 2145 +1947 1955 +1948 2143 +1949 2141 +1950 2331 +1951 2329 +1952 2327 +1953 2493 +1954 2491 +1955 2607 +1956 2605 +1957 2685 +1958 2683 +1959 2681 +1960 1604 +1961 1770 +1962 1602 +1963 1768 +1964 1948 +1965 2138 +1966 1946 +1967 2136 +1968 2324 +1969 2486 +1970 2488 +1971 2602 +1972 2322 +1973 2484 +1974 2320 +1975 2482 +1976 2678 +1977 2600 +1978 2598 +1979 2596 +1980 1605 +1981 1771 +1982 1603 +1983 1769 +1984 1949 +1985 2139 +1986 1947 +1987 2137 +1988 2325 +1989 2487 +1990 2489 +1991 2603 +1992 2323 +1993 2485 +1994 2321 +1995 2483 +1996 2679 +1997 2601 +1998 2599 +1999 2597 +2000 1460 +2001 1458 +2002 1456 +2003 1600 +2004 1598 +2005 1596 +2006 1766 +2007 1764 +2008 1762 +2009 1944 +2010 1942 +2011 1940 +2012 2134 +2013 2132 +2014 2130 +2015 2318 +2016 2316 +2017 2480 +2018 2478 +2019 2594 +2020 1461 +2021 1459 +2022 1457 +2023 1601 +2024 1599 +2025 1597 +2026 1767 +2027 1765 +2028 1763 +2029 1945 +2030 1943 +2031 1941 +2032 2135 +2033 2133 +2034 2131 +2035 2319 +2036 2317 +2037 2481 +2038 2479 +2039 2595 +2040 9999 +2041 9999 +2042 9999 +2043 9999 +2044 9999 +2045 9999 +2046 9999 +2047 9999 +2048 9999 +2049 9999 +2050 9999 +2051 9999 +2052 9999 +2053 9999 +2054 9999 +2055 9999 +2056 9999 +2057 9999 +2058 9999 +2059 9999 +2060 9999 +2061 9999 +2062 9999 +2063 9999 +2064 9999 +2065 9999 +2066 9999 +2067 9999 +2068 9999 +2069 9999 +2070 9999 +2071 9999 +2072 9999 +2073 9999 +2074 9999 +2075 9999 +2076 9999 +2077 9999 +2078 9999 +2079 9999 +2080 1378 +2081 1464 +2082 1618 +2083 1784 +2084 1620 +2085 1786 +2086 1964 +2087 2154 +2088 1788 +2089 1966 +2090 2156 +2091 2342 +2092 1968 +2093 2158 +2094 2344 +2095 2506 +2096 2346 +2097 2508 +2098 2622 +2099 2510 +2100 1379 +2101 1465 +2102 1619 +2103 1785 +2104 1621 +2105 1787 +2106 1965 +2107 2155 +2108 1789 +2109 1967 +2110 2157 +2111 2343 +2112 1969 +2113 2159 +2114 2345 +2115 2507 +2116 2347 +2117 2509 +2118 2623 +2119 2511 +2120 1614 +2121 1780 +2122 1462 +2123 1616 +2124 1782 +2125 1960 +2126 2150 +2127 1962 +2128 2152 +2129 2338 +2130 2500 +2131 2614 +2132 2340 +2133 2502 +2134 2616 +2135 2692 +2136 2504 +2137 2618 +2138 2694 +2139 2620 +2140 1615 +2141 1781 +2142 1463 +2143 1617 +2144 1783 +2145 1961 +2146 2151 +2147 1963 +2148 2153 +2149 2339 +2150 2501 +2151 2615 +2152 2341 +2153 2503 +2154 2617 +2155 2693 +2156 2505 +2157 2619 +2158 2695 +2159 2621 +2160 1610 +2161 1776 +2162 1612 +2163 1778 +2164 1956 +2165 2146 +2166 1958 +2167 2148 +2168 2336 +2169 2498 +2170 2612 +2171 2690 +2172 2334 +2173 2496 +2174 2610 +2175 2688 +2176 2333 +2177 2494 +2178 2608 +2179 2686 +2180 1611 +2181 1777 +2182 1613 +2183 1779 +2184 1957 +2185 2147 +2186 1959 +2187 2149 +2188 2337 +2189 2499 +2190 2613 +2191 2691 +2192 2335 +2193 2497 +2194 2611 +2195 2689 +2196 2332 +2197 2495 +2198 2609 +2199 2687 +2200 9999 +2201 9999 +2202 9999 +2203 9999 +2204 9999 +2205 9999 +2206 9999 +2207 9999 +2208 9999 +2209 9999 +2210 9999 +2211 9999 +2212 9999 +2213 9999 +2214 9999 +2215 9999 +2216 9999 +2217 9999 +2218 9999 +2219 9999 +2220 9999 +2221 9999 +2222 9999 +2223 9999 +2224 9999 +2225 9999 +2226 9999 +2227 9999 +2228 9999 +2229 9999 +2230 9999 +2231 9999 +2232 9999 +2233 9999 +2234 9999 +2235 9999 +2236 9999 +2237 9999 +2238 9999 +2239 9999 +2240 2358 +2241 2357 +2242 2354 +2243 2352 +2244 2176 +2245 2174 +2246 2172 +2247 2170 +2248 1988 +2249 1986 +2250 1984 +2251 1806 +2252 1804 +2253 1803 +2254 1636 +2255 1634 +2256 1480 +2257 1478 +2258 1392 +2259 1390 +2260 2359 +2261 2356 +2262 2355 +2263 2353 +2264 2177 +2265 2175 +2266 2173 +2267 2171 +2268 1989 +2269 1987 +2270 1985 +2271 1807 +2272 1805 +2273 1802 +2274 1637 +2275 1635 +2276 1481 +2277 1479 +2278 1393 +2279 1391 +2280 2164 +2281 2166 +2282 2168 +2283 1976 +2284 1978 +2285 1980 +2286 1982 +2287 1796 +2288 1798 +2289 1800 +2290 1628 +2291 1630 +2292 1632 +2293 1472 +2294 1474 +2295 1476 +2296 1384 +2297 1386 +2298 1388 +2299 1352 +2300 2165 +2301 2167 +2302 2169 +2303 1977 +2304 1979 +2305 1981 +2306 1983 +2307 1797 +2308 1799 +2309 1801 +2310 1629 +2311 1631 +2312 1633 +2313 1473 +2314 1475 +2315 1477 +2316 1385 +2317 1387 +2318 1389 +2319 1353 +2320 2350 +2321 1972 +2322 1974 +2323 2348 +2324 2162 +2325 1792 +2326 1794 +2327 2160 +2328 1970 +2329 1624 +2330 1626 +2331 1790 +2332 1468 +2333 1470 +2334 1622 +2335 1380 +2336 1382 +2337 1466 +2338 1348 +2339 1350 +2340 2351 +2341 1973 +2342 1975 +2343 2349 +2344 2163 +2345 1793 +2346 1795 +2347 2161 +2348 1971 +2349 1625 +2350 1627 +2351 1791 +2352 1469 +2353 1471 +2354 1623 +2355 1381 +2356 1383 +2357 1467 +2358 1349 +2359 1351 +2360 9999 +2361 9999 +2362 9999 +2363 9999 +2364 9999 +2365 9999 +2366 9999 +2367 9999 +2368 9999 +2369 9999 +2370 9999 +2371 9999 +2372 9999 +2373 9999 +2374 9999 +2375 9999 +2376 9999 +2377 9999 +2378 9999 +2379 9999 +2380 9999 +2381 9999 +2382 9999 +2383 9999 +2384 9999 +2385 9999 +2386 9999 +2387 9999 +2388 9999 +2389 9999 +2390 9999 +2391 9999 +2392 9999 +2393 9999 +2394 9999 +2395 9999 +2396 9999 +2397 9999 +2398 9999 +2399 9999 +2400 2430 +2401 2252 +2402 2428 +2403 2566 +2404 2062 +2405 2250 +2406 2426 +2407 2564 +2408 1704 +2409 1876 +2410 2060 +2411 2248 +2412 1422 +2413 1542 +2414 1702 +2415 1874 +2416 1362 +2417 1420 +2418 1540 +2419 1418 +2420 2431 +2421 2253 +2422 2429 +2423 2567 +2424 2063 +2425 2251 +2426 2427 +2427 2565 +2428 1705 +2429 1877 +2430 2061 +2431 2249 +2432 1423 +2433 1543 +2434 1703 +2435 1875 +2436 1363 +2437 1421 +2438 1541 +2439 1419 +2440 2068 +2441 2256 +2442 1548 +2443 1882 +2444 2066 +2445 2254 +2446 1710 +2447 1708 +2448 1880 +2449 2064 +2450 1884 +2451 1546 +2452 1706 +2453 1878 +2454 1426 +2455 1424 +2456 1544 +2457 1368 +2458 1366 +2459 1364 +2460 2069 +2461 2257 +2462 1549 +2463 1883 +2464 2067 +2465 2255 +2466 1711 +2467 1709 +2468 1881 +2469 2065 +2470 1885 +2471 1547 +2472 1707 +2473 1879 +2474 1427 +2475 1425 +2476 1545 +2477 1369 +2478 1367 +2479 1365 +2480 2262 +2481 2260 +2482 2258 +2483 2076 +2484 2074 +2485 2072 +2486 2070 +2487 1892 +2488 1890 +2489 1888 +2490 1886 +2491 1716 +2492 1714 +2493 1712 +2494 1554 +2495 1552 +2496 1550 +2497 1432 +2498 1430 +2499 1428 +2500 2263 +2501 2261 +2502 2259 +2503 2077 +2504 2075 +2505 2073 +2506 2071 +2507 1893 +2508 1891 +2509 1889 +2510 1887 +2511 1717 +2512 1715 +2513 1713 +2514 1555 +2515 1553 +2516 1551 +2517 1433 +2518 1431 +2519 1429 +2520 2438 +2521 2436 +2522 2434 +2523 2432 +2524 2270 +2525 2268 +2526 2266 +2527 2264 +2528 2084 +2529 2082 +2530 2080 +2531 2078 +2532 1896 +2533 1894 +2534 1720 +2535 1718 +2536 1558 +2537 1556 +2538 1436 +2539 1434 +2540 2439 +2541 2437 +2542 2435 +2543 2433 +2544 2271 +2545 2269 +2546 2267 +2547 2265 +2548 2085 +2549 2083 +2550 2081 +2551 2079 +2552 1897 +2553 1895 +2554 1721 +2555 1719 +2556 1559 +2557 1557 +2558 1437 +2559 1435 +2560 2708 +2561 2642 +2562 2544 +2563 2542 +2564 2546 +2565 2406 +2566 2404 +2567 2408 +2568 2232 +2569 2230 +2570 2228 +2571 2042 +2572 2040 +2573 1858 +2574 1856 +2575 1686 +2576 1684 +2577 1526 +2578 1524 +2579 9999 +2580 2709 +2581 2643 +2582 2545 +2583 2543 +2584 2547 +2585 2407 +2586 2405 +2587 2409 +2588 2233 +2589 2231 +2590 2229 +2591 2043 +2592 2041 +2593 1859 +2594 1857 +2595 1687 +2596 1685 +2597 1527 +2598 1525 +2599 9999 +2600 2710 +2601 2648 +2602 2552 +2603 2414 +2604 2646 +2605 2550 +2606 2412 +2607 2236 +2608 2644 +2609 2548 +2610 2410 +2611 2234 +2612 2046 +2613 1862 +2614 1690 +2615 1530 +2616 2044 +2617 1860 +2618 1688 +2619 1528 +2620 2711 +2621 2649 +2622 2553 +2623 2415 +2624 2647 +2625 2551 +2626 2413 +2627 2237 +2628 2645 +2629 2549 +2630 2411 +2631 2235 +2632 2047 +2633 1863 +2634 1691 +2635 1531 +2636 2045 +2637 1861 +2638 1689 +2639 1529 +2640 2654 +2641 2558 +2642 2652 +2643 2556 +2644 2418 +2645 2242 +2646 2650 +2647 2554 +2648 2416 +2649 2240 +2650 2052 +2651 2238 +2652 1534 +2653 1694 +2654 1866 +2655 2050 +2656 2048 +2657 1864 +2658 1692 +2659 1532 +2660 2655 +2661 2559 +2662 2653 +2663 2557 +2664 2419 +2665 2243 +2666 2651 +2667 2555 +2668 2417 +2669 2241 +2670 2053 +2671 2239 +2672 1535 +2673 1695 +2674 1867 +2675 2051 +2676 2049 +2677 1865 +2678 1693 +2679 1533 +2680 2658 +2681 2562 +2682 2424 +2683 2656 +2684 2560 +2685 2422 +2686 2246 +2687 2058 +2688 2420 +2689 2244 +2690 2056 +2691 1872 +2692 1700 +2693 2054 +2694 1870 +2695 1698 +2696 1538 +2697 1868 +2698 1696 +2699 1536 +2700 2659 +2701 2563 +2702 2425 +2703 2657 +2704 2561 +2705 2423 +2706 2247 +2707 2059 +2708 2421 +2709 2245 +2710 2057 +2711 1873 +2712 1701 +2713 2055 +2714 1871 +2715 1699 +2716 1539 +2717 1869 +2718 1697 +2719 1537 +2720 2638 +2721 2636 +2722 2634 +2723 2530 +2724 2528 +2725 2390 +2726 2388 +2727 2216 +2728 2214 +2729 2212 +2730 2028 +2731 2026 +2732 2024 +2733 1844 +2734 1842 +2735 1840 +2736 1672 +2737 1670 +2738 1512 +2739 1510 +2740 2639 +2741 2637 +2742 2635 +2743 2531 +2744 2529 +2745 2391 +2746 2389 +2747 2217 +2748 2215 +2749 2213 +2750 2029 +2751 2027 +2752 2025 +2753 1845 +2754 1843 +2755 1841 +2756 1673 +2757 1671 +2758 1513 +2759 1511 +2760 2538 +2761 2398 +2762 2222 +2763 2536 +2764 2534 +2765 2640 +2766 2396 +2767 2394 +2768 2532 +2769 2220 +2770 2218 +2771 2392 +2772 2032 +2773 2030 +2774 1848 +2775 1846 +2776 1676 +2777 1674 +2778 1516 +2779 1514 +2780 2539 +2781 2399 +2782 2223 +2783 2537 +2784 2535 +2785 2641 +2786 2397 +2787 2395 +2788 2533 +2789 2221 +2790 2219 +2791 2393 +2792 2033 +2793 2031 +2794 1849 +2795 1847 +2796 1677 +2797 1675 +2798 1517 +2799 1515 +2800 2540 +2801 2400 +2802 2402 +2803 2224 +2804 2226 +2805 2036 +2806 2034 +2807 2038 +2808 1852 +2809 1850 +2810 1854 +2811 1680 +2812 1678 +2813 1682 +2814 1520 +2815 1518 +2816 1522 +2817 1414 +2818 1412 +2819 1416 +2820 2541 +2821 2401 +2822 2403 +2823 2225 +2824 2227 +2825 2037 +2826 2035 +2827 2039 +2828 1853 +2829 1851 +2830 1855 +2831 1681 +2832 1679 +2833 1683 +2834 1521 +2835 1519 +2836 1523 +2837 1415 +2838 1413 +2839 1417 +2840 9999 +2841 9999 +2842 9999 +2843 9999 +2844 9999 +2845 9999 +2846 9999 +2847 9999 +2848 9999 +2849 9999 +2850 9999 +2851 9999 +2852 9999 +2853 9999 +2854 9999 +2855 9999 +2856 9999 +2857 9999 +2858 9999 +2859 9999 +2860 9999 +2861 9999 +2862 9999 +2863 9999 +2864 9999 +2865 9999 +2866 9999 +2867 9999 +2868 9999 +2869 9999 +2870 9999 +2871 9999 +2872 9999 +2873 9999 +2874 9999 +2875 9999 +2876 9999 +2877 9999 +2878 9999 +2879 9999 +2880 2370 +2881 2512 +2882 2372 +2883 2196 +2884 2374 +2885 2198 +2886 2010 +2887 1826 +2888 2200 +2889 2012 +2890 1828 +2891 1656 +2892 2014 +2893 1830 +2894 1658 +2895 1498 +2896 1660 +2897 1500 +2898 1408 +2899 1360 +2900 2371 +2901 2513 +2902 2373 +2903 2197 +2904 2375 +2905 2199 +2906 2011 +2907 1827 +2908 2201 +2909 2013 +2910 1829 +2911 1657 +2912 2015 +2913 1831 +2914 1659 +2915 1499 +2916 1661 +2917 1501 +2918 1409 +2919 1361 +2920 2514 +2921 2624 +2922 2516 +2923 2376 +2924 2626 +2925 2518 +2926 2378 +2927 2202 +2928 2520 +2929 2380 +2930 2204 +2931 2016 +2932 1832 +2933 2018 +2934 1834 +2935 1662 +2936 1502 +2937 1410 +2938 1664 +2939 1504 +2940 2515 +2941 2625 +2942 2517 +2943 2377 +2944 2627 +2945 2519 +2946 2379 +2947 2203 +2948 2521 +2949 2381 +2950 2205 +2951 2017 +2952 1833 +2953 2019 +2954 1835 +2955 1663 +2956 1503 +2957 1411 +2958 1665 +2959 1505 +2960 2632 +2961 2526 +2962 2386 +2963 2210 +2964 2630 +2965 2524 +2966 2384 +2967 2208 +2968 2628 +2969 2522 +2970 2382 +2971 2206 +2972 2020 +2973 1836 +2974 2022 +2975 1838 +2976 1666 +2977 1506 +2978 1668 +2979 1508 +2980 2633 +2981 2527 +2982 2387 +2983 2211 +2984 2631 +2985 2525 +2986 2385 +2987 2209 +2988 2629 +2989 2523 +2990 2383 +2991 2207 +2992 2021 +2993 1837 +2994 2023 +2995 1839 +2996 1667 +2997 1507 +2998 1669 +2999 1509 +3000 9999 +3001 9999 +3002 9999 +3003 9999 +3004 9999 +3005 9999 +3006 9999 +3007 9999 +3008 9999 +3009 9999 +3010 9999 +3011 9999 +3012 9999 +3013 9999 +3014 9999 +3015 9999 +3016 9999 +3017 9999 +3018 9999 +3019 9999 +3020 9999 +3021 9999 +3022 9999 +3023 9999 +3024 9999 +3025 9999 +3026 9999 +3027 9999 +3028 9999 +3029 9999 +3030 9999 +3031 9999 +3032 9999 +3033 9999 +3034 9999 +3035 9999 +3036 9999 +3037 9999 +3038 9999 +3039 9999 +3040 1394 +3041 1482 +3042 1484 +3043 1638 +3044 1640 +3045 1642 +3046 1808 +3047 1810 +3048 1812 +3049 1990 +3050 1992 +3051 1994 +3052 2178 +3053 2180 +3054 2182 +3055 2184 +3056 2360 +3057 2362 +3058 2364 +3059 2366 +3060 1395 +3061 1483 +3062 1485 +3063 1639 +3064 1641 +3065 1643 +3066 1809 +3067 1811 +3068 1813 +3069 1991 +3070 1993 +3071 1995 +3072 2179 +3073 2181 +3074 2183 +3075 2185 +3076 2361 +3077 2363 +3078 2365 +3079 2367 +3080 1354 +3081 1396 +3082 1398 +3083 1400 +3084 1486 +3085 1488 +3086 1490 +3087 1644 +3088 1646 +3089 1648 +3090 1814 +3091 1816 +3092 1818 +3093 1996 +3094 1998 +3095 2000 +3096 2186 +3097 2188 +3098 2190 +3099 2368 +3100 1355 +3101 1397 +3102 1399 +3103 1401 +3104 1487 +3105 1489 +3106 1491 +3107 1645 +3108 1647 +3109 1649 +3110 1815 +3111 1817 +3112 1819 +3113 1997 +3114 1999 +3115 2001 +3116 2187 +3117 2189 +3118 2191 +3119 2369 +3120 1356 +3121 1358 +3122 1406 +3123 1402 +3124 1404 +3125 1496 +3126 1492 +3127 1494 +3128 1654 +3129 1650 +3130 1652 +3131 1824 +3132 2008 +3133 1820 +3134 1822 +3135 2006 +3136 2194 +3137 2002 +3138 2004 +3139 2192 +3140 1357 +3141 1359 +3142 1407 +3143 1403 +3144 1405 +3145 1497 +3146 1493 +3147 1495 +3148 1655 +3149 1651 +3150 1653 +3151 1825 +3152 2009 +3153 1821 +3154 1823 +3155 2007 +3156 2195 +3157 2003 +3158 2005 +3159 2193 +3160 9999 +3161 9999 +3162 9999 +3163 9999 +3164 9999 +3165 9999 +3166 9999 +3167 9999 +3168 9999 +3169 9999 +3170 9999 +3171 9999 +3172 9999 +3173 9999 +3174 9999 +3175 9999 +3176 9999 +3177 9999 +3178 9999 +3179 9999 +3180 9999 +3181 9999 +3182 9999 +3183 9999 +3184 9999 +3185 9999 +3186 9999 +3187 9999 +3188 9999 +3189 9999 +3190 9999 +3191 9999 +3192 9999 +3193 9999 +3194 9999 +3195 9999 +3196 9999 +3197 9999 +3198 9999 +3199 9999 +3200 2712 +3201 2713 +3202 2714 +3203 2715 +3204 9999 +3205 9999 +3206 9999 +3207 9999 +3208 9999 +3209 9999 +3210 9999 +3211 9999 +3212 9999 +3213 9999 +3214 9999 +3215 9999 +3216 9999 +3217 9999 +3218 9999 +3219 9999 From 33c5055c945b6e13bbc6857576f3643876986645 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 23 Jan 2026 16:52:23 -0800 Subject: [PATCH 061/174] Add data product to record filtering fraction --- DataProducts/inc/FilterFraction.hh | 23 ++++++++++++++++++++++ DataProducts/src/classes.h | 1 + DataProducts/src/classes_def.xml | 2 ++ Filters/src/RandomPrescaleFilter_module.cc | 18 +++++++++++++++-- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 DataProducts/inc/FilterFraction.hh diff --git a/DataProducts/inc/FilterFraction.hh b/DataProducts/inc/FilterFraction.hh new file mode 100644 index 0000000000..695b2c3b2e --- /dev/null +++ b/DataProducts/inc/FilterFraction.hh @@ -0,0 +1,23 @@ +// +// Run-level art product to record the selection fraction of a filter. This product could be +// part of the raw data output (trigger prescale) or simulation. +// Original author: Dave Brown (LBNL) 2026 +// +#ifndef DataProducts_FilterFraction_hh +#define DataProducts_FilterFraction_hh +namespace mu2e { + class FilterFraction { + public: + enum FilterType { constant=0,sculpted}; // sculpted means the selection depends on the event data content, not just purely (pseudo) random. + FilterFraction(FilterType type, double nominal, double actual) : type_(type),nominal_(nominal), actual_(actual) {} + // accessors + FilterType type() const { return type_; } + double nominalFraction() const { return nominal_; } + double actualFraction() const { return actual_; } + private: + FilterType type_; // type of filtering performed + double nominal_; // nominal fraction (<1) of events expected to be kept by the filter + double actual_; // fraction (<1) of events actually kept by the filter + }; +} +#endif diff --git a/DataProducts/src/classes.h b/DataProducts/src/classes.h index 3d600aa584..2ef7f4a52d 100644 --- a/DataProducts/src/classes.h +++ b/DataProducts/src/classes.h @@ -61,3 +61,4 @@ // General #include "Offline/DataProducts/inc/SurfaceId.hh" +#include "Offline/DataProducts/inc/FilterFraction.hh" diff --git a/DataProducts/src/classes_def.xml b/DataProducts/src/classes_def.xml index b8a8d73418..61c2c9e696 100644 --- a/DataProducts/src/classes_def.xml +++ b/DataProducts/src/classes_def.xml @@ -63,4 +63,6 @@ + + diff --git a/Filters/src/RandomPrescaleFilter_module.cc b/Filters/src/RandomPrescaleFilter_module.cc index 6befcddf37..934727f232 100644 --- a/Filters/src/RandomPrescaleFilter_module.cc +++ b/Filters/src/RandomPrescaleFilter_module.cc @@ -13,6 +13,7 @@ #include "messagefacility/MessageLogger/MessageLogger.h" #include "Offline/SeedService/inc/SeedService.hh" #include "CLHEP/Random/RandFlat.h" +#include "Offline/DataProducts/inc/FilterFraction.hh" namespace mu2e { @@ -39,12 +40,14 @@ namespace mu2e RandomPrescaleFilter & operator = (RandomPrescaleFilter &&) = delete; bool filter(art::Event & e) override; - virtual bool endRun(art::Run& run ) override; + bool endRun(art::Run& run ) override; + bool endSubRun(art::SubRun& subrun ) override; private: art::RandomNumberGenerator::base_engine_t& engine_; CLHEP::RandFlat randflat_; int debug_; + double frac_; unsigned nevt_, npass_; }; @@ -53,8 +56,11 @@ namespace mu2e engine_(createEngine( art::ServiceHandle()->getSeed())), randflat_( engine_, 0.0, conf().nPrescale() ), debug_(conf().debugLevel()), + frac_(1.0/double(conf().nPrescale())), nevt_(0), npass_(0) - {} + { + produces(); + } inline bool RandomPrescaleFilter::filter(art::Event & event) { @@ -64,9 +70,17 @@ namespace mu2e return retval; } + bool RandomPrescaleFilter::endSubRun( art::SubRun& subrun ) { + auto ff = std::make_unique(FilterFraction::constant,frac_, double(npass_)/double(nevt_)); + subrun.put(std::move(ff),"",art::fullSubRun()); + return true; + } + + bool RandomPrescaleFilter::endRun( art::Run& run ) { if(debug_ > 0 && nevt_ > 0){ std::cout << moduleDescription().moduleLabel() << " passed " << npass_ << " events out of " << nevt_ << " for a ratio of " << float(npass_)/float(nevt_) << std::endl; + } return true; } From 396e6188849eda0418fc27c0c5fbd4c93cfd8e76 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 08:37:37 -0600 Subject: [PATCH 062/174] Minor cleaning --- CalPatRec/src/CalHelixFinderAlg.cc | 74 +----------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 6336e6dcaf..5caac2537b 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -3202,19 +3202,13 @@ namespace mu2e { Phi0 = polyAtan2(dy2,dx2); //----------------------------------------------------------------------------- // this assumes that the helix is right-handed, *FIXME* -// make sure that we are lookign for a particle which makes close to expected +// make sure that we are looking for a particle which makes close to expected // number of turns //----------------------------------------------------------------------------- float dphi32 = polyAtan2(dy3,dx3) - Phi0; if (dphi32*_dfdzsign < 0.) dphi32 += 2.*M_PI; - // float exp_dphi = _mpDfDz*dz32; - - //check id DfDz is within the range - if ( (fabs(DfDz32) < _minDfDz) || (fabs(DfDz32) > _maxDfDz)) DfDz32 = _mpDfDz; - DfDz32 = dphi32/dz32; - float diff = fabs(DfDz32 - _mpDfDz); float diff_plus = fabs( (dphi32 + 2.*M_PI)/dz32 -_mpDfDz ); while ( diff_plus < diff ){ @@ -3262,24 +3256,6 @@ namespace mu2e { void CalHelixFinderAlg::calculateDfDz(float phi0, float phi1, float z0, float z1, float& DfDz) { float deltaPhi = TVector2::Phi_mpi_pi(phi1-phi0); DfDz = deltaPhi/(z1-z0); - - // 2018-01-02: don't do that! - // float diff = fabs(DfDz - _mpDfDz); - // float diff_plus = fabs((deltaPhi + 2.*M_PI)/(z1-z0) -_mpDfDz); - // while (diff_plus < diff) { - // deltaPhi = deltaPhi + 2.*M_PI; - // DfDz = deltaPhi/(z1-z0); - // diff = fabs(DfDz - _mpDfDz); - // diff_plus = fabs( (deltaPhi + 2.*M_PI)/(z1-z0) -_mpDfDz ); - // } - - // float diff_minus = fabs((deltaPhi - 2.*M_PI)/(z1-z0) -_mpDfDz); - // while (diff_minus < diff) { - // deltaPhi = deltaPhi - 2.*M_PI; - // DfDz = deltaPhi/(z1-z0); - // diff = fabs(DfDz - _mpDfDz); - // diff_minus = fabs( (deltaPhi - 2.*M_PI)/(z1-z0) -_mpDfDz ); - // } } //----------------------------------------------------------------------------- @@ -3419,55 +3395,7 @@ namespace mu2e { // store the corrected value of phi Hit->_hphi = phi_rot; DPhi = dphi_min; - } - // void CalHelixFinderAlg::resolve2PiAmbiguity(CalHelixFinderData& Helix,const XYZVectorF& Center, float DfDz, float Phi0){ - - // const XYZVectorF* pos; - // float z, phi, phi_ref, dphi, dx, dy; - - // FaceZ_t* facez(0); - // PanelZ_t* panelz(0); - // mu2e::ComboHit* hit(0); - - // for (int f=0; fpanelZs[p];//Helix._oTracker[p]; - // int nhits = panelz->nChHits(); - // for (int i=0; i_chHitsToProcess.at(i); - // pos = &hit->_pos; - // z = pos->z(); - - // dx = (pos->x() - Center.x()); - // dy = (pos->y() - Center.y()); - // phi = polyAtan2(dy, dx); - // if (phi < 0) phi = phi + 2*M_PI;//phi = TVector2::Phi_0_2pi(phi); - // // predicted value of phi - // phi_ref = z*DfDz + Phi0; - // // signed residual - // dphi = phi_ref - phi; - // // resolve the 2PI ambiguity - // while (dphi > M_PI) { - // phi += 2*M_PI; - // dphi = phi_ref - phi; - // } - // while (dphi < -M_PI) { - // phi -= 2*M_PI; - // dphi = phi_ref - phi; - // } - // // store the corrected value of phi - // // _phiCorrected[i] = phi; - // } - - // } - // } - // // don't know - // _phiCorrectedDefined = 0; - // } - - //--------------------------------------------------------------------------- // reset track paramters From df426c145f9e5019bf3008cad8976452323651af Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 09:27:57 -0600 Subject: [PATCH 063/174] Optionally produce the EWM as well as the event header --- DAQ/src/EventHeaderFromCFOFragment_module.cc | 64 ++++++++++++++------ 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/DAQ/src/EventHeaderFromCFOFragment_module.cc b/DAQ/src/EventHeaderFromCFOFragment_module.cc index 063582efed..9ecc8468e5 100644 --- a/DAQ/src/EventHeaderFromCFOFragment_module.cc +++ b/DAQ/src/EventHeaderFromCFOFragment_module.cc @@ -4,30 +4,36 @@ // // ====================================================================== +// Framework #include "art/Framework/Core/EDProducer.h" #include "art/Framework/Principal/Event.h" #include "art/Framework/Services/Registry/ServiceHandle.h" #include "fhiclcpp/ParameterSet.h" - #include "art/Framework/Principal/Handle.h" + +// artdaq #include #include "artdaq-core-mu2e/Overlays/CFOEventFragment.hh" +#include "artdaq-core-mu2e/Overlays/CFO_Packets/CFO_Event.h" +#include "artdaq-core-mu2e/Overlays/CFO_Packets/CFO_EventRecord.h" #include "artdaq-core-mu2e/Overlays/FragmentType.hh" - #include -#include +// Offline +#include "Offline/DataProducts/inc/EventWindowMarker.hh" +// C++ +#include #include - #include #include #include #include #include +// TRACE #include "trace.h" -#define TRACE_NAME "Mu2eSubEventReceiver" +#define TRACE_NAME "EventHeaderFromCFOFragment" namespace art { class EventHeaderFromCFOFragment; @@ -39,8 +45,11 @@ class art::EventHeaderFromCFOFragment : public EDProducer { public: struct Config { - fhicl::Atom cfoTag {fhicl::Name("cfoTag"), fhicl::Comment("Input module")}; - fhicl::Atom diagLevel{fhicl::Name("diagLevel"), fhicl::Comment("diagnostic level")}; + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Atom cfoTag {Name("cfoTag"), Comment("Input CFO fragment tag")}; + fhicl::Atom ewm {Name("createEWM"), Comment("Produce an event window marker object")}; + fhicl::Atom diagLevel{Name("diagLevel"), Comment("diagnostic level")}; }; // --- C'tor/d'tor: @@ -54,6 +63,7 @@ class art::EventHeaderFromCFOFragment : public EDProducer { private: art::InputTag cfoFragmentTag_; + bool ewm_; int diagLevel_; }; @@ -65,8 +75,13 @@ art::EventHeaderFromCFOFragment::EventHeaderFromCFOFragment( const art::EDProducer::Table& config) : art::EDProducer{config}, cfoFragmentTag_(config().cfoTag()), + ewm_(config().ewm()), diagLevel_(config().diagLevel()) { produces(); + if(ewm_) { + TLOG(TLVL_DEBUG + 2) << "Producing EventWindowMarker"; + produces(); + } } // ---------------------------------------------------------------------- @@ -74,30 +89,41 @@ art::EventHeaderFromCFOFragment::EventHeaderFromCFOFragment( void art::EventHeaderFromCFOFragment::produce(Event& event) { // Collection of CaloHits for the event - std::unique_ptr evtHdr(new mu2e::EventHeader); - art::Handle cfoFragmentHandle; + std::unique_ptr evtHdr(new mu2e::EventHeader); + std::unique_ptr ewm((ewm_) ? new mu2e::EventWindowMarker : nullptr); + art::Handle cfoFragmentHandle; if(!event.getByLabel(cfoFragmentTag_, cfoFragmentHandle)) { event.put(std::move(evtHdr)); - TLOG(TLVL_DEBUG) << "No CFO fragments found"; + if(ewm_) event.put(std::move(ewm)); + TLOG(TLVL_DEBUG + 1) << "No CFO fragments found"; return; } const auto *fragments = cfoFragmentHandle.product(); if (fragments->size()>0){ const auto &frag = fragments->at(0); - mu2e::CFOEventFragment cfoFrag(frag); - const CFOLib::CFO_Event cfo = cfoFrag.getData(); - //const CFO_EventRecord& cfoRecord = cfo.GetEventRecord(); - evtHdr->mode = 0;//cfo.GetEventMode(); - evtHdr->ewt = static_cast(cfo.GetEventWindowTag().GetEventWindowTag().to_ullong()); - evtHdr->flags = cfo.GetEventMode().isOnSpillFlagSet(); - TLOG(TLVL_DEBUG+20) << "mode = "<< evtHdr->mode <<" ewt = "<< evtHdr->ewt << " flags = " << evtHdr->flags; - }else { - TLOG(TLVL_DEBUG) << "No CFO fragments found in the event"; + const mu2e::CFOEventFragment cfoFrag(frag); + const CFOLib::CFO_Event cfo = cfoFrag.getData(); + const CFOLib::CFO_EventRecord& cfoRecord = cfo.GetEventRecord(); + evtHdr->mode = 0;//cfo.GetEventMode(); + evtHdr->ewt = static_cast(cfo.GetEventWindowTag().GetEventWindowTag().to_ullong()); + evtHdr->flags = cfo.GetEventMode().isOnSpillFlagSet(); + evtHdr->eventDuration = cfoRecord.event_duration; + TLOG(TLVL_DEBUG + 20) << "mode = " << evtHdr->mode << " ewt = "<< evtHdr->ewt << " flags = " << evtHdr->flags + << " onspill = " << evtHdr->isOnSpill() << " duration = " << evtHdr->eventDuration; + } else { + TLOG(TLVL_DEBUG + 3) << "No CFO fragments found in the event"; + } + + if(ewm_) { + constexpr double tick = 5.; // clock ticks -> ns + ewm->_spillType = (evtHdr->isOnSpill()) ? mu2e::EventWindowMarker::SpillType::onspill : mu2e::EventWindowMarker::SpillType::offspill; + ewm->_eventLength = tick*evtHdr->eventDuration; } event.put(std::move(evtHdr)); + if(ewm_) event.put(std::move(ewm)); } // produce() // ====================================================================== From 1d70d8b5540504c1487c650fef66053f2786238b Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 10:18:47 -0600 Subject: [PATCH 064/174] Add example fcl to split Triggered and Triggerable --- Filters/fcl/TestTriggerRestultsFilter.fcl | 20 --------- Filters/test/splitTriggerResults.fcl | 53 +++++++++++++++++++++++ 2 files changed, 53 insertions(+), 20 deletions(-) delete mode 100644 Filters/fcl/TestTriggerRestultsFilter.fcl create mode 100644 Filters/test/splitTriggerResults.fcl diff --git a/Filters/fcl/TestTriggerRestultsFilter.fcl b/Filters/fcl/TestTriggerRestultsFilter.fcl deleted file mode 100644 index 42550e1418..0000000000 --- a/Filters/fcl/TestTriggerRestultsFilter.fcl +++ /dev/null @@ -1,20 +0,0 @@ - -process_name : TestFilter - -source : { - module_type : RootInput - fileNames : @nil -} - -physics : { - filters : { - TRF : { - module_type : TriggerResultsFilter - PrintFirst : true - ProcessName : "recomcdigistrig" - TriggerNames : ["tprSeedDeM_trigger", "tprSeedDeP_trigger", "cprSeedDeM_trigger", "cprSeedDeP_trigger" ] - } - } - MyTrigPath : [ TRF ] -} - diff --git a/Filters/test/splitTriggerResults.fcl b/Filters/test/splitTriggerResults.fcl new file mode 100644 index 0000000000..c97a212f73 --- /dev/null +++ b/Filters/test/splitTriggerResults.fcl @@ -0,0 +1,53 @@ +# Split an art file based on the trigger results into MC triggerable and triggered streams + +#include "Offline/fcl/minimalMessageService.fcl" +#include "Offline/fcl/standardServices.fcl" + +process_name : SplitTriggerResults + +source : { + module_type : RootInput + fileNames : @nil +} + +physics : { + filters : { + Triggered : { # High momentum track triggers + module_type : TriggerResultsFilter + ProcessName : "Digitize" + TriggerNames : [ "apr_TrkDe_80m70p", "cpr_TrkDe_80m70p", "tpr_TrkDe_80m70p" ] + # TriggerBits : [ 210, 160, 110 ] + } + Triggerable : { # MC truth selections for high momentum particles in the tracker or high energy in the calo + module_type : TriggerResultsFilter + ProcessName : "Digitize" + TriggerNames : [ "TriggerableLHPath", "TriggerableTwoTrackPath", "TriggerableCaloPath" ] + # TriggerBits : [ 20, 21, 25 ] + } + } + + Triggered : [ Triggered ] + Triggerable : [ Triggerable ] + EndPath : [ TriggeredOutput, TriggerableOutput ] + trigger_paths : [ Triggered, Triggerable ] + end_paths : [ EndPath ] +} + +outputs : { + TriggeredOutput : { + module_type : RootOutput + SelectEvents : [ Triggered ] + # More trivial splitting, but doesn't exercise the TriggerResultsFilter module + # SelectEvents : [ "Digitize:apr_TrkDe_80m70p", "Digitize:cpr_TrkDe_80m70p", "Digitize:tpr_TrkDe_80m70p" ] + outputCommands : [ "keep *_*_*_*" ] + fileName : "dig.user.Triggered.version.%6r_%8#.art" + } + TriggerableOutput : { + module_type : RootOutput + SelectEvents : [ Triggerable ] + # More trivial splitting, but doesn't exercise the TriggerResultsFilter module + # SelectEvents : [ "Digitize:TriggerableLHPath", "Digitize:TriggerableTwoTrackPath", "Digitize:TriggerableCaloPath" ] + outputCommands : [ "keep *_*_*_*" ] + fileName : "dig.user.Triggerable.version.%6r_%8#.art" + } +} From 03385a1bcbe651c97b59f90dad0986a321fb79e5 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 12:42:38 -0600 Subject: [PATCH 065/174] Fix clock unit --- DAQ/src/EventHeaderFromCFOFragment_module.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DAQ/src/EventHeaderFromCFOFragment_module.cc b/DAQ/src/EventHeaderFromCFOFragment_module.cc index 9ecc8468e5..abde98f418 100644 --- a/DAQ/src/EventHeaderFromCFOFragment_module.cc +++ b/DAQ/src/EventHeaderFromCFOFragment_module.cc @@ -117,9 +117,9 @@ void art::EventHeaderFromCFOFragment::produce(Event& event) { } if(ewm_) { - constexpr double tick = 5.; // clock ticks -> ns + constexpr double tick = 25.; // clock ticks -> ns ewm->_spillType = (evtHdr->isOnSpill()) ? mu2e::EventWindowMarker::SpillType::onspill : mu2e::EventWindowMarker::SpillType::offspill; - ewm->_eventLength = tick*evtHdr->eventDuration; + ewm->_eventLength = tick * evtHdr->eventDuration; } event.put(std::move(evtHdr)); From 9d1eecca7cf152177e1d091a3c63d464764bd707 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 13:18:58 -0600 Subject: [PATCH 066/174] Add a filter to veto events with high occupancies --- DAQ/src/OccupancyFilter_module.cc | 252 ++++++++++++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 DAQ/src/OccupancyFilter_module.cc diff --git a/DAQ/src/OccupancyFilter_module.cc b/DAQ/src/OccupancyFilter_module.cc new file mode 100644 index 0000000000..c42ea29bdc --- /dev/null +++ b/DAQ/src/OccupancyFilter_module.cc @@ -0,0 +1,252 @@ +// +// Filter out events with high occupancy that could disrupt DAQ processing +// Original author: Michael MacKenzie, 2026 + +// framework +#include "art/Framework/Core/EDFilter.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Services/Registry/ServiceHandle.h" +#include "fhiclcpp/types/Atom.h" +#include "fhiclcpp/types/OptionalTable.h" + +// artdaq +#include +#include +#include "artdaq-core-mu2e/Overlays/FragmentType.hh" + +// Offline +#include "Offline/RecoDataProducts/inc/StrawHit.hh" +#include "Offline/RecoDataProducts/inc/StrawDigi.hh" +#include "Offline/RecoDataProducts/inc/ComboHit.hh" +#include "Offline/RecoDataProducts/inc/CaloHit.hh" +#include "Offline/RecoDataProducts/inc/CaloDigi.hh" + +// C++ +#include +#include +#include +#include + +// TRACE +#include "TRACE/tracemf.h" +#define TRACE_NAME "OccupancyFilter" + +namespace mu2e { + class OccupancyFilter : public art::EDFilter { + public: + + // Table for a specific collection selection + struct CutConfig { + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Atom tag {Name("tag") , Comment("Collection tag")}; + fhicl::Atom maxSize{Name("maxSize"), Comment("Maximum collection size")}; + }; + + // Main configuration + struct Config { + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::OptionalTable comboHits {Name("comboHits") , Comment("Tracker combo hits selection")}; + fhicl::OptionalTable strawHits {Name("strawHits") , Comment("Tracker straw hits selection")}; + fhicl::OptionalTable strawDigis{Name("strawDigis"), Comment("Tracker straw digis selection")}; + fhicl::OptionalTable caloHits {Name("caloHits") , Comment("Calorimeter hits selection")}; + fhicl::OptionalTable caloDigis {Name("caloDigis") , Comment("Calorimeter digis selection")}; + fhicl::OptionalTable fragments {Name("fragments") , Comment("Fragments selection")}; + fhicl::Atom diagLevel {Name("diagLevel") , Comment("Diagnostic printout level"), 0}; + }; + + using Parameters = art::EDFilter::Table; + + explicit OccupancyFilter(const Parameters& config); + + + private: + bool filter (art::Event& event) override; + bool endRun (art::Run& run ) override; + + // Check if a collection passes the selection + template bool check_collection(const art::Event& event, const std::string& tag, const size_t max_size); + bool check_fragments(const art::Event& event, const size_t max_size); + + // Inputs + bool _filterComboHits; + bool _filterStrawHits; + bool _filterStrawDigis; + bool _filterCaloHits; + bool _filterCaloDigis; + bool _filterFragments; + int _diagLevel; + + int _maxComboHits; + std::string _tagComboHits; + int _maxStrawHits; + std::string _tagStrawHits; + int _maxStrawDigis; + std::string _tagStrawDigis; + int _maxCaloHits; + std::string _tagCaloHits; + int _maxCaloDigis; + std::string _tagCaloDigis; + int _maxFragments; + + // Data + int _nevt, _npass; + + }; + + //----------------------------------------------------------------------------- + OccupancyFilter::OccupancyFilter(const Parameters& conf) + : art::EDFilter{conf} + , _filterComboHits (conf().comboHits ()) + , _filterStrawHits (conf().strawHits ()) + , _filterStrawDigis(conf().strawDigis()) + , _filterCaloHits (conf().caloHits ()) + , _filterCaloDigis (conf().caloDigis ()) + , _filterFragments (conf().fragments ()) + , _diagLevel(conf().diagLevel()) + , _nevt(0) + , _npass(0) + { + // Check each collection option if it's set, getting its info if available + if(_filterComboHits) { + _maxComboHits = conf().comboHits()->maxSize(); + _tagComboHits = conf().comboHits()->tag (); + } + if(_filterStrawHits) { + _maxStrawHits = conf().strawHits()->maxSize(); + _tagStrawHits = conf().strawHits()->tag (); + } + if(_filterStrawDigis) { + _maxStrawDigis = conf().strawDigis()->maxSize(); + _tagStrawDigis = conf().strawDigis()->tag (); + } + if(_filterCaloHits) { + _maxCaloHits = conf().caloHits()->maxSize(); + _tagCaloHits = conf().caloHits()->tag (); + } + if(_filterCaloDigis) { + _maxCaloDigis = conf().caloDigis()->maxSize(); + _tagCaloDigis = conf().caloDigis()->tag (); + } + if(_filterFragments) { + _maxFragments = conf().fragments()->maxSize(); + } + + TLOG(TLVL_DEBUG + 1) << ":" + << " filter combo hits = " << _filterComboHits << " max = " << _maxComboHits + << " filter straw hits = " << _filterStrawHits << " max = " << _maxStrawHits + << " filter straw digis = " << _filterStrawDigis << " max = " << _maxStrawDigis + << " filter calo hits = " << _filterCaloHits << " max = " << _maxCaloHits + << " filter calo digis = " << _filterCaloDigis << " max = " << _maxCaloDigis + << " filter fragments = " << _filterFragments << " max = " << _maxFragments; + } + + //----------------------------------------------------------------------------- + // Check if a collection passes the selection + template + bool OccupancyFilter::check_collection(const art::Event& event, const std::string& tag, const size_t max_size) { + // Attempt to get the collection + art::Handle handle; + if(!event.getByLabel(tag, handle)) { + TLOG(TLVL_WARNING) << ": Unable to find handle for " << typeid(T).name() << " with tag " << tag; + std::cout << "[OccupancyFilter::" << __func__ << "]: Unable to find handle for " << typeid(T).name() << " with tag " << tag << std::endl; + return true; // don't filter if it's missing, as it's not high occupancy + } + + // Check the collection + const T* collection = handle.product(); + const size_t nobj = collection->size(); + const bool passed = nobj < max_size; + TLOG(TLVL_DEBUG + 3) << ": handle " << typeid(T).name() << " with tag " << tag + << " has size " << nobj << " and result " << passed; + std::cout << "[OccupancyFilter::" << __func__ << "]: handle " << typeid(T).name() << " with tag " << tag + << " has size " << nobj << " and result " << passed << std::endl; + if(!passed) TLOG(TLVL_DEBUG + 4) << ": handle " << typeid(T).name() << " with tag " << tag + << " has size " << nobj << " and fails the check (max = " << max_size << ")"; + return passed; + } + + //----------------------------------------------------------------------------- + // Check if the fragment collection passes the selection + bool OccupancyFilter::check_fragments(const art::Event& event, const size_t max_size) { + if(max_size == 0) return false; // impossible to pass + + // Get all fragment handles + std::vector> fragmentHandles = event.getMany>(); + + // Count all DTCEVT fragments + size_t nfragments(0); + for (const auto& handle : fragmentHandles) { + if (!handle.isValid() || handle->empty()) { + continue; + } + + // Container type --> count fragments in each block + if (handle->front().type() == artdaq::Fragment::ContainerFragmentType) { + for (const auto& cont : *handle) { + artdaq::ContainerFragment contf(cont); + if (contf.fragment_type() != mu2e::FragmentType::DTCEVT) { + break; + } + + for (size_t ii = 0; ii < contf.block_count(); ++ii) { + nfragments += contf[ii]->size(); + if(nfragments >= max_size) { + TLOG(TLVL_DEBUG + 10) << ": Reached maximum fragments at " << nfragments; + return false; // stop processing if we ever fail + } + } + } + } else { // directly a list of fragments + if (handle->front().type() == mu2e::FragmentType::DTCEVT) { + nfragments += handle->size(); + if(nfragments >= max_size) { + TLOG(TLVL_DEBUG + 10) << ": Reached maximum fragments at " << nfragments; + return false; // stop processing if we ever fail + } + } + } + } + TLOG(TLVL_DEBUG + 11) << ": Passed event, N(fragments) = " << nfragments; + + return true; // can only reach here if we don't fail the checks + } + + //----------------------------------------------------------------------------- + bool OccupancyFilter::filter(art::Event& event) { + + // Count total events seen + ++_nevt; + + // Filter flag + bool passed = true; + + // Filter on each requested collection + if(_filterComboHits ) passed &= check_collection(event, _tagComboHits , _maxComboHits ); + if(_filterStrawHits ) passed &= check_collection(event, _tagStrawHits , _maxStrawHits ); + if(_filterStrawDigis) passed &= check_collection(event, _tagStrawDigis, _maxStrawDigis); + if(_filterCaloHits ) passed &= check_collection(event, _tagCaloHits , _maxCaloHits ); + if(_filterCaloDigis ) passed &= check_collection(event, _tagCaloDigis , _maxCaloDigis ); + if(_filterFragments ) passed &= check_fragments(event, _maxFragments); + TLOG(TLVL_DEBUG + 5) << ": Event has status " << passed; + + // Count accepted events + if(passed) ++_npass; + else TLOG(TLVL_DEBUG + 6) << ": Event failed occupancy selection"; + + // Return the result + return passed; + } + + //----------------------------------------------------------------------------- + bool OccupancyFilter::endRun(art::Run& run) { + // Print a summary of the filter results + const float rate = (_nevt > 0) ? float(_npass)/float(_nevt) : 0.f; + TLOG(TLVL_DEBUG + 2) << "passed " << _npass << " events out of " << _nevt << " for a ratio of " << rate; + return true; + } +} + +DEFINE_ART_MODULE(mu2e::OccupancyFilter) From bc307366a56ee5bbba6f95911d11d8719b563f87 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 13:22:21 -0600 Subject: [PATCH 067/174] Remove debug printouts --- DAQ/src/OccupancyFilter_module.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/DAQ/src/OccupancyFilter_module.cc b/DAQ/src/OccupancyFilter_module.cc index c42ea29bdc..565143b088 100644 --- a/DAQ/src/OccupancyFilter_module.cc +++ b/DAQ/src/OccupancyFilter_module.cc @@ -151,7 +151,6 @@ namespace mu2e { art::Handle handle; if(!event.getByLabel(tag, handle)) { TLOG(TLVL_WARNING) << ": Unable to find handle for " << typeid(T).name() << " with tag " << tag; - std::cout << "[OccupancyFilter::" << __func__ << "]: Unable to find handle for " << typeid(T).name() << " with tag " << tag << std::endl; return true; // don't filter if it's missing, as it's not high occupancy } @@ -161,8 +160,6 @@ namespace mu2e { const bool passed = nobj < max_size; TLOG(TLVL_DEBUG + 3) << ": handle " << typeid(T).name() << " with tag " << tag << " has size " << nobj << " and result " << passed; - std::cout << "[OccupancyFilter::" << __func__ << "]: handle " << typeid(T).name() << " with tag " << tag - << " has size " << nobj << " and result " << passed << std::endl; if(!passed) TLOG(TLVL_DEBUG + 4) << ": handle " << typeid(T).name() << " with tag " << tag << " has size " << nobj << " and fails the check (max = " << max_size << ")"; return passed; From 9f59d6879b37887d29d4fc705678083e99e8cdaf Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sat, 24 Jan 2026 16:23:33 -0600 Subject: [PATCH 068/174] a full comversion between raw and offline channels --- DbTables/inc/CalChannels.hh | 69 ++++++++++++++++++++++++++++++++++ DbTables/src/DbTableFactory.cc | 3 ++ 2 files changed, 72 insertions(+) create mode 100644 DbTables/inc/CalChannels.hh diff --git a/DbTables/inc/CalChannels.hh b/DbTables/inc/CalChannels.hh new file mode 100644 index 0000000000..b033371a11 --- /dev/null +++ b/DbTables/inc/CalChannels.hh @@ -0,0 +1,69 @@ +#ifndef DbTables_CalChannels_hh +#define DbTables_CalChannels_hh + + +#include +#include +#include +#include "Offline/DbTables/inc/DbTable.hh" +#include "Offline/DataProducts/inc/CaloSiPMId.hh" +#include "Offline/DataProducts/inc/CaloRawSiPMId.hh" + +namespace mu2e { + + class CalChannels : public DbTable { + public: + typedef std::shared_ptr ptr_t; + typedef std::shared_ptr cptr_t; + + class Row { + public: + Row(CaloRawSiPMId rawid, CaloSiPMId roid): + _rawid(rawid), + _roid(roid){} + CaloRawSiPMId rawid() const { return _rawid;} + CaloSiPMId roid() const { return _roid;} + + private: + CaloRawSiPMId _rawid; + CaloSiPMId _roid; + }; + + constexpr static const char* cxname = "CalChannels"; + + CalChannels():DbTable(cxname,"cal.channels","rawid,roid"){} + + const Row& row(CaloRawSiPMId rawid) const { + return _rows.at(rawid.id()); } + std::vector const& rows() const {return _rows;} + std::size_t nrow() const override { return _rows.size(); }; + size_t size() const override { return baseSize() + nrow()*sizeof(Row); }; + virtual std::size_t nrowFix() const override { return CaloConst::_nRawChannel; }; + const std::string orderBy() const { return std::string("rawid"); } + void addRow(const std::vector& columns) override { + std::uint16_t index = std::stoul(columns[0]); + // enforce order, so channels can be looked up by index + if (index >= CaloConst::_nRawChannel || index != _rows.size()) { + throw cet::exception("CALOCHANNELS_BAD_INDEX") + << "CalChannels::addRow found index out of order: " + < _rows; + }; +} +#endif diff --git a/DbTables/src/DbTableFactory.cc b/DbTables/src/DbTableFactory.cc index fef96dd7c3..b8576e4d2b 100644 --- a/DbTables/src/DbTableFactory.cc +++ b/DbTables/src/DbTableFactory.cc @@ -9,6 +9,7 @@ #include "Offline/DbTables/inc/SimEfficiencies.hh" #include "Offline/DbTables/inc/SimEfficiencies2.hh" +#include "Offline/DbTables/inc/CalChannels.hh" #include "Offline/DbTables/inc/CalSourceEnergyCalib.hh" #include "Offline/DbTables/inc/CalCosmicEnergyCalib.hh" #include "Offline/DbTables/inc/CalCosmicEnergyCalibInfo.hh" @@ -94,6 +95,8 @@ mu2e::DbTable::ptr_t mu2e::DbTableFactory::newTable(std::string const& name) { return std::shared_ptr(new mu2e::CRVSiPM()); } else if (name == "CRVTime") { return std::shared_ptr(new mu2e::CRVTime()); + } else if (name=="CalChannels") { + return std::shared_ptr(new mu2e::CalChannels()); } else if (name=="CalSourceEnergyCalib") { return std::shared_ptr(new mu2e::CalSourceEnergyCalib()); } else if (name=="CalCosmicEnergyCalib") { From 8da7466942567704c9e2ac2e4181cd30a0059356 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sat, 24 Jan 2026 16:24:21 -0600 Subject: [PATCH 069/174] update for new CalChannels --- CaloConditions/inc/CaloDAQMapCache.hh | 19 ++++++++++-- CaloConditions/inc/CaloDAQMapMaker.hh | 4 +-- CaloConditions/src/CaloDAQMapMaker.cc | 42 +++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/CaloConditions/inc/CaloDAQMapCache.hh b/CaloConditions/inc/CaloDAQMapCache.hh index a18945e349..45b0b3c3cb 100644 --- a/CaloConditions/inc/CaloDAQMapCache.hh +++ b/CaloConditions/inc/CaloDAQMapCache.hh @@ -16,22 +16,33 @@ namespace mu2e { _useDb(config.useDb()),_maker(config) {} void initialize() { + if (_useDb) { + _cch_p = std::make_unique>(); + } } set_t makeSet(art::EventID const& eid) { ProditionsEntity::set_t cids; - return cids; + if (_useDb) { + _cch_p->get(eid); + cids.insert(_cch_p->cid()); + } + return cids; } DbIoV makeIov(art::EventID const& eid) { DbIoV iov; iov.setMax(); // start with full IOV range + if (_useDb) { + _cch_p->get(eid); + iov.overlap(_cch_p->iov()); + } return iov; } ProditionsEntity::ptr makeEntity(art::EventID const& eid) { if (_useDb) { - return _maker.fromDb(); + return _maker.fromDb(_cch_p->getPtr(eid)); } else { return _maker.fromFcl(); } @@ -41,6 +52,10 @@ namespace mu2e { bool _useDb; CaloDAQMapMaker _maker; + // these handles are not default constructed + // so the db can be completely turned off + std::unique_ptr> _cch_p; + }; } diff --git a/CaloConditions/inc/CaloDAQMapMaker.hh b/CaloConditions/inc/CaloDAQMapMaker.hh index 9805548257..9a20385fc4 100644 --- a/CaloConditions/inc/CaloDAQMapMaker.hh +++ b/CaloConditions/inc/CaloDAQMapMaker.hh @@ -8,7 +8,7 @@ #include "Offline/CaloConditions/inc/CaloDAQMap.hh" #include "Offline/CaloConfig/inc/CaloDAQMapConfig.hh" - +#include "Offline/DbTables/inc/CalChannels.hh" namespace mu2e { @@ -18,7 +18,7 @@ namespace mu2e { public: CaloDAQMapMaker(CaloDAQMapConfig const& config):_config(config) {} ptr_t fromFcl(); - ptr_t fromDb(); + ptr_t fromDb(CalChannels::cptr_t cch_p); private: diff --git a/CaloConditions/src/CaloDAQMapMaker.cc b/CaloConditions/src/CaloDAQMapMaker.cc index f5aa16967b..f65d12a74e 100644 --- a/CaloConditions/src/CaloDAQMapMaker.cc +++ b/CaloConditions/src/CaloDAQMapMaker.cc @@ -34,7 +34,7 @@ namespace mu2e { CaloDAQMap::OfflineArray offline2Raw; uint16_t oid,rid,nRead(0); - ordFile >> oid >> rid; + ordFile >> rid >> oid; while (!ordFile.eof()) { if(rid >= CaloConst::_nRawChannel) { @@ -52,7 +52,7 @@ namespace mu2e { offline2Raw[oid] = CaloRawSiPMId(rid); } - ordFile >> oid >> rid; + ordFile >> rid >> oid; } @@ -68,13 +68,43 @@ namespace mu2e { } // end fromFcl + //*************************************************** - CaloDAQMap::ptr_t CaloDAQMapMaker::fromDb() { + CaloDAQMap::ptr_t CaloDAQMapMaker::fromDb(CalChannels::cptr_t cch_p) { - // initially fill from fcl to get all the constants - auto ptr = fromFcl(); + if (_config.verbose()>0) { + cout << "CaloDAQMapMaker::fromDb making CaloDAQMap\n"; + } + + CaloDAQMap::RawArray raw2Offline; + CaloDAQMap::OfflineArray offline2Raw; + + for (auto const& row : cch_p->rows()) { + CaloRawSiPMId rawid = row.rawid(); + CaloSiPMId roid = row.roid(); + if(!rawid.isValid()) { + throw cet::exception("CALODAQMAPMAKER_RANGE") << "CaloDAQMapMaker found invalid rawId" << rawid << endl; + } + if(!(roid.isValid() || roid.id() == CaloConst::_invalid)) { + throw cet::exception("CALODAQMAPMAKER_RANGE") << "CaloDAQMapMaker found invalid offlineId " << roid << endl; + } - // swaps table added here when needed + raw2Offline[rawid.id()] = roid; + + if(roid.isValid()) { + offline2Raw[roid.id()] = rawid; + } + } // end loop over table + + // check that all roid were filled since some table entries are set + // to invalid and there is no other check that this was done correctly + for (auto const& cc : offline2Raw) { + if(!cc.isValid()) { + throw cet::exception("CALODAQMAPMAKER_MISSING") << "CaloDAQMapMaker found missing roid " << endl; + } + } + + auto ptr = make_shared(raw2Offline, offline2Raw); return ptr; From 81938d4c0aaa286f0fab7cb04c960eac0db365cc Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 24 Jan 2026 16:24:50 -0600 Subject: [PATCH 070/174] Fix CMake --- DAQ/CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/DAQ/CMakeLists.txt b/DAQ/CMakeLists.txt index d32ee8e7c6..a70258c7eb 100644 --- a/DAQ/CMakeLists.txt +++ b/DAQ/CMakeLists.txt @@ -25,7 +25,8 @@ cet_build_plugin(ArtBinaryPacketsFromDigis art::module cet_build_plugin(EventHeaderFromCFOFragment art::module REG_SOURCE src/EventHeaderFromCFOFragment_module.cc LIBRARIES REG - Offline::DAQ + Offline::DAQ + Offline::DataProducts ) @@ -81,6 +82,17 @@ cet_build_plugin(LumiStreamFilter art::module ${ARTDAQ_DAQDATA_LIB} ) +cet_build_plugin(OccupancyFilter art::module + REG_SOURCE src/OccupancyFilter_module.cc + LIBRARIES REG + artdaq-core-mu2e::Data + artdaq-core-mu2e::Overlays + fhiclcpp::types + Offline::DAQ + Offline::RecoDataProducts + TRACE::MF +) + cet_build_plugin(PrefetchDAQData art::module REG_SOURCE src/PrefetchDAQData_module.cc LIBRARIES REG From 60e3c70c4f2af9057eb874cf4346c83f679d7635 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 26 Jan 2026 12:10:59 -0800 Subject: [PATCH 071/174] Address review comments. Fix persistence. Add print --- DataProducts/inc/FilterFraction.hh | 33 ++++++--- DataProducts/src/FilterFraction.cc | 22 ++++++ DataProducts/src/classes.h | 4 +- DataProducts/src/classes_def.xml | 7 +- Filters/src/RandomPrescaleFilter_module.cc | 13 ++-- Print/fcl/printCosmicLivetime.fcl | 1 - Print/fcl/printFilterFraction.fcl | 37 ++++++++++ Print/inc/FilterFractionPrinter.hh | 37 ++++++++++ Print/src/FilterFractionPrinter.cc | 79 ++++++++++++++++++++ Print/src/PrintModule_module.cc | 5 ++ Trigger/src/PrescaleEvent_module.cc | 84 +++++++++++----------- 11 files changed, 259 insertions(+), 63 deletions(-) create mode 100644 DataProducts/src/FilterFraction.cc create mode 100644 Print/fcl/printFilterFraction.fcl create mode 100644 Print/inc/FilterFractionPrinter.hh create mode 100644 Print/src/FilterFractionPrinter.cc diff --git a/DataProducts/inc/FilterFraction.hh b/DataProducts/inc/FilterFraction.hh index 695b2c3b2e..77751a2151 100644 --- a/DataProducts/inc/FilterFraction.hh +++ b/DataProducts/inc/FilterFraction.hh @@ -1,23 +1,40 @@ // -// Run-level art product to record the selection fraction of a filter. This product could be -// part of the raw data output (trigger prescale) or simulation. +// art product to record the selection fraction of a filter. This product could be +// part of the raw data output (trigger prescale) or simulation presampling. // Original author: Dave Brown (LBNL) 2026 // #ifndef DataProducts_FilterFraction_hh #define DataProducts_FilterFraction_hh +#include namespace mu2e { class FilterFraction { public: - enum FilterType { constant=0,sculpted}; // sculpted means the selection depends on the event data content, not just purely (pseudo) random. - FilterFraction(FilterType type, double nominal, double actual) : type_(type),nominal_(nominal), actual_(actual) {} + enum FilterType { constant=0, nonominal, chained, unknown}; + // chained means multiple filtering steps have been chained together + FilterFraction(FilterType type, double nominal, uint64_t nseen, uint64_t npassed) : + type_(type),nominal_(nominal), nseen_(nseen), npassed_(npassed) {} + // use this constructor when there is no nominal selection fraction + FilterFraction(uint64_t nseen, uint64_t npassed) : + type_(nonominal),nominal_(-1.0), nseen_(nseen), npassed_(npassed) {} + // default + FilterFraction(){} // accessors FilterType type() const { return type_; } + bool hasNominalValue() const { return type() == nonominal; } double nominalFraction() const { return nominal_; } - double actualFraction() const { return actual_; } + double actualFraction() const { return nseen_ > 0 ? double(npassed_)/double(nseen_) : 0.0; } + uint64_t nSeen() const { return nseen_; } + uint64_t nPassed() const { return npassed_; } + // concatenate multiple subruns in the same path + FilterFraction& operator +=(FilterFraction const& other); + FilterFraction operator + (FilterFraction const& other) const; + // concatenate with an upstream filter. The values must match! + FilterFraction chain(FilterFraction const& upstream) const; private: - FilterType type_; // type of filtering performed - double nominal_; // nominal fraction (<1) of events expected to be kept by the filter - double actual_; // fraction (<1) of events actually kept by the filter + FilterType type_ = unknown; // type of filtering performed + double nominal_ = -1; // nominal fraction (<1) of events expected to be kept by the filter + uint64_t nseen_ = 0; // number of events processed by this filter + uint64_t npassed_ = 0; // number of events passed by this filter }; } #endif diff --git a/DataProducts/src/FilterFraction.cc b/DataProducts/src/FilterFraction.cc new file mode 100644 index 0000000000..dc5c083ee3 --- /dev/null +++ b/DataProducts/src/FilterFraction.cc @@ -0,0 +1,22 @@ +#include "Offline/DataProducts/inc/FilterFraction.hh" +#include + +namespace mu2e { + FilterFraction& FilterFraction::operator +=(FilterFraction const& other) { + if(other.type() != type() || (type()<= nonominal && other.nominalFraction() != nominalFraction())) + throw std::runtime_error("nominal filter fractions conflict"); + nseen_ += other.nSeen(); + npassed_ += other.nPassed(); + return *this; + } + FilterFraction FilterFraction::operator + (FilterFraction const& other) const { + auto retval = *this; + retval += other; + return retval; + } + // concatenate with an upstream filter. The values must match! + FilterFraction FilterFraction::chain(FilterFraction const& upstream) const { + if(upstream.nPassed() != nSeen())throw std::runtime_error("Filter counts conflict"); + return FilterFraction(chained,-1.0,upstream.nSeen(),nPassed()); + } +} diff --git a/DataProducts/src/classes.h b/DataProducts/src/classes.h index 2ef7f4a52d..8bb337728a 100644 --- a/DataProducts/src/classes.h +++ b/DataProducts/src/classes.h @@ -59,6 +59,8 @@ #include "Offline/DataProducts/inc/STMChannel.hh" #include "Offline/DataProducts/inc/STMTestBeamEventInfo.hh" +// Filter +#include "Offline/DataProducts/inc/FilterFraction.hh" + // General #include "Offline/DataProducts/inc/SurfaceId.hh" -#include "Offline/DataProducts/inc/FilterFraction.hh" diff --git a/DataProducts/src/classes_def.xml b/DataProducts/src/classes_def.xml index 61c2c9e696..8b605cad06 100644 --- a/DataProducts/src/classes_def.xml +++ b/DataProducts/src/classes_def.xml @@ -58,11 +58,14 @@ - + + + + + - diff --git a/Filters/src/RandomPrescaleFilter_module.cc b/Filters/src/RandomPrescaleFilter_module.cc index 934727f232..f4657391b7 100644 --- a/Filters/src/RandomPrescaleFilter_module.cc +++ b/Filters/src/RandomPrescaleFilter_module.cc @@ -40,7 +40,6 @@ namespace mu2e RandomPrescaleFilter & operator = (RandomPrescaleFilter &&) = delete; bool filter(art::Event & e) override; - bool endRun(art::Run& run ) override; bool endSubRun(art::SubRun& subrun ) override; private: @@ -48,7 +47,7 @@ namespace mu2e CLHEP::RandFlat randflat_; int debug_; double frac_; - unsigned nevt_, npass_; + uint64_t nevt_, npass_; }; RandomPrescaleFilter::RandomPrescaleFilter(const Parameters& conf) : @@ -71,17 +70,13 @@ namespace mu2e } bool RandomPrescaleFilter::endSubRun( art::SubRun& subrun ) { - auto ff = std::make_unique(FilterFraction::constant,frac_, double(npass_)/double(nevt_)); + auto ff = std::make_unique(FilterFraction::constant,frac_, nevt_,npass_); subrun.put(std::move(ff),"",art::fullSubRun()); - return true; - } - - - bool RandomPrescaleFilter::endRun( art::Run& run ) { if(debug_ > 0 && nevt_ > 0){ std::cout << moduleDescription().moduleLabel() << " passed " << npass_ << " events out of " << nevt_ << " for a ratio of " << float(npass_)/float(nevt_) << std::endl; - } + // reset + npass_ = 0; nevt_ = 0; return true; } diff --git a/Print/fcl/printCosmicLivetime.fcl b/Print/fcl/printCosmicLivetime.fcl index 1370cf2c31..3ea1e8d45d 100644 --- a/Print/fcl/printCosmicLivetime.fcl +++ b/Print/fcl/printCosmicLivetime.fcl @@ -1,4 +1,3 @@ - # # print products with a moderate amount of output - includes cuts on energy # diff --git a/Print/fcl/printFilterFraction.fcl b/Print/fcl/printFilterFraction.fcl new file mode 100644 index 0000000000..eb682d909f --- /dev/null +++ b/Print/fcl/printFilterFraction.fcl @@ -0,0 +1,37 @@ +# +# print products with a moderate amount of output - includes cuts on energy +# + +#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 + PrintEvent : false + verbose : 0 + PrintSubRun : true + FilterFractionPrinter : { + verbose : 1 + } + } # printModule + + + } # analyzers + + ana : [ printModule ] + end_paths : [ ana ] + +} + +services.message.destinations.log.categories.ArtSummary.limit : 0 +services.message.destinations.statistics.stats : @local::mf_null diff --git a/Print/inc/FilterFractionPrinter.hh b/Print/inc/FilterFractionPrinter.hh new file mode 100644 index 0000000000..48a1a3914e --- /dev/null +++ b/Print/inc/FilterFractionPrinter.hh @@ -0,0 +1,37 @@ +// +// Utility class to print FilterFraction +// +#ifndef Print_inc_FilterFractionPrinter_hh +#define Print_inc_FilterFractionPrinter_hh + +#include +#include + +#include "Offline/DataProducts/inc/FilterFraction.hh" +#include "Offline/Print/inc/ProductPrinter.hh" +#include "art/Framework/Principal/Handle.h" +#include "canvas/Persistency/Common/Ptr.h" + +namespace mu2e { + +class FilterFractionPrinter : public ProductPrinter { + public: + FilterFractionPrinter() {} + FilterFractionPrinter(const Config& conf) : ProductPrinter(conf) {} + + // all the ways to request a printout + void Print(art::Event const& event, std::ostream& os = std::cout) override; + void PrintSubRun(art::SubRun const& subrun, + std::ostream& os = std::cout) override; + void Print(const art::Handle& handle, + std::ostream& os = std::cout); + void Print(const art::ValidHandle& handle, + std::ostream& os = std::cout); + void Print(const mu2e::FilterFraction& obj, int ind = -1, + std::ostream& os = std::cout); + void PrintHeader(const std::string& tag, std::ostream& os = std::cout); + private: +}; + +} // namespace mu2e +#endif diff --git a/Print/src/FilterFractionPrinter.cc b/Print/src/FilterFractionPrinter.cc new file mode 100644 index 0000000000..0ceb5d420d --- /dev/null +++ b/Print/src/FilterFractionPrinter.cc @@ -0,0 +1,79 @@ +#include "Offline/Print/inc/FilterFractionPrinter.hh" +#include "art/Framework/Principal/Provenance.h" +#include "canvas/Persistency/Common/Sampled.h" +#include "canvas/Persistency/Provenance/SampledInfo.h" +#include +#include + +void mu2e::FilterFractionPrinter::Print(art::Event const& event, std::ostream& os) {} + +void mu2e::FilterFractionPrinter::PrintSubRun(art::SubRun const& subrun, std::ostream& os) { + if (verbose() < 1) return; + if (tags().empty()) { + // if a list of instances not specified, print all instances + std::vector > ffl = + subrun.getMany(); + for (auto const& cl : ffl) Print(cl); + // also look for sampled instances + auto ffs = subrun.getMany>(); + if(ffs.size() > 0){ + for (auto const& ff : ffs){ + std::cout << "SampledFilterFraction with tag " << ff->originalInputTag() << std::endl; + auto sinfomh = subrun.getHandle("SamplingInput"); + if(sinfomh.isValid()){ + auto const& sinfom = *sinfomh; + for(auto sinfoit = sinfom.begin(); sinfoit != sinfom.end(); ++sinfoit) { + if(sinfoit->first.find("Cosmic") != std::string::npos){ + std::cout << "With SampledSubRunInfo entry for dataset " << sinfoit->first << " Has the following FilterFractions: " << std::endl; + for(auto const& sr : sinfoit->second.ids){ + std::cout << sr << " : "; + auto ffp = ff->get(sinfoit->first,sr); + if(!ffp.empty()) Print(*ffp); + } + } + } + } + } + } + + } else { + // print requested instances + for (const auto& tag : tags()) { + auto ff = subrun.getValidHandle(tag); + Print(ff); + } + } +} + +void mu2e::FilterFractionPrinter::Print( + const art::Handle& handle, std::ostream& os) { + if (verbose() < 1) return; + // the product tags with all four fields, with underscores + std::string tag = handle.provenance()->productDescription().branchName(); + tag.pop_back(); // remove trailing dot + PrintHeader(tag, os); + Print(*handle); +} + +void mu2e::FilterFractionPrinter::Print( + const art::ValidHandle& handle, std::ostream& os) { + if (verbose() < 1) return; + // the product tags with all four fields, with underscores + std::string tag = handle.provenance()->productDescription().branchName(); + tag.pop_back(); // remove trailing dot + PrintHeader(tag, os); + Print(*handle); +} + +void mu2e::FilterFractionPrinter::Print(const mu2e::FilterFraction& obj, + int ind, std::ostream& os) { + os << std::setiosflags(std::ios::fixed | std::ios::right); + + os << " Type" << obj.type() << " Nominal fraction " << obj.nominalFraction() << " Actual Fraction " << obj.actualFraction() << " N Seen " << obj.nSeen() << std::endl; +} + +void mu2e::FilterFractionPrinter::PrintHeader(const std::string& tag, + std::ostream& os) { + if (verbose() < 1) return; + os << "\nProductPrint " << tag << "\n"; +} diff --git a/Print/src/PrintModule_module.cc b/Print/src/PrintModule_module.cc index 01fee939b6..fd116847ae 100644 --- a/Print/src/PrintModule_module.cc +++ b/Print/src/PrintModule_module.cc @@ -18,6 +18,7 @@ #include "Offline/Print/inc/CaloShowerStepPrinter.hh" #include "Offline/Print/inc/ComboHitPrinter.hh" #include "Offline/Print/inc/CosmicLivetimePrinter.hh" +#include "Offline/Print/inc/FilterFractionPrinter.hh" #include "Offline/Print/inc/CrvCoincidenceClusterPrinter.hh" #include "Offline/Print/inc/CrvDigiMCPrinter.hh" #include "Offline/Print/inc/CrvDigiPrinter.hh" @@ -77,6 +78,8 @@ class PrintModule : public art::EDAnalyzer { fhicl::Name("ProtonBunchIntensityPrinter")}; fhicl::Table CosmicLivetimePrinter{ fhicl::Name("CosmicLivetimePrinter")}; + fhicl::Table FilterFractionPrinter{ + fhicl::Name("FilterFractionPrinter")}; fhicl::Table EventWindowMarkerPrinter{ fhicl::Name("EventWindowMarkerPrinter")}; fhicl::Table genParticlePrinter{ @@ -190,6 +193,8 @@ mu2e::PrintModule::PrintModule(const Parameters& conf) : art::EDAnalyzer(conf), conf().ProtonBunchIntensityPrinter())); _printers.push_back( make_unique(conf().CosmicLivetimePrinter())); + _printers.push_back( + make_unique(conf().FilterFractionPrinter())); _printers.push_back( make_unique(conf().EventWindowMarkerPrinter())); _printers.push_back( diff --git a/Trigger/src/PrescaleEvent_module.cc b/Trigger/src/PrescaleEvent_module.cc index a008d40733..11d0f07252 100644 --- a/Trigger/src/PrescaleEvent_module.cc +++ b/Trigger/src/PrescaleEvent_module.cc @@ -17,12 +17,13 @@ #include "fhiclcpp/types/Table.h" #include "canvas/Utilities/InputTag.h" #include "messagefacility/MessageLogger/MessageLogger.h" -// #include "RecoDataProducts/inc/TriggerInfo.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" +#include "Offline/DataProducts/inc/FilterFraction.hh" #include "artdaq-core-mu2e/Data/EventHeader.hh" #include #include +#include namespace mu2e { @@ -40,9 +41,10 @@ namespace mu2e }; struct EventMode { - EventWindowMarker::SpillType _type; - int _prescale; - EventMode(EventWindowMarker::SpillType type, int prescale) : _type(type), _prescale(prescale) {} + EventWindowMarker::SpillType type_; + int prescale_; + std::string name_; + EventMode(EventWindowMarker::SpillType type, int prescale, std::string const& name ) : type_(type), prescale_(prescale), name_(name) {} }; struct Config { @@ -63,68 +65,66 @@ namespace mu2e PrescaleEvent & operator = (PrescaleEvent &&) = delete; bool filter(art::Event & e) override; - virtual bool endRun(art::Run& run ) override; + bool endSubRun(art::SubRun& subrun ) override; private: - art::ProductToken const _ewmtoken; - std::vector _eventMode; - int _debug; - unsigned _nevt, _npass; - + art::ProductToken const ewmtoken_; + std::vector eventMode_; + std::vector nevt_, npass_; + int debug_; }; PrescaleEvent::PrescaleEvent(Parameters const & config) : art::EDFilter{config}, - _ewmtoken{consumes(config().EWM())}, - _debug (config().debug()), - _nevt(0), _npass(0){ + ewmtoken_{consumes(config().EWM())}, + nevt_(config().eventMode().size(),0), + npass_(config().eventMode().size(),0), + debug_ (config().debug()) { for(const auto& mode : config().eventMode()) { - if(mode.eventMode() == "OffSpill") _eventMode.push_back(EventMode(EventWindowMarker::offspill, mode.prescale())); - else if(mode.eventMode() == "OnSpill") _eventMode.push_back(EventMode(EventWindowMarker::onspill, mode.prescale())); + if(mode.eventMode() == "OffSpill") eventMode_.push_back(EventMode(EventWindowMarker::offspill, mode.prescale(),mode.eventMode())); + else if(mode.eventMode() == "OnSpill") eventMode_.push_back(EventMode(EventWindowMarker::onspill, mode.prescale(),mode.eventMode())); else throw cet::exception("TRIGGER") << "Unknown prescale mode " << mode.eventMode(); + produces(mode.eventMode()); } } inline bool PrescaleEvent::filter(art::Event & e) { - ++_nevt; - // Check for the prescale corresponding to the current event mode - auto ewmH = e.getValidHandle(_ewmtoken); + auto ewmH = e.getValidHandle(ewmtoken_); const EventWindowMarker& ewm(*ewmH); - int ps(0); // default to filtering all events - for (const auto& mode : _eventMode) { - uint8_t spillType = mode._type; + for (size_t imode = 0; imode < eventMode_.size(); imode++){ + auto const& mode = eventMode_[imode]; + uint8_t spillType = mode.type_; if (spillType == ewm.spillType()){ - ps = mode._prescale; - break; - } - } - - // Default to false - bool retval(false); - - // Apply the prescale, if requested for this event type - if(ps > 0) { - retval = e.event() % ps == 0; - if (retval){ - ++_npass; + ++nevt_[imode]; + // Apply the prescale + bool retval = e.event() % mode.prescale_ == 0; + if (retval) ++npass_[imode]; + return retval; } } - - // Return the result - return retval; + // If no matching event type is found, return false + return false; } - bool PrescaleEvent::endRun( art::Run& run ) { - if(_debug > 0){ - std::cout << moduleDescription().moduleLabel() << " passed " << _npass << " events out of " << _nevt - << " for a ratio of " << ((_nevt > 0) ? float(_npass)/float(_nevt) : 0.f) << std::endl; + bool PrescaleEvent::endSubRun( art::SubRun& subrun ) { + for (size_t imode = 0; imode < eventMode_.size(); imode++){ + auto const& mode = eventMode_[imode]; + double frac = 1.0/double(mode.prescale_); + auto ff = std::make_unique(FilterFraction::constant, frac, nevt_[imode],npass_[imode]); + subrun.put(std::move(ff),mode.name_,art::fullSubRun()); + if(debug_ > 0){ + std::cout << moduleDescription().moduleLabel() << " mode " << mode.name_ << " passed " << npass_[imode] << " events out of " << nevt_[imode] + << " for a ratio of " << ((nevt_[imode] > 0) ? double(npass_[imode])/double(nevt_[imode]) : 0.f) << std::endl; + } + // reset + npass_[imode] = 0; nevt_[imode] = 0; } return true; } - } + using mu2e::PrescaleEvent; DEFINE_ART_MODULE(PrescaleEvent) From d117dedfcd5ce345ee22ac60d12f6d2d641a3a1f Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 26 Jan 2026 12:28:09 -0800 Subject: [PATCH 072/174] Fix layout --- Print/src/FilterFractionPrinter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Print/src/FilterFractionPrinter.cc b/Print/src/FilterFractionPrinter.cc index 0ceb5d420d..30ea553298 100644 --- a/Print/src/FilterFractionPrinter.cc +++ b/Print/src/FilterFractionPrinter.cc @@ -69,7 +69,7 @@ void mu2e::FilterFractionPrinter::Print(const mu2e::FilterFraction& obj, int ind, std::ostream& os) { os << std::setiosflags(std::ios::fixed | std::ios::right); - os << " Type" << obj.type() << " Nominal fraction " << obj.nominalFraction() << " Actual Fraction " << obj.actualFraction() << " N Seen " << obj.nSeen() << std::endl; + os << " Type " << obj.type() << " Nominal fraction " << obj.nominalFraction() << " Actual Fraction " << obj.actualFraction() << " N Seen " << obj.nSeen() << std::endl; } void mu2e::FilterFractionPrinter::PrintHeader(const std::string& tag, From 109145d9b5ef44803aa5b0a50d4466dae3e4b7b6 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Tue, 27 Jan 2026 07:22:20 -0600 Subject: [PATCH 073/174] tweak --- CaloConditions/src/CaloDAQMapMaker.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CaloConditions/src/CaloDAQMapMaker.cc b/CaloConditions/src/CaloDAQMapMaker.cc index f65d12a74e..c4d9f357d8 100644 --- a/CaloConditions/src/CaloDAQMapMaker.cc +++ b/CaloConditions/src/CaloDAQMapMaker.cc @@ -34,8 +34,9 @@ namespace mu2e { CaloDAQMap::OfflineArray offline2Raw; uint16_t oid,rid,nRead(0); - ordFile >> rid >> oid; - while (!ordFile.eof()) { + while (!ordFile.eof()){ + ordFile >> rid >> oid; + if (ordFile.eof()) break; if(rid >= CaloConst::_nRawChannel) { throw cet::exception("CALODAQMAPMAKER_RANGE") << "CaloDAQMapMaker read invalid rawId" << rid << endl; @@ -52,8 +53,6 @@ namespace mu2e { offline2Raw[oid] = CaloRawSiPMId(rid); } - ordFile >> rid >> oid; - } if(nRead != CaloConst::_nRawChannel) { From 7a19cae15e9218c013d5e4f932619aa8f7cd8a28 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Wed, 28 Jan 2026 08:30:39 -0600 Subject: [PATCH 074/174] file changed name --- CaloConditions/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaloConditions/CMakeLists.txt b/CaloConditions/CMakeLists.txt index e496ea9e1d..f3fc4c6ae2 100644 --- a/CaloConditions/CMakeLists.txt +++ b/CaloConditions/CMakeLists.txt @@ -17,7 +17,7 @@ cet_make_library( ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/nominal.txt ${CURRENT_BINARY_DIR} data/nominal.txt) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/caloDMAP_20250827.dat ${CURRENT_BINARY_DIR} data/caloDMAP_20250827.dat) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/caloDMAP_nominal.dat ${CURRENT_BINARY_DIR} data/caloDMAP_nominal.dat) install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Offline/CaloConditions) From c5927b053fd7d362f7b28ec80f956a31e20faebf Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Thu, 29 Jan 2026 08:49:17 -0600 Subject: [PATCH 075/174] move lone dict to DataProducts --- CRVReco/src/SConscript | 8 -------- CRVReco/src/classes.h | 6 ------ CRVReco/src/classes_def.xml | 6 ------ DataProducts/src/classes.h | 2 ++ DataProducts/src/classes_def.xml | 1 + 5 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 CRVReco/src/classes.h delete mode 100644 CRVReco/src/classes_def.xml diff --git a/CRVReco/src/SConscript b/CRVReco/src/SConscript index 6a68a1ef96..447bbd87ee 100644 --- a/CRVReco/src/SConscript +++ b/CRVReco/src/SConscript @@ -28,14 +28,6 @@ mainlib = helper.make_mainlib ( [ 'CLHEP', rootlibs] ) -helper.make_dict_and_map( [ mainlib, - 'art_root_io_tfile_support', - 'art_root_io_TFileService', - 'canvas', - 'libSpectrum', - rootlibs, - ] ) - helper.make_plugins( [ mainlib, 'mu2e_SeedService', 'mu2e_Mu2eUtilities', diff --git a/CRVReco/src/classes.h b/CRVReco/src/classes.h deleted file mode 100644 index 1672b50942..0000000000 --- a/CRVReco/src/classes.h +++ /dev/null @@ -1,6 +0,0 @@ -#define ENABLE_MU2E_GENREFLEX_HACKS - -#include -#include - -#undef ENABLE_MU2E_GENREFLEX_HACKS diff --git a/CRVReco/src/classes_def.xml b/CRVReco/src/classes_def.xml deleted file mode 100644 index 7e09c6c30d..0000000000 --- a/CRVReco/src/classes_def.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/DataProducts/src/classes.h b/DataProducts/src/classes.h index 3d600aa584..af57df9e91 100644 --- a/DataProducts/src/classes.h +++ b/DataProducts/src/classes.h @@ -7,6 +7,8 @@ #include "cetlib/map_vector.h" #include "boost/array.hpp" #include +#include +#include // PDG #include "Offline/DataProducts/inc/PDGCode.hh" diff --git a/DataProducts/src/classes_def.xml b/DataProducts/src/classes_def.xml index b8a8d73418..73eaadb943 100644 --- a/DataProducts/src/classes_def.xml +++ b/DataProducts/src/classes_def.xml @@ -8,6 +8,7 @@ + From fd9c61596fdb7365a152bcc67a5b394342e85260 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Thu, 29 Jan 2026 09:23:26 -0600 Subject: [PATCH 076/174] remove obsolete prints --- CalPatRec/src/DeltaFinderAlg.cc | 1 - GeometryService/src/GeometryService.cc | 3 --- 2 files changed, 4 deletions(-) diff --git a/CalPatRec/src/DeltaFinderAlg.cc b/CalPatRec/src/DeltaFinderAlg.cc index 62a8a825e9..46c36ee375 100644 --- a/CalPatRec/src/DeltaFinderAlg.cc +++ b/CalPatRec/src/DeltaFinderAlg.cc @@ -51,7 +51,6 @@ namespace mu2e { _doTiming = _data->doTiming; _watch = _data->watch; - printf("DeltaFinderAlg created\n"); } //----------------------------------------------------------------------------- // make sure the two hits used to make a new seed are not a part of an already found seed diff --git a/GeometryService/src/GeometryService.cc b/GeometryService/src/GeometryService.cc index ca03085b6c..5edbe1145a 100644 --- a/GeometryService/src/GeometryService.cc +++ b/GeometryService/src/GeometryService.cc @@ -148,9 +148,6 @@ namespace mu2e { GeometryService::preBeginRun(art::Run const &) { if(++_run_count > 1) { - if( _run_count == 2 ){ - mf::LogWarning("GEOM") << "This test version does not change geometry on run boundaries."; - } return; } From c75ef9d96f0ed679ddc93337af262c9c2f127c50 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Thu, 29 Jan 2026 10:09:35 -0600 Subject: [PATCH 077/174] Adding NDF column to CalCosmicEnergyCalib --- DbTables/inc/CalCosmicEnergyCalib.hh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/DbTables/inc/CalCosmicEnergyCalib.hh b/DbTables/inc/CalCosmicEnergyCalib.hh index 94da223a6c..768e49d4b1 100644 --- a/DbTables/inc/CalCosmicEnergyCalib.hh +++ b/DbTables/inc/CalCosmicEnergyCalib.hh @@ -17,7 +17,7 @@ namespace mu2e { class Row { public: - Row(CaloSiPMId roid, float Peak, float ErrPeak, float Width, float ErrWidth, float Sigma, float ErrSigma, float chisq, int Nhits): + Row(CaloSiPMId roid, float Peak, float ErrPeak, float Width, float ErrWidth, float Sigma, float ErrSigma, float chisq, int ndf, int Nhits): _roid(roid), _Peak(Peak), _ErrPeak(ErrPeak), @@ -26,6 +26,7 @@ namespace mu2e { _Sigma(Sigma), _ErrSigma(ErrSigma), _chisq(chisq), + _ndf(ndf), _Nhits(Nhits){} CaloSiPMId roid() const { return _roid;} float Peak() const { return _Peak; } @@ -35,6 +36,7 @@ namespace mu2e { float Sigma() const { return _Sigma; } float ErrSigma() const { return _ErrSigma; } float chisq() const { return _chisq; } + int ndf() const { return _ndf; } int Nhits() const { return _Nhits; } private: @@ -46,12 +48,13 @@ namespace mu2e { float _Sigma; float _ErrSigma; float _chisq; + int _ndf; int _Nhits; }; constexpr static const char* cxname = "CalCosmicEnergyCalib"; - CalCosmicEnergyCalib():DbTable(cxname,"cal.cosmicenergycalib","roid,peak,errpeak,width,errwidth,sigma,errsigma,chisq,nhits"){} + CalCosmicEnergyCalib():DbTable(cxname,"cal.cosmicenergycalib","roid,peak,errpeak,width,errwidth,sigma,errsigma,chisq,ndf,nhits"){} const Row& row(CaloSiPMId roid) const { return _rows.at(roid.id()); } @@ -77,7 +80,8 @@ namespace mu2e { std::stof(columns[5]), std::stof(columns[6]), std::stof(columns[7]), - std::stoi(columns[8])); + std::stoi(columns[8]), + std::stoi(columns[9])); } @@ -92,6 +96,7 @@ namespace mu2e { sstream << r.Sigma()<<","; sstream << r.ErrSigma()<<","; sstream << r.chisq()<<","; + sstream << r.ndf()<<","; sstream << r.Nhits(); } From 983fb4459a870979216add6519d2fc2f0de6a489 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Thu, 29 Jan 2026 15:33:02 -0800 Subject: [PATCH 078/174] Turn off diagnostic printout --- Mu2eKinKal/fcl/prolog.fcl | 38 ++++++++++++++++++++----------------- Mu2eKinKal/src/BkgANNSHU.cc | 2 -- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Mu2eKinKal/fcl/prolog.fcl b/Mu2eKinKal/fcl/prolog.fcl index ec8343d1fa..4c9bcb53fd 100644 --- a/Mu2eKinKal/fcl/prolog.fcl +++ b/Mu2eKinKal/fcl/prolog.fcl @@ -123,7 +123,8 @@ Mu2eKinKal : { [2.5, 100.0, true, 0 ] ] BkgANNSHUSettings : [ - [ "Offline/Mu2eKinKal/data/TrainBkgSeed.dat",0.2,"Inactive", 1] + # weight file, threshold, freeze, diag + [ "Offline/Mu2eKinKal/data/TrainBkgSeed.dat",0.2,"Inactive", 0 ] ] } @@ -153,29 +154,30 @@ Mu2eKinKal : { ] CADSHUSettings : [ # maxdoca, maxderr, minrdrift, maxrdrift, flag, allow, freeze, diag - [ 10.0, 20.0, 5.0, 5.0, "TOT:LongVal", "Null:Inactive", "", 1 ], - [ 10.0, 20.0, 5.0, 4.0, "TOT:LongVal", "Null:Inactive", "", 1 ], - [ 8.0, 16.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ], - [ 8.0, 16.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ], - [ 6.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ], - [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ], - [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ], - [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ], - [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 1 ] + [ 10.0, 20.0, 5.0, 5.0, "TOT:LongVal", "Null:Inactive", "", 0 ], + [ 10.0, 20.0, 5.0, 4.0, "TOT:LongVal", "Null:Inactive", "", 0 ], + [ 8.0, 16.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ], + [ 8.0, 16.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ], + [ 6.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ], + [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ], + [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ], + [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ], + [ 5.0, 10.0, 5.0, 3.0, "TOT:NullDriftVar:LongVal", "Null:Inactive", "", 0 ] ] BkgANNSHUSettings : [ - [ "Offline/Mu2eKinKal/data/TrainBkgSeed.dat",0.2,"Inactive", 1], - [ "Offline/Mu2eKinKal/data/TrainBkgFinal.dat",0.2,"Inactive", 1] + # weight file, threshold, freeze, diag + [ "Offline/Mu2eKinKal/data/TrainBkgSeed.dat",0.2,"Inactive", 0 ], + [ "Offline/Mu2eKinKal/data/TrainBkgFinal.dat",0.2,"Inactive", 0 ] ] DriftANNSHUSettings : [ # sign ANN weights, cut, cluster ANN weights, cut, dt cut, freeze, flag, diag - [ "Offline/Mu2eKinKal/data/TrainSign_Stage0.dat",0.5, "Offline/Mu2eKinKal/data/TrainCluster_Stage0.dat",0.5, 1.1, "", "TOT:NullDriftVar:LongVal", 1], - [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.4, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.4, 1.1, "", "TOT:NullDriftVar:LongVal", 1], - [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.3, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.3, 1.1, "", "TOT:NullDriftVar:LongVal", 1], - [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.2, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.2, 1.1, "", "TOT:NullDriftVar:LongVal", 1], - [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.1, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.1, 1.1, "", "TOT:NullDriftVar:LongVal", 1] + [ "Offline/Mu2eKinKal/data/TrainSign_Stage0.dat",0.5, "Offline/Mu2eKinKal/data/TrainCluster_Stage0.dat",0.5, 1.1, "", "TOT:NullDriftVar:LongVal", 0], + [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.4, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.4, 1.1, "", "TOT:NullDriftVar:LongVal", 0], + [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.3, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.3, 1.1, "", "TOT:NullDriftVar:LongVal", 0], + [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.2, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.2, 1.1, "", "TOT:NullDriftVar:LongVal", 0], + [ "Offline/Mu2eKinKal/data/TrainSign_Stage1.dat",0.1, "Offline/Mu2eKinKal/data/TrainCluster_Stage1.dat",0.1, 1.1, "", "TOT:NullDriftVar:LongVal", 0] ] Chi2SHUSettings : [ ] @@ -276,6 +278,7 @@ Mu2eKinKal : { [2.5, 1.0, true, 0 ] ] BkgANNSHUSettings : [ + # weight file, threshold, freeze, diag [ "Offline/Mu2eKinKal/data/TrainBkgSeed.dat",0.2,"Inactive", 1] ] } @@ -319,6 +322,7 @@ Mu2eKinKal : { ] BkgANNSHUSettings : [ + # weight file, threshold, freeze, diag [ "Offline/Mu2eKinKal/data/TrainBkgSeed.dat",0.2,"Inactive", 0 ], [ "Offline/Mu2eKinKal/data/TrainBkgFinal.dat",0.2,"Inactive", 0 ] ] diff --git a/Mu2eKinKal/src/BkgANNSHU.cc b/Mu2eKinKal/src/BkgANNSHU.cc index 6bdf1d68c7..356bd3e420 100644 --- a/Mu2eKinKal/src/BkgANNSHU.cc +++ b/Mu2eKinKal/src/BkgANNSHU.cc @@ -1,5 +1,3 @@ -#include "Offline/Mu2eKinKal/inc/BkgANNSHU.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/Mu2eKinKal/inc/StrawHitUpdaters.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "Offline/Mu2eKinKal/inc/TrainBkg.hxx" From c504b1508e15fdd33864d1fd5b2f285fc12a7071 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Thu, 29 Jan 2026 15:39:50 -0800 Subject: [PATCH 079/174] Revert include change --- Mu2eKinKal/src/BkgANNSHU.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mu2eKinKal/src/BkgANNSHU.cc b/Mu2eKinKal/src/BkgANNSHU.cc index 356bd3e420..6bdf1d68c7 100644 --- a/Mu2eKinKal/src/BkgANNSHU.cc +++ b/Mu2eKinKal/src/BkgANNSHU.cc @@ -1,3 +1,5 @@ +#include "Offline/Mu2eKinKal/inc/BkgANNSHU.hh" +#include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/Mu2eKinKal/inc/StrawHitUpdaters.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "Offline/Mu2eKinKal/inc/TrainBkg.hxx" From 5473c515fdc0cfdedfd186aa0f79a77cccc464e2 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Thu, 29 Jan 2026 18:44:20 -0600 Subject: [PATCH 080/174] remove some obsolete references to ConditionsService --- Analyses/src/CaloCalibAna_module.cc | 1 - Analyses/src/CaloDigiAna_module.cc | 1 - Analyses/src/Mu2eG4StudyCalo01ReadBack_module.cc | 1 - Analyses/src/Mu2eG4StudyReadBack_module.cc | 1 - Analyses/src/ReadAntiProtonSteps_module.cc | 1 - Analyses/src/ReadPSVacuum_module.cc | 1 - Analyses/src/ReadPTM_module.cc | 1 - Analyses/src/ReadTrackCaloMatching_module.cc | 1 - Analyses/src/ReadTrackerSteps_module.cc | 1 - Analyses/src/ReadTrkExtrapolMVA_module.cc | 1 - Analyses/src/ReadTrkExtrapol_module.cc | 1 - Analyses/src/ReadVirtualDetector_module.cc | 1 - BTrkData/src/SConscript | 1 - CRVConditions/src/SConscript | 1 - CRVReco/src/SConscript | 1 - CRVResponse/src/CrvSiPMChargeGenerator_module.cc | 1 - CalPatRec/src/CalHelixFinderAlg.cc | 1 - CalPatRec/src/ComboHitFilter_module.cc | 1 - CalPatRec/src/DeltaFinderAna_module.cc | 1 - CalPatRec/src/DeltaFinder_module.cc | 3 --- CalPatRec/src/PrefetchData_module.cc | 1 - CaloConditions/src/SConscript | 1 - CaloDiag/src/CaloExample_module.cc | 2 -- CaloReco/src/CaloTemplateWFProcessor.cc | 2 +- CosmicReco/src/SConscript | 2 -- DAQ/src/SConscript | 4 +--- DAQConditions/src/SConscript | 1 - EventDisplay/src/SConscript | 1 - EventGenerator/src/CosmicFromTH2.cc | 1 - Lumi/src/SConscript | 1 - Mu2eKinKal/src/SConscript | 2 -- Mu2eUtilities/src/ProtonPulseRandPDF.cc | 1 - ParticleID/src/ParticleID_module.cc | 1 - Print/src/SConscript | 2 -- STMConditions/src/SConscript | 1 - STMMC/src/SConscript | 1 - SimulationConditions/src/SConscript | 1 - Sources/src/SConscript | 1 - TEveEventDisplay/src/SConscript | 1 - TrackCaloMatching/src/TrackCaloMatching_module.cc | 1 - TrackCaloMatching/src/TrkExtrapol_module.cc | 1 - TrackerMC/inc/StrawWaveform.hh | 1 - TrackerMC/src/MakeMCKalSeed_module.cc | 1 - TrkDiag/src/StrawHitDiag_module.cc | 1 - TrkHitReco/src/FlagBkgHits_module.cc | 1 - TrkPatRec/src/KalSeedFit_module.cc | 1 - TrkReco/src/KalFit.cc | 1 - Validation/src/SConscript | 2 -- 48 files changed, 2 insertions(+), 57 deletions(-) diff --git a/Analyses/src/CaloCalibAna_module.cc b/Analyses/src/CaloCalibAna_module.cc index dd46b053be..85f6f86edd 100644 --- a/Analyses/src/CaloCalibAna_module.cc +++ b/Analyses/src/CaloCalibAna_module.cc @@ -15,7 +15,6 @@ #include "canvas/Utilities/InputTag.h" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" diff --git a/Analyses/src/CaloDigiAna_module.cc b/Analyses/src/CaloDigiAna_module.cc index c1067d8fab..aa85e72023 100644 --- a/Analyses/src/CaloDigiAna_module.cc +++ b/Analyses/src/CaloDigiAna_module.cc @@ -25,7 +25,6 @@ // Mu2e includes. #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/DataProducts/inc/CaloSiPMId.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GeometryService/inc/GeometryService.hh" diff --git a/Analyses/src/Mu2eG4StudyCalo01ReadBack_module.cc b/Analyses/src/Mu2eG4StudyCalo01ReadBack_module.cc index bf3e1ef6c5..b60bd582ea 100644 --- a/Analyses/src/Mu2eG4StudyCalo01ReadBack_module.cc +++ b/Analyses/src/Mu2eG4StudyCalo01ReadBack_module.cc @@ -6,7 +6,6 @@ // #include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" diff --git a/Analyses/src/Mu2eG4StudyReadBack_module.cc b/Analyses/src/Mu2eG4StudyReadBack_module.cc index d1f7057fec..cb8da1422b 100644 --- a/Analyses/src/Mu2eG4StudyReadBack_module.cc +++ b/Analyses/src/Mu2eG4StudyReadBack_module.cc @@ -6,7 +6,6 @@ // #include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" diff --git a/Analyses/src/ReadAntiProtonSteps_module.cc b/Analyses/src/ReadAntiProtonSteps_module.cc index e4838675fd..e6de4f0f20 100644 --- a/Analyses/src/ReadAntiProtonSteps_module.cc +++ b/Analyses/src/ReadAntiProtonSteps_module.cc @@ -6,7 +6,6 @@ // #include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/MCDataProducts/inc/GenParticle.hh" #include "Offline/MCDataProducts/inc/SimParticle.hh" diff --git a/Analyses/src/ReadPSVacuum_module.cc b/Analyses/src/ReadPSVacuum_module.cc index 1b62c6b34d..c2968d18e1 100644 --- a/Analyses/src/ReadPSVacuum_module.cc +++ b/Analyses/src/ReadPSVacuum_module.cc @@ -6,7 +6,6 @@ // #include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/MCDataProducts/inc/GenParticle.hh" #include "Offline/MCDataProducts/inc/SimParticle.hh" diff --git a/Analyses/src/ReadPTM_module.cc b/Analyses/src/ReadPTM_module.cc index 6f45cc47da..b6bd93c002 100644 --- a/Analyses/src/ReadPTM_module.cc +++ b/Analyses/src/ReadPTM_module.cc @@ -3,7 +3,6 @@ // #include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/MCDataProducts/inc/GenParticle.hh" #include "Offline/MCDataProducts/inc/SimParticle.hh" diff --git a/Analyses/src/ReadTrackCaloMatching_module.cc b/Analyses/src/ReadTrackCaloMatching_module.cc index 3954caeb5c..d53bebfe27 100644 --- a/Analyses/src/ReadTrackCaloMatching_module.cc +++ b/Analyses/src/ReadTrackCaloMatching_module.cc @@ -37,7 +37,6 @@ #include "BTrk/TrkBase/HelixTraj.hh" #include "BTrk/KalmanTrack/KalRep.hh" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" // data #include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" diff --git a/Analyses/src/ReadTrackerSteps_module.cc b/Analyses/src/ReadTrackerSteps_module.cc index 28bf83d228..b7d37ec1b1 100644 --- a/Analyses/src/ReadTrackerSteps_module.cc +++ b/Analyses/src/ReadTrackerSteps_module.cc @@ -15,7 +15,6 @@ #include "CLHEP/Units/SystemOfUnits.h" // Mu2e includes -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/MCDataProducts/inc/GenParticle.hh" diff --git a/Analyses/src/ReadTrkExtrapolMVA_module.cc b/Analyses/src/ReadTrkExtrapolMVA_module.cc index f124ff298a..8ad643e2df 100644 --- a/Analyses/src/ReadTrkExtrapolMVA_module.cc +++ b/Analyses/src/ReadTrkExtrapolMVA_module.cc @@ -35,7 +35,6 @@ #include "BTrk/TrkBase/HelixTraj.hh" #include "BTrk/KalmanTrack/KalRep.hh" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" // data #include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" diff --git a/Analyses/src/ReadTrkExtrapol_module.cc b/Analyses/src/ReadTrkExtrapol_module.cc index 3dd44b0273..2cf4c2fa9c 100644 --- a/Analyses/src/ReadTrkExtrapol_module.cc +++ b/Analyses/src/ReadTrkExtrapol_module.cc @@ -34,7 +34,6 @@ #include "BTrk/TrkBase/HelixTraj.hh" #include "BTrk/KalmanTrack/KalRep.hh" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" // data #include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" diff --git a/Analyses/src/ReadVirtualDetector_module.cc b/Analyses/src/ReadVirtualDetector_module.cc index 2d317e5900..c50240c9cb 100644 --- a/Analyses/src/ReadVirtualDetector_module.cc +++ b/Analyses/src/ReadVirtualDetector_module.cc @@ -6,7 +6,6 @@ // #include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" diff --git a/BTrkData/src/SConscript b/BTrkData/src/SConscript index 5a410745b1..2aaf9d26e0 100644 --- a/BTrkData/src/SConscript +++ b/BTrkData/src/SConscript @@ -13,7 +13,6 @@ helper=mu2e_helper(env) babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_RecoDataProducts', babarlibs, diff --git a/CRVConditions/src/SConscript b/CRVConditions/src/SConscript index 7361de153d..58322ee2ba 100644 --- a/CRVConditions/src/SConscript +++ b/CRVConditions/src/SConscript @@ -9,7 +9,6 @@ Import('mu2e_helper') helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_DataProducts', 'art_Framework_Services_Registry', diff --git a/CRVReco/src/SConscript b/CRVReco/src/SConscript index 6a68a1ef96..561c631160 100644 --- a/CRVReco/src/SConscript +++ b/CRVReco/src/SConscript @@ -40,7 +40,6 @@ helper.make_plugins( [ mainlib, 'mu2e_SeedService', 'mu2e_Mu2eUtilities', 'mu2e_GeometryService', - 'mu2e_ConditionsService', 'mu2e_DAQConditions', 'mu2e_GlobalConstantsService', 'mu2e_RecoDataProducts', diff --git a/CRVResponse/src/CrvSiPMChargeGenerator_module.cc b/CRVResponse/src/CrvSiPMChargeGenerator_module.cc index 39265bec1c..1aeaf21be2 100644 --- a/CRVResponse/src/CrvSiPMChargeGenerator_module.cc +++ b/CRVResponse/src/CrvSiPMChargeGenerator_module.cc @@ -11,7 +11,6 @@ #include "Offline/DAQConditions/inc/EventTiming.hh" #include "Offline/DataProducts/inc/CRSScintillatorBarIndex.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 5caac2537b..1e9326fefc 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -12,7 +12,6 @@ #include "BTrk/BaBar/BaBar.hh" #include "BTrk/TrkBase/HelixTraj.hh" #include "Offline/CalPatRec/inc/CalHelixFinderAlg.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/RecoDataProducts/inc/StrawHit.hh" diff --git a/CalPatRec/src/ComboHitFilter_module.cc b/CalPatRec/src/ComboHitFilter_module.cc index b640ab2abc..8aab9fdc42 100644 --- a/CalPatRec/src/ComboHitFilter_module.cc +++ b/CalPatRec/src/ComboHitFilter_module.cc @@ -16,7 +16,6 @@ #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GeometryService/inc/DetectorSystem.hh" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" // data diff --git a/CalPatRec/src/DeltaFinderAna_module.cc b/CalPatRec/src/DeltaFinderAna_module.cc index 1784471d5b..f80e23830f 100644 --- a/CalPatRec/src/DeltaFinderAna_module.cc +++ b/CalPatRec/src/DeltaFinderAna_module.cc @@ -20,7 +20,6 @@ #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "art_root_io/TFileService.h" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" // root #include "TMath.h" diff --git a/CalPatRec/src/DeltaFinder_module.cc b/CalPatRec/src/DeltaFinder_module.cc index 2a528b3513..b2371914bc 100644 --- a/CalPatRec/src/DeltaFinder_module.cc +++ b/CalPatRec/src/DeltaFinder_module.cc @@ -30,9 +30,6 @@ #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" -// conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" - // data #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/StrawHit.hh" diff --git a/CalPatRec/src/PrefetchData_module.cc b/CalPatRec/src/PrefetchData_module.cc index e11870e8ae..4650fab667 100644 --- a/CalPatRec/src/PrefetchData_module.cc +++ b/CalPatRec/src/PrefetchData_module.cc @@ -7,7 +7,6 @@ #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "art_root_io/TFileService.h" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" // root #include "TMath.h" diff --git a/CaloConditions/src/SConscript b/CaloConditions/src/SConscript index 05a63a6c42..146c72689c 100644 --- a/CaloConditions/src/SConscript +++ b/CaloConditions/src/SConscript @@ -13,7 +13,6 @@ rootlibs = env['ROOTLIBS'] #jb helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_GeometryService', #'mu2e_BFieldGeom', # 'mu2e_Mu2eBTrk', diff --git a/CaloDiag/src/CaloExample_module.cc b/CaloDiag/src/CaloExample_module.cc index 75afaf3e4c..9e38a7329d 100644 --- a/CaloDiag/src/CaloExample_module.cc +++ b/CaloDiag/src/CaloExample_module.cc @@ -14,8 +14,6 @@ #include "messagefacility/MessageLogger/MessageLogger.h" #include "canvas/Utilities/InputTag.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" - #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" #include "Offline/DataProducts/inc/CaloSiPMId.hh" diff --git a/CaloReco/src/CaloTemplateWFProcessor.cc b/CaloReco/src/CaloTemplateWFProcessor.cc index fde00e2ba9..1b343ef0a2 100644 --- a/CaloReco/src/CaloTemplateWFProcessor.cc +++ b/CaloReco/src/CaloTemplateWFProcessor.cc @@ -1,6 +1,6 @@ #include "Offline/CaloReco/inc/CaloTemplateWFProcessor.hh" #include "Offline/CaloReco/inc/CaloTemplateWFUtil.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" +#include "art/Framework/Services/Registry/ServiceHandle.h" #include "art_root_io/TFileService.h" #include "art_root_io/TFileDirectory.h" diff --git a/CosmicReco/src/SConscript b/CosmicReco/src/SConscript index 376225852e..2f55244d01 100644 --- a/CosmicReco/src/SConscript +++ b/CosmicReco/src/SConscript @@ -17,7 +17,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_BTrkData', 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', 'mu2e_BFieldGeom', @@ -55,7 +54,6 @@ helper.make_plugins( [ mainlib, 'mu2e_Mu2eUtilities', 'mu2e_SeedService', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', 'mu2e_BFieldGeom', diff --git a/DAQ/src/SConscript b/DAQ/src/SConscript index b0ea70e9ca..00359a7729 100644 --- a/DAQ/src/SConscript +++ b/DAQ/src/SConscript @@ -16,8 +16,7 @@ helper=mu2e_helper(env); rootlibs = env['ROOTLIBS'] -mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', - 'mu2e_GeometryService', +mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', 'mu2e_RecoDataProducts', 'mu2e_CaloConditions', 'mu2e_CalorimeterGeom', @@ -51,7 +50,6 @@ exclude_files = [ ] helper.make_plugins( [ mainlib, 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_CaloConditions', 'mu2e_GeometryService', diff --git a/DAQConditions/src/SConscript b/DAQConditions/src/SConscript index 1e0fb3ab8f..5c2f676400 100644 --- a/DAQConditions/src/SConscript +++ b/DAQConditions/src/SConscript @@ -13,7 +13,6 @@ rootlibs = env['ROOTLIBS'] #jb helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_Mu2eBTrk', diff --git a/EventDisplay/src/SConscript b/EventDisplay/src/SConscript index a3d65a5d28..f062ebea1d 100644 --- a/EventDisplay/src/SConscript +++ b/EventDisplay/src/SConscript @@ -24,7 +24,6 @@ userlibs = [ rootlibs, 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', 'mu2e_GeometryService', - 'mu2e_ConditionsService', 'mu2e_CalorimeterGeom', 'mu2e_TrackerGeom', 'mu2e_GeomPrimitives', diff --git a/EventGenerator/src/CosmicFromTH2.cc b/EventGenerator/src/CosmicFromTH2.cc index df39b0e67b..180fd2392f 100644 --- a/EventGenerator/src/CosmicFromTH2.cc +++ b/EventGenerator/src/CosmicFromTH2.cc @@ -16,7 +16,6 @@ #include "messagefacility/MessageLogger/MessageLogger.h" // Mu2e includes. -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" diff --git a/Lumi/src/SConscript b/Lumi/src/SConscript index 7399da2bee..c324e2d834 100644 --- a/Lumi/src/SConscript +++ b/Lumi/src/SConscript @@ -24,7 +24,6 @@ helper.make_plugins( [ mainlib, 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', 'mu2e_DataProducts', - 'mu2e_ConditionsService', 'mu2e_SeedService', 'mu2e_ConfigTools', 'mu2e_GeneralUtilities', diff --git a/Mu2eKinKal/src/SConscript b/Mu2eKinKal/src/SConscript index 37c6904c6a..33a145e8e5 100644 --- a/Mu2eKinKal/src/SConscript +++ b/Mu2eKinKal/src/SConscript @@ -16,7 +16,6 @@ helper = mu2e_helper(env) mainlib = helper.make_mainlib([ 'openblas', 'mu2e_TrkReco', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', @@ -59,7 +58,6 @@ helper.make_plugins([mainlib, 'openblas', 'mu2e_Mu2eUtilities', 'mu2e_TrkReco', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', diff --git a/Mu2eUtilities/src/ProtonPulseRandPDF.cc b/Mu2eUtilities/src/ProtonPulseRandPDF.cc index a68701f6cf..d170e7a0ed 100644 --- a/Mu2eUtilities/src/ProtonPulseRandPDF.cc +++ b/Mu2eUtilities/src/ProtonPulseRandPDF.cc @@ -15,7 +15,6 @@ #include "CLHEP/Random/RandGeneral.h" // Mu2e includes -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "art/Framework/Services/Optional/RandomNumberGenerator.h" #include "fhiclcpp/ParameterSet.h" diff --git a/ParticleID/src/ParticleID_module.cc b/ParticleID/src/ParticleID_module.cc index 6cabc7b908..7cf41adc08 100644 --- a/ParticleID/src/ParticleID_module.cc +++ b/ParticleID/src/ParticleID_module.cc @@ -51,7 +51,6 @@ #include "Offline/TrackerConditions/inc/Mu2eDetector.hh" #include "Offline/ParticleID/inc/PIDUtilities.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" using namespace std; diff --git a/Print/src/SConscript b/Print/src/SConscript index 3aaead465b..a27810aa30 100644 --- a/Print/src/SConscript +++ b/Print/src/SConscript @@ -14,7 +14,6 @@ rootlibs = env['ROOTLIBS'] babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', - 'mu2e_ConditionsService', 'mu2e_Mu2eUtilities', 'mu2e_GeneralUtilities', 'mu2e_MCDataProducts', @@ -46,7 +45,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', helper.make_plugins( [ mainlib, 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', - 'mu2e_ConditionsService', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', 'art_Framework_Core', diff --git a/STMConditions/src/SConscript b/STMConditions/src/SConscript index 2c96f04c17..121fc67b28 100644 --- a/STMConditions/src/SConscript +++ b/STMConditions/src/SConscript @@ -9,7 +9,6 @@ Import('mu2e_helper') helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_DataProducts', 'fhiclcpp', 'fhiclcpp_types', diff --git a/STMMC/src/SConscript b/STMMC/src/SConscript index 86f5c433ba..6278047c86 100644 --- a/STMMC/src/SConscript +++ b/STMMC/src/SConscript @@ -47,7 +47,6 @@ helper.make_plugins( [ mainlib, 'mu2e_RecoDataProducts', 'mu2e_MCDataProducts', 'mu2e_GlobalConstantsService', - 'mu2e_ConditionsService', 'mu2e_GeometryService', rootlibs ] ) diff --git a/SimulationConditions/src/SConscript b/SimulationConditions/src/SConscript index ff59538c45..3782201885 100644 --- a/SimulationConditions/src/SConscript +++ b/SimulationConditions/src/SConscript @@ -13,7 +13,6 @@ rootlibs = env['ROOTLIBS'] #jb helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_Mu2eBTrk', diff --git a/Sources/src/SConscript b/Sources/src/SConscript index ee88b9f5c3..b04ee6061e 100644 --- a/Sources/src/SConscript +++ b/Sources/src/SConscript @@ -12,7 +12,6 @@ rootlibs = env['ROOTLIBS'] mainlib = helper.make_mainlib(['mu2e_GlobalConstantsService', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_SeedService', 'mu2e_CalorimeterGeom', diff --git a/TEveEventDisplay/src/SConscript b/TEveEventDisplay/src/SConscript index e1f17e9f2d..5cd3419a7c 100644 --- a/TEveEventDisplay/src/SConscript +++ b/TEveEventDisplay/src/SConscript @@ -29,7 +29,6 @@ userlibs = [ rootlibs, 'mu2e_RecoDataProducts', 'mu2e_GlobalConstantsService', 'mu2e_GeometryService', - 'mu2e_ConditionsService', 'mu2e_CalorimeterGeom', 'mu2e_TrackerGeom', 'mu2e_CosmicRayShieldGeom', diff --git a/TrackCaloMatching/src/TrackCaloMatching_module.cc b/TrackCaloMatching/src/TrackCaloMatching_module.cc index 95ed6e84d3..e31b4c2a79 100644 --- a/TrackCaloMatching/src/TrackCaloMatching_module.cc +++ b/TrackCaloMatching/src/TrackCaloMatching_module.cc @@ -18,7 +18,6 @@ // conditions #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" diff --git a/TrackCaloMatching/src/TrkExtrapol_module.cc b/TrackCaloMatching/src/TrkExtrapol_module.cc index 13f4c96535..da7a1b47a1 100644 --- a/TrackCaloMatching/src/TrkExtrapol_module.cc +++ b/TrackCaloMatching/src/TrkExtrapol_module.cc @@ -34,7 +34,6 @@ #include "BTrk/TrkBase/TrkRep.hh" #include "BTrk/KalmanTrack/KalRep.hh" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" // data #include "Offline/RecoDataProducts/inc/StrawHit.hh" diff --git a/TrackerMC/inc/StrawWaveform.hh b/TrackerMC/inc/StrawWaveform.hh index fcd6561663..8f67d01b65 100644 --- a/TrackerMC/inc/StrawWaveform.hh +++ b/TrackerMC/inc/StrawWaveform.hh @@ -17,7 +17,6 @@ // Mu2e includes #include "Offline/DataProducts/inc/StrawEnd.hh" #include "Offline/DataProducts/inc/StrawId.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerConditions/inc/StrawElectronics.hh" #include "Offline/DataProducts/inc/TrkTypes.hh" #include "Offline/TrackerGeom/inc/Straw.hh" diff --git a/TrackerMC/src/MakeMCKalSeed_module.cc b/TrackerMC/src/MakeMCKalSeed_module.cc index 5522427bcb..91596d7cde 100644 --- a/TrackerMC/src/MakeMCKalSeed_module.cc +++ b/TrackerMC/src/MakeMCKalSeed_module.cc @@ -15,7 +15,6 @@ #include "messagefacility/MessageLogger/MessageLogger.h" // conditions #include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/BFieldGeom/inc/BFieldManager.hh" #include "BTrk/BField/BField.hh" diff --git a/TrkDiag/src/StrawHitDiag_module.cc b/TrkDiag/src/StrawHitDiag_module.cc index 715a5b0e21..12fe02d1fb 100644 --- a/TrkDiag/src/StrawHitDiag_module.cc +++ b/TrkDiag/src/StrawHitDiag_module.cc @@ -13,7 +13,6 @@ #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "art_root_io/TFileService.h" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/TrackerConditions/inc/StrawElectronics.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" diff --git a/TrkHitReco/src/FlagBkgHits_module.cc b/TrkHitReco/src/FlagBkgHits_module.cc index 8f60b62fd5..8a07ae2945 100644 --- a/TrkHitReco/src/FlagBkgHits_module.cc +++ b/TrkHitReco/src/FlagBkgHits_module.cc @@ -7,7 +7,6 @@ #include "fhiclcpp/types/Sequence.h" #include "fhiclcpp/types/OptionalTable.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "Offline/MCDataProducts/inc/StrawDigiMC.hh" #include "Offline/DataProducts/inc/StrawIdMask.hh" diff --git a/TrkPatRec/src/KalSeedFit_module.cc b/TrkPatRec/src/KalSeedFit_module.cc index 31840c4f07..194731ea68 100644 --- a/TrkPatRec/src/KalSeedFit_module.cc +++ b/TrkPatRec/src/KalSeedFit_module.cc @@ -17,7 +17,6 @@ #include "art/Utilities/make_tool.h" #include "art/Framework/Principal/Run.h" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" diff --git a/TrkReco/src/KalFit.cc b/TrkReco/src/KalFit.cc index 147d0e7edb..90c2fb05d3 100644 --- a/TrkReco/src/KalFit.cc +++ b/TrkReco/src/KalFit.cc @@ -18,7 +18,6 @@ #include "Offline/BFieldGeom/inc/BFieldManager.hh" #include "Offline/GeometryService/inc/DetectorSystem.hh" // conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" // data #include "Offline/RecoDataProducts/inc/ComboHit.hh" diff --git a/Validation/src/SConscript b/Validation/src/SConscript index 5aeb71f3ce..d1334ddf5b 100644 --- a/Validation/src/SConscript +++ b/Validation/src/SConscript @@ -14,7 +14,6 @@ babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_Validation_root', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_TrackerGeom', 'mu2e_TrackerConditions', @@ -45,7 +44,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_Validation_root', helper.make_plugins( [ mainlib,'mu2e_Validation_root', 'mu2e_GeometryService', - 'mu2e_ConditionsService', 'mu2e_Mu2eUtilities', 'mu2e_GeneralUtilities', 'mu2e_MCDataProducts', From 1450a0d699775466cb6ce4c2d511c3252aeda368 Mon Sep 17 00:00:00 2001 From: giro94 Date: Fri, 30 Jan 2026 05:56:44 -0600 Subject: [PATCH 081/174] Prodition service implemented in recodigi maker. Also, added flag to disable use of proton bunch time --- CaloReco/CMakeLists.txt | 3 + CaloReco/src/CaloRecoDigiMaker_module.cc | 317 ++++++++++++----------- 2 files changed, 168 insertions(+), 152 deletions(-) diff --git a/CaloReco/CMakeLists.txt b/CaloReco/CMakeLists.txt index 02202528d7..81d25139d5 100644 --- a/CaloReco/CMakeLists.txt +++ b/CaloReco/CMakeLists.txt @@ -36,10 +36,13 @@ cet_build_plugin(CaloRecoDigiMaker art::module LIBRARIES REG Offline::CaloReco + Offline::DbService + Offline::DbTables Offline::ConditionsService Offline::DAQConditions Offline::ProditionsService Offline::RecoDataProducts + Offline::CaloConditions ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcl/prolog.fcl ${CURRENT_BINARY_DIR} fcl/prolog.fcl) diff --git a/CaloReco/src/CaloRecoDigiMaker_module.cc b/CaloReco/src/CaloRecoDigiMaker_module.cc index f8bb8e2916..505cbfa00e 100644 --- a/CaloReco/src/CaloRecoDigiMaker_module.cc +++ b/CaloReco/src/CaloRecoDigiMaker_module.cc @@ -1,183 +1,196 @@ #include "art/Framework/Core/EDProducer.h" #include "art/Framework/Principal/Event.h" -#include "art_root_io/TFileService.h" #include "art_root_io/TFileDirectory.h" +#include "art_root_io/TFileService.h" #include "canvas/Utilities/InputTag.h" #include "fhiclcpp/types/Atom.h" #include "fhiclcpp/types/Sequence.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" +#include "Offline/CaloConditions/inc/CalCalib.hh" +#include "Offline/CaloReco/inc/CaloRawWFProcessor.hh" +#include "Offline/CaloReco/inc/CaloTemplateWFProcessor.hh" +#include "Offline/CaloReco/inc/CaloWaveformProcessor.hh" #include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" +#include "Offline/ConditionsService/inc/ConditionsHandle.hh" +#include "Offline/DAQConditions/inc/EventTiming.hh" +#include "Offline/DbTables/inc/CalCosmicEnergyCalib.hh" +#include "Offline/DbTables/inc/CalEnergyCalib.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" #include "Offline/RecoDataProducts/inc/CaloRecoDigi.hh" #include "Offline/RecoDataProducts/inc/ProtonBunchTime.hh" -#include "Offline/CaloReco/inc/CaloWaveformProcessor.hh" -#include "Offline/CaloReco/inc/CaloTemplateWFProcessor.hh" -#include "Offline/CaloReco/inc/CaloRawWFProcessor.hh" -#include "Offline/DAQConditions/inc/EventTiming.hh" #include -#include #include - +#include namespace mu2e { - class CaloRecoDigiMaker : public art::EDProducer - { - public: - enum processorStrategy {NoChoice, RawExtract, Template}; - - struct Config - { - using Name = fhicl::Name; - using Comment = fhicl::Comment; - fhicl::Table proc_raw_conf { Name("RawProcessor"), Comment("Raw processor config") }; - fhicl::Table proc_templ_conf { Name("TemplateProcessor"), Comment("Log normal fit processor config") }; - fhicl::Atom caloDigiCollection { Name("caloDigiCollection"), Comment("Calo Digi module label") }; - fhicl::Atom pbttoken { Name("ProtonBunchTimeTag"), Comment("ProtonBunchTime producer")}; - fhicl::Atom processorStrategy { Name("processorStrategy"), Comment("Digi reco processor name") }; - fhicl::Atom digiSampling { Name("digiSampling"), Comment("Calo ADC sampling time (ns)") }; - fhicl::Atom maxChi2Cut { Name("maxChi2Cut"), Comment("Chi2 cut for keeping reco digi") }; - fhicl::Atom maxPlots { Name("maxPlots"), Comment("Maximum number of waveform plots") }; - fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diagnosis level") }; - }; - - explicit CaloRecoDigiMaker(const art::EDProducer::Table& config) : - EDProducer{config}, - caloDigisToken_ {consumes(config().caloDigiCollection())}, - pbttoken_ {consumes(config().pbttoken())}, - processorStrategy_ (config().processorStrategy()), - digiSampling_ (config().digiSampling()), - maxChi2Cut_ (config().maxChi2Cut()), - maxPlots_ (config().maxPlots()), - diagLevel_ (config().diagLevel()) - { - produces(); - - std::map spmap; - spmap["RawExtract"] = RawExtract; - spmap["TemplateFit"] = Template; - - switch (spmap[processorStrategy_]) - { - case RawExtract: - { - waveformProcessor_ = std::make_unique(config().proc_raw_conf()); - break; - } - case Template: - { - waveformProcessor_ = std::make_unique(config().proc_templ_conf()); - break; - } - default: - { - throw cet::exception("CATEGORY")<< "Unrecognized processor in CaloHitsFromDigis module"; - } - } - } - - void beginRun(art::Run& aRun) override; - void produce(art::Event& e) override; - - private: - void extractRecoDigi(const art::ValidHandle&, CaloRecoDigiCollection&, double ); - - const art::ProductToken caloDigisToken_; - const art::ProductToken pbttoken_; - const std::string processorStrategy_; - double digiSampling_; - double maxChi2Cut_; - int maxPlots_; - int diagLevel_; - std::unique_ptr waveformProcessor_; +class CaloRecoDigiMaker : public art::EDProducer { +public: + enum processorStrategy { NoChoice, RawExtract, Template }; + + struct Config { + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Table proc_raw_conf{Name("RawProcessor"), + Comment("Raw processor config")}; + fhicl::Table proc_templ_conf{ + Name("TemplateProcessor"), Comment("Log normal fit processor config")}; + fhicl::Atom caloDigiCollection{Name("caloDigiCollection"), + Comment("Calo Digi module label")}; + fhicl::Atom pbtTag{Name("ProtonBunchTimeTag"), + Comment("ProtonBunchTime producer")}; + fhicl::Atom usePBT{Name("UseProtonBunchTime"), + Comment("Use the proton bunch time for T0")}; + fhicl::Atom processorStrategy{Name("processorStrategy"), + Comment("Digi reco processor name")}; + fhicl::Atom digiSampling{Name("digiSampling"), Comment("Calo ADC sampling time (ns)")}; + fhicl::Atom maxChi2Cut{Name("maxChi2Cut"), Comment("Chi2 cut for keeping reco digi")}; + fhicl::Atom maxPlots{Name("maxPlots"), Comment("Maximum number of waveform plots")}; + fhicl::Atom diagLevel{Name("diagLevel"), Comment("Diagnosis level")}; }; + explicit CaloRecoDigiMaker(const art::EDProducer::Table& config) : + EDProducer{config}, + caloDigisToken_{consumes(config().caloDigiCollection())}, + pbtTag_{config().pbtTag()}, usePBT_{config().usePBT()}, + processorStrategy_(config().processorStrategy()), digiSampling_(config().digiSampling()), + maxChi2Cut_(config().maxChi2Cut()), maxPlots_(config().maxPlots()), + diagLevel_(config().diagLevel()) { + produces(); + + if (usePBT_) { + pbttoken_ = consumes(pbtTag_); + } + + std::map spmap; + spmap["RawExtract"] = RawExtract; + spmap["TemplateFit"] = Template; + + switch (spmap[processorStrategy_]) { + case RawExtract: { + waveformProcessor_ = std::make_unique(config().proc_raw_conf()); + break; + } + case Template: { + waveformProcessor_ = std::make_unique(config().proc_templ_conf()); + break; + } + default: { + throw cet::exception("CATEGORY") << "Unrecognized processor in CaloHitsFromDigis module"; + } + } + } - //------------------------------------------------------- - // The t0 time in caloDigi has been corrected to the DR time frame for backward compatibility, so we only need to - // correct for the jitter between the DR marker and the nearest clock - void CaloRecoDigiMaker::produce(art::Event& event) - { - if (diagLevel_ > 0) std::cout<<"[CaloRecoDigiMaker::produce] begin"<(); - - auto pbtH = event.getValidHandle(pbttoken_); - const ProtonBunchTime& pbt(*pbtH); - double pbtOffset = pbt.pbtime_; - - extractRecoDigi(caloDigisH, *recoCaloDigiColl, pbtOffset); - - event.put(std::move(recoCaloDigiColl)); - - if (diagLevel_ > 0) std::cout<<"[CaloRecoDigiMaker::produce] end"<&, CaloRecoDigiCollection&, double, + mu2e::CalCalib const&); + + const art::ProductToken caloDigisToken_; + const art::InputTag pbtTag_; + bool usePBT_; + art::ProductToken pbttoken_; + const std::string processorStrategy_; + double digiSampling_; + double maxChi2Cut_; + int maxPlots_; + int diagLevel_; + std::unique_ptr waveformProcessor_; + ProditionsHandle calCalibHandle_; +}; + +//------------------------------------------------------- +// The t0 time in caloDigi has been corrected to the DR time frame for backward compatibility, so we +// only need to correct for the jitter between the DR marker and the nearest clock +void CaloRecoDigiMaker::produce(art::Event& event) { + if (diagLevel_ > 0) + std::cout << "[CaloRecoDigiMaker::produce] begin" << std::endl; + + const auto& caloDigisH = event.getValidHandle(caloDigisToken_); + auto recoCaloDigiColl = std::make_unique(); + + double pbtOffset = 0; + if (usePBT_) { + auto pbtH = event.getValidHandle(pbttoken_); + const ProtonBunchTime& pbt(*pbtH); + pbtOffset = pbt.pbtime_; } + mu2e::CalCalib const& calCalib = calCalibHandle_.get(event.id()); - //-------------------------------------------------- - void CaloRecoDigiMaker::beginRun(art::Run& aRun) - { - waveformProcessor_->initialize(); - } + extractRecoDigi(caloDigisH, *recoCaloDigiColl, pbtOffset, calCalib); + event.put(std::move(recoCaloDigiColl)); - //------------------------------------------------------------------------------------------------------------ - void CaloRecoDigiMaker::extractRecoDigi(const art::ValidHandle& caloDigisHandle, - CaloRecoDigiCollection &recoCaloHits, double pbtOffset) - { - - const auto& caloDigis = *caloDigisHandle; - ConditionsHandle calorimeterCalibrations("ignored"); - - double totEnergyReco(0); - std::vector x{},y{}; - for (const auto& caloDigi : caloDigis) - { - int SiPMID = caloDigi.SiPMID(); - double t0 = caloDigi.t0(); - double adc2MeV = calorimeterCalibrations->ADC2MeV(SiPMID); - const std::vector& waveform = caloDigi.waveform(); - - size_t index = &caloDigi - &caloDigis.front(); - art::Ptr caloDigiPtr(caloDigisHandle, index); - - x.clear();y.clear(); - for (unsigned int i=0;ireset(); - waveformProcessor_->extract(x,y); - if (diagLevel_ > 2) std::cout<<"CaloRecoDigiMaker found "<nPeaks()<<" peaks for SiPMID="<nPeaks();++i) - { - double eDep = waveformProcessor_->amplitude(i)*adc2MeV; - double eDepErr = waveformProcessor_->amplitudeErr(i)*adc2MeV; - double time = waveformProcessor_->time(i) - pbtOffset; // correct to time since protons - double timeErr = waveformProcessor_->timeErr(i); - bool isPileUp = waveformProcessor_->isPileUp(i); - double chi2 = waveformProcessor_->chi2(); - int ndf = waveformProcessor_->ndf(); - - if (diagLevel_ > 2) std::cout<<"Found reco digi hit with eDep="< 0) + std::cout << "[CaloRecoDigiMaker::produce] end" << std::endl; +} +//-------------------------------------------------- +void CaloRecoDigiMaker::beginRun(art::Run& aRun) { waveformProcessor_->initialize(); } + +//------------------------------------------------------------------------------------------------------------ +void CaloRecoDigiMaker::extractRecoDigi(const art::ValidHandle& caloDigisHandle, + CaloRecoDigiCollection& recoCaloHits, double pbtOffset, + mu2e::CalCalib const& calCalib) { + + const auto& caloDigis = *caloDigisHandle; + + double totEnergyReco(0); + std::vector x{}, y{}; + for (const auto& caloDigi : caloDigis) { + int SiPMID = caloDigi.SiPMID(); + double t0 = caloDigi.t0(); + double adc2MeV = calCalib.ADC2MeV(SiPMID); + + const std::vector& waveform = caloDigi.waveform(); + + size_t index = &caloDigi - &caloDigis.front(); + art::Ptr caloDigiPtr(caloDigisHandle, index); + + x.clear(); + y.clear(); + for (unsigned int i = 0; i < waveform.size(); ++i) { + x.push_back(t0 + (i + 0.5) * digiSampling_); // add 0.5 to be in middle of bin + y.push_back(waveform.at(i)); + } + + waveformProcessor_->reset(); + waveformProcessor_->extract(x, y); + if (diagLevel_ > 2) + std::cout << "CaloRecoDigiMaker found " << waveformProcessor_->nPeaks() + << " peaks for SiPMID=" << SiPMID << std::endl; + + for (int i = 0; i < waveformProcessor_->nPeaks(); ++i) { + double eDep = waveformProcessor_->amplitude(i) * adc2MeV; + double eDepErr = waveformProcessor_->amplitudeErr(i) * adc2MeV; + double time = waveformProcessor_->time(i) - pbtOffset; // correct to time since protons + double timeErr = waveformProcessor_->timeErr(i); + bool isPileUp = waveformProcessor_->isPileUp(i); + double chi2 = waveformProcessor_->chi2(); + int ndf = waveformProcessor_->ndf(); + + if (diagLevel_ > 2) + std::cout << "Found reco digi hit with eDep=" << eDep << " time=" << time + << " chi2=" << chi2 << " ndf=" << ndf << std::endl; + if (chi2 / float(ndf) > maxChi2Cut_) + continue; + + if (SiPMID % 2 == 0) + totEnergyReco += eDep; + recoCaloHits.emplace_back( + CaloRecoDigi(caloDigiPtr, eDep, eDepErr, time, timeErr, chi2, ndf, isPileUp)); + } + } + if (diagLevel_ > 1) + std::cout << "[CaloRecoDigiMaker] Total energy reco " << totEnergyReco << std::endl; } +} // namespace mu2e + DEFINE_ART_MODULE(mu2e::CaloRecoDigiMaker) From 178fe4edf68e89d971c0158fe43c2a32f976b797 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Fri, 30 Jan 2026 06:03:41 -0600 Subject: [PATCH 082/174] Modified SConscript for offline build --- CaloReco/src/SConscript | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CaloReco/src/SConscript b/CaloReco/src/SConscript index 3682fbca54..a53ddd46b0 100644 --- a/CaloReco/src/SConscript +++ b/CaloReco/src/SConscript @@ -18,9 +18,11 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_RecoDataProducts', 'mu2e_Mu2eUtilities', 'mu2e_CalorimeterGeom', + 'mu2e_CaloConditions', 'mu2e_GlobalConstantsService', 'mu2e_DataProducts', 'mu2e_DbTables', + 'mu2e_DbService', 'mu2e_GeneralUtilities', 'art_Persistency_Common', 'art_Persistency_Provenance', @@ -49,9 +51,11 @@ helper.make_plugins( [ mainlib, 'mu2e_SeedService', 'mu2e_DAQConditions', 'mu2e_CalorimeterGeom', + 'mu2e_CaloConditions', 'mu2e_RecoDataProducts', 'mu2e_DataProducts', 'mu2e_DbTables', + 'mu2e_DbService', 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', From e358a9badcb01e46dd0103fbc7d896a5081662b5 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Fri, 30 Jan 2026 08:39:02 -0600 Subject: [PATCH 083/174] Removed unused headers, added fcl paramaeter --- CaloReco/fcl/prolog.fcl | 1 + CaloReco/src/CaloRecoDigiMaker_module.cc | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CaloReco/fcl/prolog.fcl b/CaloReco/fcl/prolog.fcl index a63805b89c..7e893263d9 100644 --- a/CaloReco/fcl/prolog.fcl +++ b/CaloReco/fcl/prolog.fcl @@ -41,6 +41,7 @@ CaloReco : { @table::CaloReco processorStrategy : "TemplateFit" digiSampling : @local::HitMakerDigiSampling ProtonBunchTimeTag : "EWMProducer" + UseProtonBunchTime : true maxChi2Cut : 2.0 maxPlots : 50 diagLevel : 0 diff --git a/CaloReco/src/CaloRecoDigiMaker_module.cc b/CaloReco/src/CaloRecoDigiMaker_module.cc index 505cbfa00e..f03ffd8e66 100644 --- a/CaloReco/src/CaloRecoDigiMaker_module.cc +++ b/CaloReco/src/CaloRecoDigiMaker_module.cc @@ -10,11 +10,7 @@ #include "Offline/CaloReco/inc/CaloRawWFProcessor.hh" #include "Offline/CaloReco/inc/CaloTemplateWFProcessor.hh" #include "Offline/CaloReco/inc/CaloWaveformProcessor.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/DAQConditions/inc/EventTiming.hh" -#include "Offline/DbTables/inc/CalCosmicEnergyCalib.hh" -#include "Offline/DbTables/inc/CalEnergyCalib.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" #include "Offline/RecoDataProducts/inc/CaloRecoDigi.hh" From d119aadebabd30d385d0f2e6272ddc2415a737fe Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 30 Jan 2026 09:10:37 -0600 Subject: [PATCH 084/174] add column to archive table --- DbService/data/create.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DbService/data/create.sql b/DbService/data/create.sql index 5c064c2577..44b2b52df9 100644 --- a/DbService/data/create.sql +++ b/DbService/data/create.sql @@ -412,7 +412,7 @@ CREATE TABLE cal.cosmicenergycalib (cid INTEGER, roid INTEGER, peak NUMERIC, errpeak NUMERIC, width NUMERIC, errwidth NUMERIC, sigma NUMERIC, errsigma NUMERIC, - chisq NUMERIC,nhits INTEGER, + chisq NUMERIC, ndf INTEGER, nhits INTEGER, CONSTRAINT cal_cosmicenergycalib_pk PRIMARY KEY (cid,roid) ); GRANT SELECT ON cal.cosmicenergycalib TO PUBLIC; GRANT INSERT ON cal.cosmicenergycalib TO cal_role; From 419c0d6b16ea0bca6dcf6c10e198c43a385a3d9b Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Fri, 30 Jan 2026 09:23:04 -0600 Subject: [PATCH 085/174] CalCalib should look for nChannelDB rows --- CaloConditions/src/CalCalibMaker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaloConditions/src/CalCalibMaker.cc b/CaloConditions/src/CalCalibMaker.cc index 974195ae1e..415b5489a7 100644 --- a/CaloConditions/src/CalCalibMaker.cc +++ b/CaloConditions/src/CalCalibMaker.cc @@ -41,7 +41,7 @@ namespace mu2e { cout << "CalCalibMaker::fromDb making CalCalib\n"; } - size_t nChan = CaloConst::_nChannel; + size_t nChan = CaloConst::_nChannelDB; if (_config.verbose()) { cout << "CalCalibMaker::fromDb checking for " << nChan << " channels\n"; From 9c34f524bb48c7e02f73e65d17a0495777590f32 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 30 Jan 2026 15:12:25 -0600 Subject: [PATCH 086/174] remove obsolete ConditionsBase reference --- TrkHitReco/src/StrawHitReco_module.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/TrkHitReco/src/StrawHitReco_module.cc b/TrkHitReco/src/StrawHitReco_module.cc index adb8e28809..1071e86aa4 100644 --- a/TrkHitReco/src/StrawHitReco_module.cc +++ b/TrkHitReco/src/StrawHitReco_module.cc @@ -15,7 +15,6 @@ // conditions #include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/ConditionsBase/inc/TrackerCalibrationStructs.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" From 92651eec127e0e78bc623941cd28e59951b53f3a Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 30 Jan 2026 15:13:59 -0600 Subject: [PATCH 087/174] obsolete --- ConditionsBase/CMakeLists.txt | 8 --- .../inc/TrackerCalibrationStructs.hh | 52 ------------------- 2 files changed, 60 deletions(-) delete mode 100644 ConditionsBase/CMakeLists.txt delete mode 100644 ConditionsBase/inc/TrackerCalibrationStructs.hh diff --git a/ConditionsBase/CMakeLists.txt b/ConditionsBase/CMakeLists.txt deleted file mode 100644 index 082d958891..0000000000 --- a/ConditionsBase/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cet_make_library(INTERFACE INSTALLED_PATH_BASE Offline - SOURCE - inc/TrackerCalibrationStructs.hh - LIBRARIES INTERFACE - -) - -install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/ConditionsBase/inc/TrackerCalibrationStructs.hh b/ConditionsBase/inc/TrackerCalibrationStructs.hh deleted file mode 100644 index 3e4b8646d0..0000000000 --- a/ConditionsBase/inc/TrackerCalibrationStructs.hh +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef ConditionsService_TrackerCalibrationStructs_hh -#define ConditionsService_TrackerCalibrationStructs_hh -// -// Parameters for tracker calibrations. -// -// Original author David Brown -// - -// C++ includes. -#include - -// Mu2e includes. -#include "CLHEP/Vector/ThreeVector.h" - -namespace mu2e -{ - class SimpleConfig; - class StrawHit; - class Straw; -// simple struct to hold output of timeToDistance function - struct T2D { - double _rdrift; - double _rdrifterr; - double _vdrift; // local drift velocity at this radius, ie dr/dt(rdrift). - T2D() : _rdrift(0.0), _rdrifterr(1.0), _vdrift(0.0) {} - }; - -// simple struct to hold output of distanceToTime function - struct D2T { - double _tdrift; - double _tdrifterr; - double _vdrift; // local drift velocity at this radius, ie dr/dt(rdrift). - D2T() : _tdrift(0.0),_tdrifterr(1.0), _vdrift(0.0) {} - }; - -// simple struct to hold output of energyToAmplitude function - struct E2A { - double _ampl; - double _amplerr; - E2A() : _ampl(0.0), _amplerr(1.0) {} - }; - -// simple struct to hold output of amplitudeToEnergy function - struct A2E { - double _edep; - double _edeperr; - A2E() : _edep(0.0),_edeperr(1.0) {} - }; - -} - -#endif From 1c736f6e6d59b73bdcae97b2766d52d9b68f0b05 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 30 Jan 2026 15:14:44 -0600 Subject: [PATCH 088/174] ConditionsBase is obsolete --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eba698c257..4e6f4c241e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,6 @@ add_subdirectory(CalPatRec) add_subdirectory(CommonMC) add_subdirectory(CommonReco) add_subdirectory(Compression) -add_subdirectory(ConditionsBase) add_subdirectory(ConditionsService) add_subdirectory(ConfigTools) add_subdirectory(CosmicRayShieldGeom) From ee5a3f720fa7be97424584482b1aa6e2d3bf4921 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 30 Jan 2026 15:16:00 -0600 Subject: [PATCH 089/174] ConditionsBase is obsolete --- TrkHitReco/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/TrkHitReco/CMakeLists.txt b/TrkHitReco/CMakeLists.txt index cdd4a88946..663d8e90de 100644 --- a/TrkHitReco/CMakeLists.txt +++ b/TrkHitReco/CMakeLists.txt @@ -80,7 +80,6 @@ cet_build_plugin(StrawHitReco art::module art_root_io::TFileService_service Offline::TrkHitReco - Offline::ConditionsBase Offline::ConditionsService Offline::ConfigTools Offline::DataProducts From 1a26cb7ba520d608122aeb2c483469fb4bab50b8 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 30 Jan 2026 13:30:36 -0800 Subject: [PATCH 090/174] Remove more BTrk dependencies --- Analyses/src/CosmicFilter_module.cc | 49 +- BTrkLegacy/inc/HelixParams.hh | 71 ++- BTrkLegacy/inc/HelixTraj.hh | 10 +- CalPatRec/src/CalHelixFinderAlg.cc | 4 +- RecoDataProducts/inc/TrkToCaloExtrapol.hh | 106 ---- RecoDataProducts/src/TrkToCaloExtrapol.cc | 189 ------ RecoDataProducts/src/classes.h | 1 - RecoDataProducts/src/classes_def.xml | 6 - .../src/TrackCaloMatching_module.cc | 523 ---------------- TrackCaloMatching/src/TrkExtrapol_module.cc | 582 ------------------ TrkReco/src/TrkUtilities.cc | 146 +---- 11 files changed, 41 insertions(+), 1646 deletions(-) delete mode 100644 RecoDataProducts/inc/TrkToCaloExtrapol.hh delete mode 100644 RecoDataProducts/src/TrkToCaloExtrapol.cc delete mode 100644 TrackCaloMatching/src/TrackCaloMatching_module.cc delete mode 100644 TrackCaloMatching/src/TrkExtrapol_module.cc diff --git a/Analyses/src/CosmicFilter_module.cc b/Analyses/src/CosmicFilter_module.cc index 1085c639d1..6aa9205609 100644 --- a/Analyses/src/CosmicFilter_module.cc +++ b/Analyses/src/CosmicFilter_module.cc @@ -19,6 +19,7 @@ #include "art/Framework/Principal/Event.h" #include "art/Framework/Principal/Handle.h" #include "art_root_io/TFileService.h" +#include "cetlib_except/exception.h" //#include #include "fhiclcpp/ParameterSet.h" #include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" @@ -28,8 +29,6 @@ #include "Offline/RecoDataProducts/inc/StrawHit.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" -#include "BTrkLegacy/inc/HelixParams.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" using namespace std; @@ -89,50 +88,8 @@ namespace mu2e { //----------------------------------------------------------------------------- bool CosmicFilter::filter(art::Event& anEvent) { - - const KalRep* trk; - double d0, z0; - int n_good_tracks; - - bool rc = false; - - art::Handle krepsHandle; - anEvent.getByLabel(fTrkPatRecModuleLabel,"DownstreameMinus", krepsHandle); - const KalRepPtrCollection* list_of_kreps(0); - - - _nTracks = 0; - if (krepsHandle.isValid()) { - list_of_kreps = krepsHandle.product(); - _nTracks = list_of_kreps->size(); - } - - - n_good_tracks = 0; - for (int i=0; i<_nTracks; i++) { - trk = list_of_kreps->at(i).get(); - - d0 = trk->helix(0).d0(); - z0 = trk->helix(0).z0(); - - _hist.fTrackD0->Fill(d0); - _hist.fTrackZ0[0]->Fill(z0); - if (fabs(d0) < fMaxD0) _hist.fTrackZ0[1]->Fill(z0); - - if ((fabs(d0) < fMaxD0) && (fabs(z0) < fMaxZ0)) { - n_good_tracks += 1; - } - - CLHEP::Hep3Vector mom = trk->momentum(0); // at S=0 - _hist.fP->Fill(mom.mag()); - } - - _hist.fNTracks->Fill(_nTracks); - _hist.fNGoodTracks->Fill(n_good_tracks); - - rc = (n_good_tracks > 0); - - return rc; + throw cet::exception("TRIGGER") << "This module needs to ben migrated to KinKal" << std::endl; + return false; } } diff --git a/BTrkLegacy/inc/HelixParams.hh b/BTrkLegacy/inc/HelixParams.hh index d8f2e62aba..26ad2c434b 100644 --- a/BTrkLegacy/inc/HelixParams.hh +++ b/BTrkLegacy/inc/HelixParams.hh @@ -1,40 +1,39 @@ -#ifndef TRKEXCHANGEPAR_HH -#define TRKEXCHANGEPAR_HH -#include "BTrk/TrkBase/TrkParams.hh" +#ifndef BTrkLegacy_HelixParams_HH +#define BTrkLegacy_HelixParams_HH +#include "CLHEP/Matrix/Vector.h" +#include "CLHEP/Matrix/SymMatrix.h" // Class interface // -class HelixParams : public TrkParams { -public: - enum ParIndex {d0Index=0, phi0Index, omegaIndex, z0Index, tanDipIndex, NHLXPRM}; - - HelixParams(const CLHEP::HepVector&, const CLHEP::HepSymMatrix&); - ~HelixParams(); - - double d0() const {return parvec[d0Index];} - double phi0() const {return parvec[phi0Index];} - double omega() const {return parvec[omegaIndex];} - double z0() const {return parvec[z0Index];} - double tanDip() const {return parvec[tanDipIndex];} - - const CLHEP::HepVector& params() const {return parvec;} - CLHEP::HepVector& params() {return parvec;} - const CLHEP::HepSymMatrix& covariance() const {return parcov;} - CLHEP::HepSymMatrix& covariance() {return parcov;} - - void setD0(double in) {parvec[d0Index] = in;} - void setPhi0(double in) {parvec[phi0Index] = in;} - void setOmega(double in) {parvec[omegaIndex] = in;} - void setZ0(double in) {parvec[z0Index] = in;} - void setTanDip(double in) {parvec[tanDipIndex] = in;} - void setError(const CLHEP::HepSymMatrix& in) {parcov = in;} - - void print(std::ostream& o) const; // Print parameters on one line - void printAll(std::ostream& o) const; // Print parameters and error matrix - -private: -}; - -// Output operator, useful for debugging -std::ostream& operator<<(std::ostream& o, const HelixParams& helix); +namespace mu2e { + class HelixParams { + public: + enum ParIndex {d0Index=0, phi0Index, omegaIndex, z0Index, tanDipIndex, NHLXPRM}; + + HelixParams(const CLHEP::HepVector& pvec, const CLHEP::HepSymMatrix& pcov) : parvec(pvec), parcov(pcov) {} + ~HelixParams(){} + + double d0() const {return parvec[d0Index];} + double phi0() const {return parvec[phi0Index];} + double omega() const {return parvec[omegaIndex];} + double z0() const {return parvec[z0Index];} + double tanDip() const {return parvec[tanDipIndex];} + + const CLHEP::HepVector& params() const {return parvec;} + CLHEP::HepVector& params() {return parvec;} + const CLHEP::HepSymMatrix& covariance() const {return parcov;} + CLHEP::HepSymMatrix& covariance() {return parcov;} + + void setD0(double in) {parvec[d0Index] = in;} + void setPhi0(double in) {parvec[phi0Index] = in;} + void setOmega(double in) {parvec[omegaIndex] = in;} + void setZ0(double in) {parvec[z0Index] = in;} + void setTanDip(double in) {parvec[tanDipIndex] = in;} + + private: + CLHEP::HepVector parvec; + CLHEP::HepSymMatrix parcov; + }; + typedef HelixParams HelixTraj; +} #endif diff --git a/BTrkLegacy/inc/HelixTraj.hh b/BTrkLegacy/inc/HelixTraj.hh index 130ba3ddbb..498d5c369b 100644 --- a/BTrkLegacy/inc/HelixTraj.hh +++ b/BTrkLegacy/inc/HelixTraj.hh @@ -13,17 +13,9 @@ private: public: HelixTraj(const CLHEP::HepVector& pvec,const CLHEP::HepSymMatrix& pcov ) : pvec_(pvec), pcov_(pcov) { - // Make sure the dimensions of the input matrix and vector are correct - /* - if( pvec.num_row() != NHLXPRM || pcov.num_row() != NHLXPRM ){ - ErrMsg(fatal) - << "HelixTraj: incorrect constructor vector/matrix dimension" << endmsg; - } - */ - if (omega() == 0.0) pvec_[omegaIndex] = 1.e-9; } - HelixTraj( const HelixTraj& h ) : pvec_(h.pvec_), pcov_(h.pcov_) + HelixTraj( const HelixTraj& h ) : pvec_(h.pvec_), pcov_(h.pcov_) { } diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 1d1c8010ce..c9d7fa2d08 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -7,9 +7,7 @@ // [00:13] : Giani // [14:15] : Pasha - parameters of fit with non-equal weights // -// the following has to come before other BaBar includes -/////////////////////////////////////////////////////////////////////////////// -#include "BTrkLegacy/inc/HelixTraj.hh" +#include "BTrkLegacy/inc/HelixParams.hh" #include "Offline/CalPatRec/inc/CalHelixFinderAlg.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" diff --git a/RecoDataProducts/inc/TrkToCaloExtrapol.hh b/RecoDataProducts/inc/TrkToCaloExtrapol.hh deleted file mode 100644 index 22353407a6..0000000000 --- a/RecoDataProducts/inc/TrkToCaloExtrapol.hh +++ /dev/null @@ -1,106 +0,0 @@ -// -// container for the info of the extrapolated trajectory on the calorimeter -// -// -// Original author G. Pezzullo -// - - -#ifndef TrackCaloMatching_TrkToCaloExtrapol_hh -#define TrackCaloMatching_TrkToCaloExtrapol_hh - -// Mu2e includes: -#include "canvas/Persistency/Common/Ptr.h" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/BbrPointErr.hh" -#include "BTrk/BbrGeom/BbrLorentzVectorErr.hh" - -//tracker includes -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -// C++ includes -#include - -namespace mu2e { - - // typedef art::Ptr EKalRepPtr; - // typedef art::Ptr EKalRepPtr; - - struct TrkToCaloExtrapol{ - - private: - int _diskId; - int _trackNumber; // track numeber - KalRepPtr _trk; - double _pathLengthEntrance; - double _pathLengthExit; - - - - public: - - TrkToCaloExtrapol():_diskId(-1), - _pathLengthEntrance(0.0), - _pathLengthExit(0.0){} - - - - TrkToCaloExtrapol(int disk, int trkNumber, - KalRepPtr& trk, double entrance, double exit): - _diskId(disk), - _trackNumber(trkNumber), - _trk(trk), - _pathLengthEntrance(entrance), - _pathLengthExit(exit){ - } - ~TrkToCaloExtrapol(){} - - //Accessors - int diskId() const; - int trackNumber() const {return _trackNumber;} - double time() const; - double timeErr() const; - double pathLengthEntrance() const; - double pathLenghtEntranceErr() const; - double pathLengthExit() const; - double fitConsistency() const; - double t0() const; - double t0Err() const; - double tOrigin() const; - double tOriginErr() const; - CLHEP::Hep3Vector entranceMomentum() const; - BbrVectorErr entranceMomentumErr() const; - //HepPoint entrancePosition() const; #TODO: Check if can delete - BbrPointErr entrancePositionErr() const; - //HepPoint exitPosition() const; - BbrPointErr exitPositionErr() const; - CLHEP::Hep3Vector momentum() const; - BbrVectorErr momentumErr() const; - KalRepPtr const& trk() const{ return _trk; } - - void print( std::ostream& ost = std::cout, bool doEndl = true ) const; - - bool operator == (const TrkToCaloExtrapol & other) const ; - - bool operator<( const TrkToCaloExtrapol& other) const{ - return ( _pathLengthEntrance< other._pathLengthEntrance); - } - - }; - - inline std::ostream& operator<<( std::ostream& ost,TrkToCaloExtrapol const& t){ - t.print(ost,false); - return ost; - } - - typedef std::vector TrkToCaloExtrapolCollection; - -} // namespace mu2e - -#endif /* TrackCaloMatching_TrkToCaloExtrapol_hh */ diff --git a/RecoDataProducts/src/TrkToCaloExtrapol.cc b/RecoDataProducts/src/TrkToCaloExtrapol.cc deleted file mode 100644 index 77532ef29d..0000000000 --- a/RecoDataProducts/src/TrkToCaloExtrapol.cc +++ /dev/null @@ -1,189 +0,0 @@ -// -// -// Original author G. Pezzullo -// - -// C++ includes -#include - -// Mu2e includes -#include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" -#include "BTrk/BbrGeom/BbrPointErr.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" - - - -// #include "BTrk/BaBar/BaBar.hh" -#include "Offline/BTrkLegacy/inc/HelixParams.hh" -#include "Offline/BTrkLegacy/inc/HelixTraj.hh" - - -using namespace std; -using CLHEP::Hep3Vector; - -namespace mu2e { - - - - - bool TrkToCaloExtrapol::operator == (const TrkToCaloExtrapol & other) const{ - bool res = true; - res &= (_diskId == other._diskId); - res &= (_pathLengthEntrance == other._pathLengthEntrance); - res &= (_pathLengthExit == other._pathLengthExit); - res &= (_trk == other._trk); - return res; - } - int TrkToCaloExtrapol::diskId() const{ - return _diskId; - } - - double TrkToCaloExtrapol::time() const{ - // return (*_trk.get())->arrivalTime(_pathLengthEntrance); - return _trk->arrivalTime(_pathLengthEntrance); - } - - double TrkToCaloExtrapol::timeErr() const{//FIXME - return _trk->t0().t0Err(); - } - - double TrkToCaloExtrapol::pathLengthEntrance() const{ - return _pathLengthEntrance; - } - - double TrkToCaloExtrapol::t0() const{ - - // const KalRep* const kalrepc = *(_trk.get()); - - double _t0 = _trk->t0().t0(); - - return _t0; - } - - double TrkToCaloExtrapol::pathLenghtEntranceErr() const{ - - double errTanDip2 = _trk->helix(_pathLengthEntrance).covariance()(5,5); - double TanDip = _trk->helix(_pathLengthEntrance).tanDip(); - HelixTraj trkHel(_trk->helix(_pathLengthEntrance).params (), - _trk->helix(_pathLengthEntrance).covariance()); - - // double z0 = trkHel.z0(); - // , z = _pathLengthEntrance*trkHel.sinDip() + z0; - // std::cout<<"z0 = "<< z0<< - // ", z_pathLenght = "<< z< fltlen = "<momentum(_pathLengthEntrance); - } - - BbrVectorErr TrkToCaloExtrapol::entranceMomentumErr() const{ - // double fltlen = _trk->firstHit()->kalHit()->hit()->fltLen(); - - return _trk->momentumErr(_pathLengthEntrance); - } - - double TrkToCaloExtrapol::pathLengthExit() const{ - return _pathLengthExit; - } - - double TrkToCaloExtrapol::fitConsistency() const{ - return _trk->chisqConsistency().consistency(); - } - /* - HepPoint TrkToCaloExtrapol::entrancePosition() const{ - return _trk->position(_pathLengthEntrance); - } - */ - BbrPointErr TrkToCaloExtrapol::entrancePositionErr() const{ - return _trk->positionErr(_pathLengthEntrance); - } - /* - HepPoint TrkToCaloExtrapol::exitPosition() const{ - return _trk->position(_pathLengthExit); - } - */ - - BbrPointErr TrkToCaloExtrapol::exitPositionErr() const{ - return _trk->positionErr(_pathLengthExit); - } - - Hep3Vector TrkToCaloExtrapol::momentum() const{ - return _trk->momentum(_pathLengthEntrance); - } - - BbrVectorErr TrkToCaloExtrapol::momentumErr() const{ - return _trk->momentumErr(_pathLengthEntrance); - } - - - // Print the information found in this hit. - void TrkToCaloExtrapol::print( ostream& ost, bool doEndl ) const { - - ost << "TrkToCaloExtrapol : " - << " section: " << _diskId - << " time: " << TrkToCaloExtrapol::time(); - - - if ( doEndl ){ - ost << endl; - } - - } - -} // namespace mu2e diff --git a/RecoDataProducts/src/classes.h b/RecoDataProducts/src/classes.h index 8a27f0be7d..e1c8d7204f 100644 --- a/RecoDataProducts/src/classes.h +++ b/RecoDataProducts/src/classes.h @@ -67,7 +67,6 @@ #include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" #include "Offline/RecoDataProducts/inc/TrkCaloMatch.hh" #include "Offline/RecoDataProducts/inc/PIDProduct.hh" -#include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" #include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" // CRV diff --git a/RecoDataProducts/src/classes_def.xml b/RecoDataProducts/src/classes_def.xml index 7533a92f84..6ffd658f57 100644 --- a/RecoDataProducts/src/classes_def.xml +++ b/RecoDataProducts/src/classes_def.xml @@ -337,12 +337,6 @@ - - - - - - diff --git a/TrackCaloMatching/src/TrackCaloMatching_module.cc b/TrackCaloMatching/src/TrackCaloMatching_module.cc deleted file mode 100644 index 95ed6e84d3..0000000000 --- a/TrackCaloMatching/src/TrackCaloMatching_module.cc +++ /dev/null @@ -1,523 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Original author G. Pezzullo -// -// 2014-06-03 P.Murat: will no longer work with the vanes-based geometry -// 2015-09-17 P.Murat: use Bertran's extrapolator -/////////////////////////////////////////////////////////////////////////////// - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" - -// conditions -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" - -#include "BTrk/TrkBase/HelixParams.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -//root includes -#include "TFile.h" -#include "TDirectory.h" -#include "TMath.h" -#include "TVector2.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" -#include "BTrk/BaBar/Constants.hh" - - -using namespace std; -using cet::square; -using cet::sum_of_squares; -using CLHEP::Hep3Vector; - -namespace mu2e { - - class TrackCaloMatching : public art::EDProducer { - private: - - art::ProductToken const _fitterToken; - art::ProductToken const _caloClusterToken; - art::ProductToken const _trkToCaloExtrapolToken; - - int _debugLevel; - - double _minClusterEnergy; // - double _maxDeltaT; // time preselection for track-cluster matching - double _meanInteractionDepth; // path length correction - double _dtOffset; // shift of the Delta(T) distribution - - // resolutions used to calculate chi2's - double _sigmaE; - double _sigmaT; - double _sigmaU; - double _sigmaV; - - double _chi2e, _chi2t, _chi2u, _chi2v; - - // no offset in Y ? - double _solenoidOffSetX; - double _solenoidOffSetZ; - - bool _skipEvent; - bool _firstEvent; - - public: - - explicit TrackCaloMatching(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _fitterToken {consumes (pset.get ("fitterModuleLabel" ))}, - _caloClusterToken {consumes (pset.get("caloClusterModuleLabel" ))}, - _trkToCaloExtrapolToken{consumes(pset.get("trkToCaloExtrapolModuleLabel"))}, - - _debugLevel (pset.get ("debugLevel" )), - _minClusterEnergy (pset.get("minClusterEnergy" )), - _maxDeltaT (pset.get("maxDeltaT" )), - _meanInteractionDepth (pset.get("meanInteractionDepth")), - _dtOffset (pset.get("dtOffset" )), - _sigmaE (pset.get("sigmaE" )), - _sigmaT (pset.get("sigmaT" )), - _sigmaU (pset.get("sigmaU" )), - _sigmaV (pset.get("sigmaV" )), - _firstEvent (true) - { -//----------------------------------------------------------------------------- -// Tell the framework what we make. -//----------------------------------------------------------------------------- - produces(); - } - - void beginJob() override; - void beginRun(art::Run& aRun) override; - void produce (art::Event& e) override; - - void fromTrkToMu2eFrame(HepPoint& vec, CLHEP::Hep3Vector& res); - - void doMatching(art::Event & evt, bool skip); - }; - - - //----------------------------------------------------------------------------- - void TrackCaloMatching::fromTrkToMu2eFrame(HepPoint& vec, Hep3Vector& res) { - res.setX(vec.x() - _solenoidOffSetX); - res.setZ(vec.z() - _solenoidOffSetZ); - res.setY(vec.y()); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::beginJob() { - - if (_debugLevel > 0) { - printf("---- TrackCaloMatching::beginJob constants used: \n" ); - printf(" minClusterEnergy : %10.3f\n",_minClusterEnergy ); - printf(" maxDeltaT : %10.3f\n",_maxDeltaT ); - printf(" meanInteractionDepth : %10.3f\n",_meanInteractionDepth); - printf(" dtOffset : %10.3f\n",_dtOffset ); - } - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::beginRun(art::Run& aRun) { - art::ServiceHandle geom; - - // calculate DS offsets - - _solenoidOffSetX = geom->config().getDouble("mu2e.solenoidOffset"); - _solenoidOffSetZ = -geom->config().getDouble("mu2e.detectorSystemZ0"); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::produce(art::Event & evt) { - doMatching(evt, _skipEvent); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::doMatching(art::Event & evt, bool skip) { - constexpr const char* oname = "TrackCaloMatching::doMatching"; - - double cl_x, cl_y, cl_time, cl_energy; - double trk_x, trk_y, trk_mom, trk_time; - double s1, s2, sint, ds; - double nx, ny, dx, dy, du, dv, dt, xu, xv, xt, xe; - double chi2; - constexpr double chi2_max(1.e12); - - int idisk, iex, icl, ltrk; - constexpr int ndisks(2); - - TrackClusterMatch::Data_t tcm_data[100][ndisks]; - - const TrkCaloIntersect *extrk; - const KalRep *krep; - const CaloCluster *cl; - // cp_mu2e: cluster position in the MU2E frame - - CLHEP::Hep3Vector tp_disk, tp_mu2e, cp_mu2e, cp_st; - CLHEP::Hep3Vector mom, pos; - HepPoint point, p1, p2, p12, p_closest; - - const KalRep *kkrep[100]; - int nkkrep(0); - //----------------------------------------------------------------------------- - // Get handle to calorimeter - //----------------------------------------------------------------------------- - art::ServiceHandle geom; - GeomHandle cg; - - auto const& trjExtrapols = evt.getValidHandle(_trkToCaloExtrapolToken); - int const nex = trjExtrapols->size(); - - auto const& trksHandle = evt.getValidHandle(_fitterToken); - const KalRepPtrCollection* trks = trksHandle.product(); - int const ntracks = trks->size(); - - auto const& caloClusters = evt.getValidHandle(_caloClusterToken); - int const nclusters = caloClusters->size(); - - if (_debugLevel > 2) { - printf("%s: Event Number : %8i ntracks: %2i nclusters: %4i nex: %2i\n", - oname,evt.event(), ntracks, nclusters, nex); - } - - unique_ptr tcmcoll(new TrackClusterMatchCollection); - tcmcoll->reserve(nex); - //----------------------------------------------------------------------------- - // here the execution really starts - //----------------------------------------------------------------------------- - if (ntracks == 0) goto END; - - for (int it=0; it 2) { - printf("%s: jex = %5i\n", oname, jex); - } - - extrk = &trjExtrapols->at(jex); - krep = extrk->trk().get(); - //----------------------------------------------------------------------------- - // track index, important: store one, the best, intersection per track per vane - // the absolute ltrk number doesn't really matter - //----------------------------------------------------------------------------- - ltrk = nkkrep; - for (int ik=0; ik 100) { - printf(">>> ERROR in %s: ltrk = %i, skip the rest\n",oname,ltrk); - goto NEXT_INTERSECTION; - } - else if (ltrk < 0) { - printf(">>> ERROR in %s: ltrk = %i, skip the rest\n",oname,ltrk); - goto NEXT_INTERSECTION; - } - //----------------------------------------------------------------------------- - // apparently, ntupling stuff was mixed in, almost removed - //----------------------------------------------------------------------------- - idisk = extrk->diskId(); - // assume Z(middle of the disk) - - s1 = extrk->pathLengthEntrance(); - s2 = extrk->pathLengthExit (); - ds = s2-s1; - // 'sint' - extrapolation length to the interaction point - - if (ds > _meanInteractionDepth) sint = s1+_meanInteractionDepth; - else sint = s2; - - // shower starts developing when the particle - // reaches the disk - trk_time = krep->arrivalTime(sint); - mom = krep->momentum(sint); - - point = krep->position(sint); - mom = krep->momentum(sint); - trk_mom = mom.mag(); - - if (_debugLevel > 2) { - printf("%s: idisk: %5i trk_mom: %10.5f [MeV/c]\n",oname,idisk,trk_mom); - } - // track direction cosines in XY plane - - nx = mom.x()/sqrt(mom.x()*mom.x()+mom.y()*mom.y()); - ny = mom.y()/sqrt(mom.x()*mom.x()+mom.y()*mom.y()); - - // transform track position to Mu2e detector frame - - fromTrkToMu2eFrame(point, tp_mu2e); - - if (_debugLevel > 2){ - } - - tp_disk = cg->geomUtil().mu2eToDisk(idisk,tp_mu2e); - trk_x = tp_disk.x(); - trk_y = tp_disk.y(); - - if(_debugLevel > 2){ - printf("%s: tp_mu2e: %10.4f %10.4f %10.4f tp_disk: %10.4f %10.4f %10.4f\n", - oname, - tp_mu2e.x(),tp_mu2e.y(),tp_mu2e.z(), - tp_disk.x(),tp_disk.y(),tp_disk.z()); - } - //----------------------------------------------------------------------------- - // save track-only information - //----------------------------------------------------------------------------- - tcm_data[ltrk][idisk].xtrk = tp_disk.x(); - tcm_data[ltrk][idisk].ytrk = tp_disk.y(); - tcm_data[ltrk][idisk].ztrk = tp_disk.z(); - tcm_data[ltrk][idisk].ttrk = trk_time; - tcm_data[ltrk][idisk].nx = mom.x()/trk_mom; - tcm_data[ltrk][idisk].ny = mom.y()/trk_mom; - tcm_data[ltrk][idisk].nz = mom.z()/trk_mom; - tcm_data[ltrk][idisk].int_depth = _meanInteractionDepth; - tcm_data[ltrk][idisk].ds = ds; - - //----------------------------------------------------------------------------- - // track helix at Z = Z(middle of the disk) in the tracker frame - //----------------------------------------------------------------------------- - double trk_d0, trk_om, trk_r, trk_phi0, trk_phi1, trk_x0, trk_y0, trk_tandip; - double cp_dx, cp_dy, cp_phi, cp_dphi, delta_x, delta_y, s12, s_cl; - double dds, dz, dr, sint; - - - p1 = krep->position(s1); - p2 = krep->position(s2); - - s12 = (s1+s2)/2; - - p12 = krep->position(s12); - - trk_d0 = krep->helix(s12).d0(); - trk_om = krep->helix(s12).omega(); - trk_r = fabs(1./trk_om); - trk_phi0 = krep->helix(s12).phi0(); - trk_tandip = krep->helix(s12).tanDip(); - trk_x0 = -(1/trk_om+trk_d0)*sin(trk_phi0); - trk_y0 = (1/trk_om+trk_d0)*cos(trk_phi0); - trk_phi1 = atan2(p12.y()-trk_y0,p12.x()-trk_x0); - //----------------------------------------------------------------------------- - // loop over clusters - //----------------------------------------------------------------------------- - for (int icl=0; icltime(); - // move peak to zero - dt = trk_time-cl_time-_dtOffset; - - if (cl->diskID() != idisk ) goto NEXT_CLUSTER; - if (cl->energyDep() < _minClusterEnergy) goto NEXT_CLUSTER; - if (std::fabs(dt) > _maxDeltaT ) goto NEXT_CLUSTER; - //------------------------------------------------------------------------------ - // 2015-03-26: as of now, the cluster coordinates are defined in the local disk - // coordinate system - //----------------------------------------------------------------------------- - cl_x = cl->cog3Vector().x(); - cl_y = cl->cog3Vector().y(); - cl_energy = cl->energyDep(); - //----------------------------------------------------------------------------- - // X and Y - coordinates in the disk system - // rotate them in the direction perpendicular to the track - //----------------------------------------------------------------------------- - dx = trk_x-cl_x; - dy = trk_y-cl_y; - - du = dx*nx+dy*ny; - dv = dx*ny-dy*nx; - //----------------------------------------------------------------------------- - // to study pattern recognition accuracies, calculate track parameters in the - // point closest to the cluster in 2D (XY) - want to understand coordinate and - // angle resolutions - //----------------------------------------------------------------------------- - cp_mu2e = cg->geomUtil().diskToMu2e(idisk,cl->cog3Vector()); - cp_st = cg->geomUtil().mu2eToTracker(cp_mu2e); - - cp_dx = cp_st.x()-trk_x0; - cp_dy = cp_st.y()-trk_y0; - // cluster phi wrt helix center - cp_phi = atan2(cp_dy,cp_dx); - cp_dphi = TVector2::Phi_mpi_pi(cp_phi-trk_phi1); - - // radial distance - - dr = sqrt(cp_dx*cp_dx+cp_dy*cp_dy)-trk_r; - delta_x = dr*cos(cp_dphi); - delta_y = dr*sin(cp_dphi); - // last: track Z in the closest point - - dds = cp_dphi*trk_r*sqrt(1+trk_tandip*trk_tandip); - if (trk_om < 0) dds = -dds; - - s_cl = s12+dds; - - p_closest = krep->position(s_cl); - dz = p_closest.z()-cp_st.z(); - sint = s_cl-s1; - - if (_debugLevel > 2) { - printf("%s: s1 : %9.3f p1 : %9.3f %9.3f %9.3f\n",oname,s1, p1.x(),p1.y(),p1.z()); - printf("%s: s2 : %9.3f p2 : %9.3f %9.3f %9.3f\n",oname,s2, p2.x(),p2.y(),p2.z()); - printf("%s: s12 : %9.3f p12 : %9.3f %9.3f %9.3f\n",oname,s12,p12.x(),p12.y(),p12.z()); - printf("%s: mom : %9.3f %9.3f %9.3f tandip: %9.3f\n",oname,mom.x(),mom.y(),mom.z(),trk_tandip); - printf("%s: dds : %9.3f\n",oname,dds); - printf("%s: s_cl : %9.3f\n",oname,s_cl); - printf("%s: p_cl : %9.3f %9.3f %9.3f\n",oname,p_closest.x(),p_closest.y(),p_closest.z()); - - printf("%s: ",oname); - printf("trk_x0 : %9.3f ",trk_x0); - printf("trk_y0 : %9.3f ",trk_y0); - printf("trk_ph0: %9.3f ",trk_phi0); - printf("trk_ph1: %9.3f ",trk_phi1); - printf("trk_r : %9.3f ",trk_r ); - printf("\n"); - - printf("%s: ",oname); - printf("cl_x : %9.3f ",cl_x ); - printf("cl_y : %9.3f ",cl_y ); - printf("cp_phi : %9.3f ",cp_phi); - printf("cp_dphi: %9.3f ",cp_dphi); - printf("\n"); - - printf("%s: ",oname); - printf("delta_x: %9.3f ",delta_x); - printf("delta_y: %9.3f ",delta_y); - printf("dr : %9.3f ",dr ); - printf("dz : %9.3f ",dz ); - printf("sint : %9.3f ",sint ); - printf("\n"); - } - //----------------------------------------------------------------------------- - // 2014-05-14 P.Murat: use 10 MeV as the matching resolution, - // for a 10 MeV cluster the energy term in the chi2 would be (90/10)^2 - // also set coordinate resolution to 5cm , need to try using dx only - //----------------------------------------------------------------------------- - xu = du/_sigmaU; - xv = dv/_sigmaV; - xt = dt /_sigmaT; - xe = (trk_mom-cl_energy)/_sigmaE; - - _chi2u = xu*xu; - _chi2v = xv*xv; - _chi2t = xt*xt; - _chi2e = xe*xe; - - chi2 = _chi2u + _chi2v; - - if (_debugLevel > 2){ - printf("%s: ",oname); - printf("trk_x : %9.3f " ,trk_x ); - printf("cl_x : %9.3f " ,cl_x ); - printf("trk_y : %9.3f " ,trk_y ); - printf("cl_y : %9.3f " ,cl_y ); - printf("cl_time: %9.3f " ,cl_time); - printf("\n"); - printf("%s: ",oname); - printf("du : %9.3f " ,du ); - printf("dv : %9.3f " ,dv ); - printf("xu : %9.3f " ,xu ); - printf("xv : %9.3f " ,xv ); - printf("chi2 : %9.3f " ,chi2 ); - printf("\n"); - } - - if (chi2 < tcm_data[ltrk][idisk].chi2) { - //----------------------------------------------------------------------------- - // new best match - //----------------------------------------------------------------------------- - tcm_data[ltrk][idisk].icl = icl; - tcm_data[ltrk][idisk].iex = jex; - tcm_data[ltrk][idisk].dx = dx; - tcm_data[ltrk][idisk].dy = dy; - tcm_data[ltrk][idisk].dz = -1e6; - tcm_data[ltrk][idisk].du = du; - tcm_data[ltrk][idisk].dv = dv; - tcm_data[ltrk][idisk].dt = dt; - tcm_data[ltrk][idisk].ep = cl_energy/trk_mom; - tcm_data[ltrk][idisk].chi2 = chi2; - tcm_data[ltrk][idisk].chi2_time = _chi2t; - tcm_data[ltrk][idisk].dr = dr; - tcm_data[ltrk][idisk].sint = sint; - } - NEXT_CLUSTER:; - } - NEXT_INTERSECTION:; - } - - //----------------------------------------------------------------------------- - // form output list of matches - //----------------------------------------------------------------------------- - for (int it=0; it artPtrTex (trjExtrapols,iex); - art::Ptr artPtrCluster(caloClusters,icl); - TrackClusterMatch tcm(artPtrTex,artPtrCluster,&tcm_data[it][iv]); - tcmcoll->push_back(tcm); - } - } - } - - END:; - - evt.put(std::move(tcmcoll)); - //----------------------------------------------------------------------------- - // diagnostics printout - //----------------------------------------------------------------------------- - if (_debugLevel > 0) { - if (evt.id().event() %100 == 0) printf("Event %d TrackCaloMatching done.\n",evt.id().event()); - } - } - -} - -DEFINE_ART_MODULE(mu2e::TrackCaloMatching) diff --git a/TrackCaloMatching/src/TrkExtrapol_module.cc b/TrackCaloMatching/src/TrkExtrapol_module.cc deleted file mode 100644 index 13f4c96535..0000000000 --- a/TrackCaloMatching/src/TrkExtrapol_module.cc +++ /dev/null @@ -1,582 +0,0 @@ -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" - -//calorimeter includes -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" - -//root includes -#include "TFile.h" -#include "TDirectory.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TApplication.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace mu2e { - - struct IntersectData_t { - int fSection; - int fRC; // return code, 0=success, <0: failure, details TBD - double fSEntr; - double fSExit; - }; - - class TrkExtrapol : public art::EDProducer { - public: - - explicit TrkExtrapol(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _fitterModuleLabel(pset.get("fitterModuleLabel")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _diagLevel(pset.get("diagLevel",0)), - _outPutNtup(pset.get("outPutNtup",0)), - _generatorModuleLabel(pset.get("generatorModuleLabel", - "generate")), - _g4ModuleLabel(pset.get("g4ModuleLabel", "g4run")), - _caloReadoutModuleLabel(pset.get("caloReadoutModuleLabel", - "CaloReadoutHitsMaker")), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel", - "CaloHitsMaker")), - _directory(0), - _firstEvent(true), - _trkdiag(0){ - // Tell the framework what we make. - produces(); - - // construct the data product instance name - _fitDir = _fdir.fitDirection(); - - } - - virtual ~TrkExtrapol() {} - - void beginJob(); - void endJob() {} - - void produce(art::Event & e ); - - void caloExtrapol(int& diagLevel, - int evtNumber, - TrkFitDirection fdir, - KalRep* Krep, - double& lowrange, - double& highrange, - HelixTraj &trkHel, - int &res0, - int& NIntersections, - IntersectData_t* Intersections); - - double ZfrontFaceCalo() const{ return _ZfrontFaceCalo;} - - double ZbackFaceCalo() const{ return _ZbackFaceCalo;} - - private: - - void doExtrapolation(art::Event & evt, bool skip); - // Module label of the module that performed the fits. - std::string _fitterModuleLabel; - - TrkParticle _tpart; - - TrkFitDirection _fdir; - - TrkFitDirection::FitDirection _fitDir; - - // diagnostic of Kalman fit - - // Diagnostic level - int _diagLevel; - int _outPutNtup; - - // Label of the generator. - std::string _generatorModuleLabel; - - // Label of the G4 module - std::string _g4ModuleLabel; - - // Label of the calo readout hits maker - std::string _caloReadoutModuleLabel; - - // Label of the calo crystal hists maker - std::string _caloCrystalModuleLabel; - - bool _skipEvent; - - // Save directory from beginJob so that we can go there in endJob. See note 3. - TDirectory* _directory; - bool _firstEvent; - - TTree* _trkdiag; - - Int_t _trkid - ,_trkint; - Float_t _trksection[1000] - , _trkpath[1000] - , _trktof[1000] - , _trkx[1000] - , _trky[1000] - , _trkz[1000] - , _trkmomx[1000] - , _trkmomy[1000] - , _trkmomz[1000] - , _trkmom[1000]; - - double _solenoidOffSetX; - double _solenoidOffSetZ; - double _ZfrontFaceCalo; - double _ZbackFaceCalo; - - CLHEP::Hep3Vector fromTrkToMu2eFrame(CLHEP::Hep3Vector &vec); - - void filltrkdiag(int itrk, IntersectData_t *intersec, - int size, KalRep const* kalrep); - - }; - - CLHEP::Hep3Vector TrkExtrapol::fromTrkToMu2eFrame(CLHEP::Hep3Vector &vec){ - art::ServiceHandle geom; - double solenoidOffSetX = geom->config().getDouble("mu2e.solenoidOffset"); - double solenoidOffSetZ = -geom->config().getDouble("mu2e.detectorSystemZ0"); - CLHEP::Hep3Vector res; - - res.setX(vec.x() - solenoidOffSetX); - res.setZ(vec.z() - solenoidOffSetZ); - res.setY(vec.y()); - return res; - } - - void TrkExtrapol::caloExtrapol(int& diagLevel, - int evtNumber, - TrkFitDirection fdir, - KalRep* Krep, - double& lowrange, - double& highrange, - HelixTraj &trkHel, - int &res0, - int& NIntersections, - IntersectData_t* Intersection ) { - art::ServiceHandle geom; - GeomHandle cg; - static const char* oname = "TrkExtrapol::caloExtrapol"; - - if(diagLevel>2){ - - cout<<"start caloExtrapol, lowrange = "<traj().position(lowrange)<traj().position(highrange)<2){ - cout<<", after extention..."<< - ", lowrange = "<traj().position(lowrange)<traj().position(highrange)< 100, TRUNCATE LIST\n",oname); - } - } - } - if(fdir.dzdt() == 1.0){ - tmpRange += pathStepSize; - }else if(fdir.dzdt() == -1.0){ - tmpRange -= pathStepSize; - } - } - // } - - if (diagLevel>2) { - cout<<"end search behindSection(), position is : "<extendThrough(lrange); - if (trk_rc.success() != 1) { - //----------------------------------------------------------------------------- - // failed to extend - //----------------------------------------------------------------------------- - Intersection[i].fRC = -1; - if (diagLevel>2) { - printf("%s ERROR vane = %2i FAILED to EXTEND TRAJECTORY, rc = %i\n", - oname,Intersection[i].fSection,trk_rc.success()); - } - } - - } - - delete [] isInside ; - delete [] entr ; - delete [] ex; - - }//end proce_dUre - - void TrkExtrapol::beginJob() { - - if (_outPutNtup == 1) { - art::ServiceHandle tfs; - _trkdiag = tfs->make("trk", "trk extrapolated info"); - _trkdiag->Branch("trkid", &_trkid ,"trkid/I"); - _trkdiag->Branch("trkint", &_trkint ,"trkint/I"); - _trkdiag->Branch("trksection[trkint]", _trksection, "trksection[trkint]/F"); - _trkdiag->Branch("trkpath[trkint]", _trkpath, "trkpath[trkint]/F"); - _trkdiag->Branch("trktof[trkint]", _trktof, "trktof[trkint]/F"); - _trkdiag->Branch("trkx[trkint]", _trkx, "trkx[trkint]/F"); - _trkdiag->Branch("trky[trkint]", _trky, "trky[trkint]/F"); - _trkdiag->Branch("trkz[trkint]", _trkz, "trkz[trkint]/F"); - _trkdiag->Branch("trkmomx[trkint]", _trkmomx, "trkmomx[trkint]/F"); - _trkdiag->Branch("trkmomy[trkint]", _trkmomy, "trkmomy[trkint]/F"); - _trkdiag->Branch("trkmomz[trkint]", _trkmomz, "trkmomz[trkint]/F"); - _trkdiag->Branch("trkmom[trkint]", _trkmom, "trkmom[trkint]/F"); - } - - } - - void TrkExtrapol::filltrkdiag(int itrk, IntersectData_t *intersec, int size, KalRep const* kalrep){ - _trkid = itrk; - double lenght(0.0); - _trkint = size; - TrkDifTraj const &traj = kalrep->traj(); - for(int i=0; iarrivalTime(lenght); - _trkx[i] = traj.position(lenght).x(); - _trky[i] = traj.position(lenght).y(); - _trkz[i] = traj.position(lenght).z(); - _trkmomx[i] = kalrep->momentum(lenght).x(); - _trkmomy[i] = kalrep->momentum(lenght).y(); - _trkmomz[i] = kalrep->momentum(lenght).z(); - _trkmom[i] = kalrep->momentum(lenght).mag(); - - } - _trkdiag->Fill(); - } - -//----------------------------------------------------------------------------- - void TrkExtrapol::produce(art::Event & evt ) { - - doExtrapolation(evt, _skipEvent); - } - -//----------------------------------------------------------------------------- - void TrkExtrapol::doExtrapolation(art::Event & evt, bool skip){ - - art::ServiceHandle geom; - GeomHandle cg; - _solenoidOffSetX = geom->config().getDouble("mu2e.solenoidOffset");//3904.;//[mm] - _solenoidOffSetZ = -geom->config().getDouble("mu2e.detectorSystemZ0");//-10200.; - - _ZfrontFaceCalo = cg->geomUtil().origin().z() + _solenoidOffSetZ; - _ZbackFaceCalo = cg->geomUtil().origin().z() + _solenoidOffSetZ; - - const char* oname = "TrkExtrapol::doExtrapolation"; - double lowrange, highrange, zmin, zmax; - HepPoint point; - int ntrk, res0; - - //create output - unique_ptr extrapolatedTracks(new TrkToCaloExtrapolCollection ); - TrkToCaloExtrapolCollection tmpExtrapolatedTracks; - - art::Handle trksHandle; - evt.getByLabel(_fitterModuleLabel,trksHandle); - const KalRepPtrCollection* trks = trksHandle.product(); - - ntrk = trks->size(); - - if(_diagLevel>2){ - cout<traj().position(lowrange); - printf("point of trj at lowrange(%10.3f) : ( %10.3f, %10.3f, %10.3f )\n", - lowrange, - point.x(), point.y(), point.z()); - - point = krep->traj().position(highrange); - printf("point of trj at highrange(%10.3f) : ( %10.3f, %10.3f, %10.3f )\n", - highrange, - point.x(), point.y(), point.z()); - } - - if(_outPutNtup ==1){ - filltrkdiag(int(itrk), intersection, nint, krep); - } - - for (int i=0; iat(itrk); - tmpExtrapolatedTracks.push_back( - TrkToCaloExtrapol(intersection[i].fSection, - itrk, - tmpRecTrk, - intersection[i].fSEntr, - intersection[i].fSExit) - ); - } - - // P.Murat: why would one need to sort at this point? - - // std::sort(tmpExtrapolatedTracks.begin(), tmpExtrapolatedTracks.end()); - for(TrkToCaloExtrapolCollection::iterator it = tmpExtrapolatedTracks.begin(); it != tmpExtrapolatedTracks.end(); ++it){ - extrapolatedTracks->push_back(*it); - } - - }//end loop on recoTrj - - evt.put(std::move(extrapolatedTracks)); - if( evt.id().event() %100 ==0){ - printf("\nEvent %d %s done...\n",evt.id().event(),oname ); - } - } - -} - -using mu2e::TrkExtrapol; -DEFINE_ART_MODULE(TrkExtrapol) diff --git a/TrkReco/src/TrkUtilities.cc b/TrkReco/src/TrkUtilities.cc index da234d3111..f0255ebcd4 100644 --- a/TrkReco/src/TrkUtilities.cc +++ b/TrkReco/src/TrkUtilities.cc @@ -192,7 +192,7 @@ namespace mu2e { } return over/norm; } - + double overlap(TimeCluster const& tc1, TimeCluster const& tc2) { double hover = overlap(tc1._strawHitIdxs,tc2._strawHitIdxs); double norm = std::min(tc1.hits().size(),tc2.hits().size()); @@ -205,150 +205,6 @@ namespace mu2e { } return over/norm; } - /* - double overlap(KalSeed const& ks1, KalSeed const& ks2) { - // translate hit info into a simple index array. Only count active hits - SHIV shiv1, shiv2; - for(auto tshs : ks1.hits()){ - if(tshs.flag().hasAllProperties(StrawHitFlag::active)) - shiv1.push_back(tshs.index()); - } - for(auto tshs : ks2.hits()){ - if(tshs.flag().hasAllProperties(StrawHitFlag::active)) - shiv2.push_back(tshs.index()); - } - double hover = overlap(shiv1,shiv2); - double norm = std::min(shiv1.size(),shiv2.size()); - double over = norm*hover; - // add in CaloCluster; count is as much as all the hits - if(ks1.caloCluster().isNonnull() && ks2.caloCluster().isNonnull()) { - if(ks1.caloCluster() == ks2.caloCluster()) - over += norm; - norm *= 2; - } - return over/norm; - } - - double overlap(KalSeed const& ks, HelixSeed const& hs){ - SHIV shiv1, shiv2; - for(auto tshs : ks.hits()){ - if(tshs.flag().hasAllProperties(StrawHitFlag::active)) - shiv1.push_back(tshs.index()); - } - for(auto hh : hs.hits()){ - // exclude outliers - if(!hh.flag().hasAnyProperty(StrawHitFlag::outlier)) - shiv2.push_back(hh.index()); - } - double hover = overlap(shiv1,shiv2); - double norm = std::min(shiv1.size(),shiv2.size()); - double over = norm*hover; - // add in CaloCluster; count is as much as all the hits - if(ks.caloCluster().isNonnull() && hs.caloCluster().isNonnull()) { - if(ks.caloCluster() == hs.caloCluster()) - over += norm; - norm *= 2; - } - return over/norm; - } - - double overlap(HelixSeed const& hs,TimeCluster const& tc) { - SHIV shiv; - for(auto hh : hs.hits()){ - // exclude outliers - if(!hh.flag().hasAnyProperty(StrawHitFlag::outlier)) - shiv.push_back(hh.index()); - } - double hover = overlap(shiv,tc.hits()); - double norm = std::min(shiv.size(),tc.hits().size()); - double over = norm*hover; - // add in CaloCluster; count is as much as all the hits - if(tc.caloCluster().isNonnull() && hs.caloCluster().isNonnull()) { - if(tc.caloCluster() == hs.caloCluster()) - over += norm; - norm *= 2; - } - return over/norm; - } - - // this function belongs in TrkDifTraj, FIXME!!!! - // double zFlight(TrkDifPieceTraj const& ptraj, double pz) { - // // get the helix at the middle of the track - // double loclen; - // double fltlen(0.0); - // const HelixTraj* htraj = dynamic_cast(ptraj.localTrajectory(fltlen,loclen)); - // // Iterate - // const HelixTraj* oldtraj; - // unsigned iter(0); - // do { - // // remember old traj - // oldtraj = htraj; - // // correct the global fltlen for this difference in local trajectory fltlen at this Z position - // fltlen += (htraj->zFlight(pz)-loclen); - // htraj = dynamic_cast(ptraj.localTrajectory(fltlen,loclen)); - // } while(oldtraj != htraj && iter++<10); - // return fltlen; - // } - - void countHits(const std::vector& hits, unsigned& nhits, unsigned& nactive, unsigned& ndouble, unsigned& ndactive, unsigned& nnullambig) { - nhits = 0; nactive = 0; ndouble = 0; ndactive = 0; nnullambig = 0; - static StrawHitFlag active(StrawHitFlag::active); - for (std::vector::const_iterator ihit = hits.begin(); ihit != hits.end(); ++ihit) { - ++nhits; - if (ihit->flag().hasAllProperties(active)) { - ++nactive; - if (ihit->ambig()==0) { - ++nnullambig; - } - } - /* if (ihit->nStrawHits()>=2) { - // ++ndactive; - // } - - // std::cout << "AE: ihit->nStrawHits() = " << ihit->nStrawHits() << std::endl; - const auto& jhit = ihit+1; - const auto& hhit = ihit-1; - if( (jhit != hits.end() && - jhit->flag().hasAllProperties(active) && - jhit->strawId().getPlane() == ihit->strawId().getPlane() && - jhit->strawId().getPanel() == ihit->strawId().getPanel() ) || - (hhit >= hits.begin() && - hhit->flag().hasAllProperties(active) && - hhit->strawId().getPlane() == ihit->strawId().getPlane() && - hhit->strawId().getPanel() == ihit->strawId().getPanel() ) - ) { - ++ndouble; - if (ihit->flag().hasAllProperties(StrawHitFlag::active)) { - ++ndactive; - } - } - } - // std::cout << "AE: ndactive hits = " << ndactive << std::endl; - } - - double chisqConsistency(const KalRep* krep) { - return ChisqConsistency(krep->chisq(),krep->nDof()-1).significanceLevel(); - } - - unsigned countBends(const KalRep* krep) { - unsigned nbend(0); - for(auto isite : krep->siteList()){ - if(isite->kalBend() != 0) ++nbend; - } - return nbend; - } - - const TrkCaloHit* findTrkCaloHit(const KalRep* krep){ - const TrkCaloHit* tch(0); - for(auto ith=krep->hitVector().begin(); ith!=krep->hitVector().end(); ++ith){ - const TrkCaloHit* tsh = dynamic_cast(*ith); - if(tsh != 0) { - tch = tsh; - break; - } - } - return tch; - }*/ double energy(double mass, double momentum) { return sqrt(momentum*momentum + mass*mass); } double beta(double mass, double momentum) { return fabs(momentum)/energy(mass,momentum); } double betagamma(double mass, double momentum) { return fabs(momentum)/mass; } From 1302ff621386c405be4675991701e140b8ee88aa Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 30 Jan 2026 16:04:04 -0600 Subject: [PATCH 091/174] remove obsolete ConditionsService links --- Analyses/CMakeLists.txt | 16 ---------------- Analyses/src/ReadCaloDigi_module.cc | 1 - CRVResponse/CMakeLists.txt | 4 ---- CRVResponse/src/SConscript | 1 - CalPatRec/CMakeLists.txt | 8 -------- CalPatRec/src/SConscript | 2 -- CaloCluster/CMakeLists.txt | 1 - CaloCluster/src/SConscript | 4 +--- CaloDiag/CMakeLists.txt | 1 - CaloDiag/src/SConscript | 1 - CaloFilters/CMakeLists.txt | 3 --- CaloFilters/src/SConscript | 1 - CommonMC/CMakeLists.txt | 1 - CommonMC/src/SConscript | 1 - CommonReco/CMakeLists.txt | 1 - CommonReco/src/SConscript | 1 - Filters/CMakeLists.txt | 3 --- Filters/src/SConscript | 1 - TrackCaloMatching/CMakeLists.txt | 2 -- TrackCaloMatching/src/SConscript | 1 - TrackerConditions/src/SConscript | 1 - TrackerMC/CMakeLists.txt | 3 --- TrackerMC/src/SConscript | 2 -- Trigger/CMakeLists.txt | 1 - Trigger/src/SConscript | 1 - TrkDiag/CMakeLists.txt | 1 - TrkDiag/src/SConscript | 2 -- TrkFilters/src/SConscript | 1 - TrkHitReco/CMakeLists.txt | 2 -- TrkHitReco/src/SConscript | 2 -- TrkPatRec/CMakeLists.txt | 1 - TrkPatRec/src/SConscript | 2 -- TrkReco/CMakeLists.txt | 2 -- TrkReco/src/SConscript | 2 -- 34 files changed, 1 insertion(+), 76 deletions(-) diff --git a/Analyses/CMakeLists.txt b/Analyses/CMakeLists.txt index 08ce9b2511..063a80dd67 100644 --- a/Analyses/CMakeLists.txt +++ b/Analyses/CMakeLists.txt @@ -16,7 +16,6 @@ cet_build_plugin(CaloCalibAna art::module Offline::CaloCluster Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::GlobalConstantsService @@ -50,7 +49,6 @@ cet_build_plugin(CaloDigiAna art::module art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::GlobalConstantsService @@ -298,7 +296,6 @@ cet_build_plugin(Mu2eG4StudyCalo01ReadBack art::module REG_SOURCE src/Mu2eG4StudyCalo01ReadBack_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::GlobalConstantsService Offline::MCDataProducts @@ -308,7 +305,6 @@ cet_build_plugin(Mu2eG4StudyReadBack art::module REG_SOURCE src/Mu2eG4StudyReadBack_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::GlobalConstantsService Offline::MCDataProducts @@ -327,7 +323,6 @@ cet_build_plugin(PbarAnalysis2 art::module art_root_io::TFileService_service Offline::CaloCluster Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::GlobalConstantsService @@ -444,7 +439,6 @@ cet_build_plugin(ReadAntiProtonSteps art::module REG_SOURCE src/ReadAntiProtonSteps_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::GlobalConstantsService Offline::MCDataProducts @@ -479,7 +473,6 @@ cet_build_plugin(ReadCaloDigi art::module LIBRARIES REG art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::GlobalConstantsService @@ -499,7 +492,6 @@ cet_build_plugin(ReadPSVacuum art::module REG_SOURCE src/ReadPSVacuum_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts ) @@ -508,7 +500,6 @@ cet_build_plugin(ReadPTM art::module REG_SOURCE src/ReadPTM_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts ) @@ -542,7 +533,6 @@ cet_build_plugin(ReadTrackCaloMatching art::module REG_SOURCE src/ReadTrackCaloMatching_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::RecoDataProducts Offline::TrackerGeom @@ -563,7 +553,6 @@ cet_build_plugin(ReadTrackerSteps art::module REG_SOURCE src/ReadTrackerSteps_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts Offline::TrackerGeom @@ -573,7 +562,6 @@ cet_build_plugin(ReadTrkExtrapol art::module REG_SOURCE src/ReadTrkExtrapol_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::RecoDataProducts Offline::TrackerGeom @@ -583,7 +571,6 @@ cet_build_plugin(ReadTrkExtrapolMVA art::module REG_SOURCE src/ReadTrkExtrapolMVA_module.cc LIBRARIES REG art_root_io::TFileService_service - Offline::ConditionsService Offline::GeometryService Offline::RecoDataProducts Offline::TrackerGeom @@ -592,9 +579,6 @@ cet_build_plugin(ReadTrkExtrapolMVA art::module cet_build_plugin(ReadVirtualDetector art::module REG_SOURCE src/ReadVirtualDetector_module.cc LIBRARIES REG - - - Offline::ConditionsService Offline::GeometryService Offline::GlobalConstantsService Offline::MCDataProducts diff --git a/Analyses/src/ReadCaloDigi_module.cc b/Analyses/src/ReadCaloDigi_module.cc index 7a1e4d1530..519dd8fe9d 100644 --- a/Analyses/src/ReadCaloDigi_module.cc +++ b/Analyses/src/ReadCaloDigi_module.cc @@ -31,7 +31,6 @@ #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" #include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/DataProducts/inc/CaloSiPMId.hh" #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" diff --git a/CRVResponse/CMakeLists.txt b/CRVResponse/CMakeLists.txt index 3d33013d6c..a7ce7b1c07 100644 --- a/CRVResponse/CMakeLists.txt +++ b/CRVResponse/CMakeLists.txt @@ -18,7 +18,6 @@ cet_build_plugin(CrvCoincidenceClusterMatchMC art::module art_root_io::TFileService_service Offline::CRVResponse - Offline::ConditionsService Offline::CosmicRayShieldGeom Offline::DataProducts Offline::GeometryService @@ -46,7 +45,6 @@ cet_build_plugin(CrvPhotonGenerator art::module LIBRARIES REG Offline::CRVResponse - Offline::ConditionsService Offline::ConfigTools Offline::CosmicRayShieldGeom Offline::DAQConditions @@ -64,7 +62,6 @@ cet_build_plugin(CrvPlot art::module art_root_io::TFileService_service Offline::CRVResponse - Offline::ConditionsService Offline::CosmicRayShieldGeom Offline::CRVConditions Offline::DataProducts @@ -79,7 +76,6 @@ cet_build_plugin(CrvSiPMChargeGenerator art::module LIBRARIES REG Offline::CRVResponse - Offline::ConditionsService Offline::ConfigTools Offline::CosmicRayShieldGeom Offline::DAQConditions diff --git a/CRVResponse/src/SConscript b/CRVResponse/src/SConscript index 22eb33e6d5..5a1cf9466a 100644 --- a/CRVResponse/src/SConscript +++ b/CRVResponse/src/SConscript @@ -34,7 +34,6 @@ helper.make_plugins( [ mainlib, 'mu2e_SeedService', 'mu2e_Mu2eUtilities', 'mu2e_GeometryService', - 'mu2e_ConditionsService', 'mu2e_DAQConditions', 'mu2e_GlobalConstantsService', 'mu2e_MCDataProducts', diff --git a/CalPatRec/CMakeLists.txt b/CalPatRec/CMakeLists.txt index 4c6c0e1255..884d5edf19 100644 --- a/CalPatRec/CMakeLists.txt +++ b/CalPatRec/CMakeLists.txt @@ -17,7 +17,6 @@ cet_make_library( Offline::BFieldGeom Offline::BTrkData Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::MCDataProducts @@ -35,7 +34,6 @@ cet_build_plugin(AgnosticHelixFinder art::module Offline::BFieldGeom Offline::CalorimeterGeom - Offline::ConditionsService Offline::ConfigTools Offline::GeometryService Offline::Mu2eUtilities @@ -50,7 +48,6 @@ cet_build_plugin(CalHelixFinder art::module Offline::BFieldGeom Offline::CalorimeterGeom - Offline::ConditionsService Offline::ConfigTools Offline::GeometryService Offline::Mu2eUtilities @@ -64,7 +61,6 @@ cet_build_plugin(CalTimePeakFinder art::module Offline::CalPatRec Offline::CalorimeterGeom - Offline::ConditionsService Offline::ConfigTools Offline::GeometryService Offline::Mu2eUtilities @@ -78,7 +74,6 @@ cet_build_plugin(ComboHitFilter art::module Offline::CalPatRec Offline::CalorimeterGeom - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts Offline::Mu2eUtilities @@ -91,7 +86,6 @@ cet_build_plugin(DeltaFinderAna art::module LIBRARIES REG Offline::CalPatRec - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::MCDataProducts @@ -105,7 +99,6 @@ cet_build_plugin(DeltaFinder art::module Offline::CalPatRec Offline::CalorimeterGeom - Offline::ConditionsService Offline::GeometryService Offline::Mu2eUtilities Offline::RecoDataProducts @@ -143,7 +136,6 @@ cet_build_plugin(PrefetchData art::module LIBRARIES REG Offline::CalPatRec - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts Offline::Mu2eUtilities diff --git a/CalPatRec/src/SConscript b/CalPatRec/src/SConscript index 2951b5738f..7f54af89af 100644 --- a/CalPatRec/src/SConscript +++ b/CalPatRec/src/SConscript @@ -21,7 +21,6 @@ mainlib = helper.make_mainlib( [ 'mu2e_CalPatRec_dict', 'mu2e_BTrkData', 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', @@ -60,7 +59,6 @@ helper.make_plugins( [ mainlib, 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', diff --git a/CaloCluster/CMakeLists.txt b/CaloCluster/CMakeLists.txt index 3e7b635ff5..6a7c9d112b 100644 --- a/CaloCluster/CMakeLists.txt +++ b/CaloCluster/CMakeLists.txt @@ -48,7 +48,6 @@ cet_build_plugin(CaloTrigger art::module Offline::CaloCluster Offline::CalorimeterGeom - Offline::ConditionsService Offline::GeometryService Offline::RecoDataProducts ) diff --git a/CaloCluster/src/SConscript b/CaloCluster/src/SConscript index 88f70e9337..1e19df7b31 100644 --- a/CaloCluster/src/SConscript +++ b/CaloCluster/src/SConscript @@ -18,8 +18,7 @@ helper=mu2e_helper(env); rootlibs = env['ROOTLIBS'] -mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', - 'mu2e_GeometryService', +mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', 'mu2e_RecoDataProducts', 'mu2e_CalorimeterGeom', 'mu2e_GlobalConstantsService', @@ -46,7 +45,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', helper.make_plugins( [ mainlib, 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_GlobalConstantsService', 'mu2e_GeometryService', 'mu2e_SeedService', diff --git a/CaloDiag/CMakeLists.txt b/CaloDiag/CMakeLists.txt index af11183c55..eb10720682 100644 --- a/CaloDiag/CMakeLists.txt +++ b/CaloDiag/CMakeLists.txt @@ -15,7 +15,6 @@ cet_build_plugin(CaloExample art::module art_root_io::TFileService_service Offline::CaloCluster Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::MCDataProducts diff --git a/CaloDiag/src/SConscript b/CaloDiag/src/SConscript index 2dce910286..229e723e71 100644 --- a/CaloDiag/src/SConscript +++ b/CaloDiag/src/SConscript @@ -29,7 +29,6 @@ helper.make_plugins( [ mainlib, 'mu2e_ParticleID', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', 'mu2e_CosmicRayShieldGeom', diff --git a/CaloFilters/CMakeLists.txt b/CaloFilters/CMakeLists.txt index 60b8b5e1b0..c31a2b50dd 100644 --- a/CaloFilters/CMakeLists.txt +++ b/CaloFilters/CMakeLists.txt @@ -34,7 +34,6 @@ cet_build_plugin(EcalTriggerPreselect art::module LIBRARIES REG art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts Offline::RecoDataProducts @@ -45,7 +44,6 @@ cet_build_plugin(FilterEcalMixedTrigger art::module LIBRARIES REG art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::ConfigTools Offline::GeometryService Offline::RecoDataProducts @@ -56,7 +54,6 @@ cet_build_plugin(FilterEcalMVATrigger art::module LIBRARIES REG art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::ConfigTools Offline::GeometryService Offline::RecoDataProducts diff --git a/CaloFilters/src/SConscript b/CaloFilters/src/SConscript index 2780e77bb4..64e9b589d1 100644 --- a/CaloFilters/src/SConscript +++ b/CaloFilters/src/SConscript @@ -26,7 +26,6 @@ helper.make_plugins( [ mainlib, 'mu2e_CaloCluster', 'mu2e_ParticleID', 'mu2e_RecoDataProducts', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', diff --git a/CommonMC/CMakeLists.txt b/CommonMC/CMakeLists.txt index 974214a0a4..8b84369acb 100644 --- a/CommonMC/CMakeLists.txt +++ b/CommonMC/CMakeLists.txt @@ -76,7 +76,6 @@ cet_build_plugin(ProtonBunchTimeMCFromProtonBunchTime art::module cet_build_plugin(SelectRecoMC art::module REG_SOURCE src/SelectRecoMC_module.cc LIBRARIES REG - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::MCDataProducts diff --git a/CommonMC/src/SConscript b/CommonMC/src/SConscript index 618c7b105d..8f7e778b02 100644 --- a/CommonMC/src/SConscript +++ b/CommonMC/src/SConscript @@ -21,7 +21,6 @@ mainlib = helper.make_mainlib ( [] ) helper.make_plugins( [ mainlib, 'mu2e_TrkDiag', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_DAQConditions', 'mu2e_GeometryService', diff --git a/CommonReco/CMakeLists.txt b/CommonReco/CMakeLists.txt index 9f8eb486e2..b1bef69f1c 100644 --- a/CommonReco/CMakeLists.txt +++ b/CommonReco/CMakeLists.txt @@ -1,7 +1,6 @@ cet_build_plugin(SelectReco art::module REG_SOURCE src/SelectReco_module.cc LIBRARIES REG - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::ProditionsService diff --git a/CommonReco/src/SConscript b/CommonReco/src/SConscript index d1384ecd38..f53239694a 100644 --- a/CommonReco/src/SConscript +++ b/CommonReco/src/SConscript @@ -21,7 +21,6 @@ mainlib = helper.make_mainlib ( [] ) helper.make_plugins( [ mainlib, 'mu2e_Mu2eKinKal', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', diff --git a/Filters/CMakeLists.txt b/Filters/CMakeLists.txt index 6243f5aabb..8e20e78a99 100644 --- a/Filters/CMakeLists.txt +++ b/Filters/CMakeLists.txt @@ -35,7 +35,6 @@ cet_build_plugin(CompressPhysicalVolumes art::module cet_build_plugin(CompressStepPointMCs art::module REG_SOURCE src/CompressStepPointMCs_module.cc LIBRARIES REG - Offline::ConditionsService Offline::MCDataProducts Offline::Mu2eUtilities ) @@ -44,7 +43,6 @@ cet_build_plugin(CosmicMixingFilter art::module REG_SOURCE src/CosmicMixingFilter_module.cc LIBRARIES REG Offline::BFieldGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::GlobalConstantsService @@ -56,7 +54,6 @@ cet_build_plugin(CosmicMixingFilter art::module cet_build_plugin(DetectorStepFilter art::module REG_SOURCE src/DetectorStepFilter_module.cc LIBRARIES REG - Offline::ConditionsService Offline::DataProducts Offline::MCDataProducts ) diff --git a/Filters/src/SConscript b/Filters/src/SConscript index 07c891848c..89abe29a8c 100644 --- a/Filters/src/SConscript +++ b/Filters/src/SConscript @@ -33,7 +33,6 @@ helper.make_plugins( [ 'mu2e_DbService', 'mu2e_DbTables', 'mu2e_TrackerConditions', - 'mu2e_ConditionsService', babarlibs, 'art_Framework_Core', 'art_Framework_Principal', diff --git a/TrackCaloMatching/CMakeLists.txt b/TrackCaloMatching/CMakeLists.txt index f32f60fdd0..1a34098afd 100644 --- a/TrackCaloMatching/CMakeLists.txt +++ b/TrackCaloMatching/CMakeLists.txt @@ -30,7 +30,6 @@ cet_build_plugin(TrackCaloMatching art::module LIBRARIES REG art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::GeometryService Offline::RecoDataProducts ROOT::Physics @@ -50,7 +49,6 @@ cet_build_plugin(TrkExtrapol art::module LIBRARIES REG art_root_io::TFileService_service Offline::CalorimeterGeom - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts Offline::RecoDataProducts diff --git a/TrackCaloMatching/src/SConscript b/TrackCaloMatching/src/SConscript index c52aa9961b..9947990e53 100644 --- a/TrackCaloMatching/src/SConscript +++ b/TrackCaloMatching/src/SConscript @@ -35,7 +35,6 @@ mainlib = helper.make_mainlib ( [ helper.make_plugins( [ mainlib, - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', diff --git a/TrackerConditions/src/SConscript b/TrackerConditions/src/SConscript index f571010b67..37584aa05f 100644 --- a/TrackerConditions/src/SConscript +++ b/TrackerConditions/src/SConscript @@ -13,7 +13,6 @@ rootlibs = env['ROOTLIBS'] #jb helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_Mu2eBTrk', diff --git a/TrackerMC/CMakeLists.txt b/TrackerMC/CMakeLists.txt index bc2414386e..1318c9e704 100644 --- a/TrackerMC/CMakeLists.txt +++ b/TrackerMC/CMakeLists.txt @@ -10,7 +10,6 @@ cet_make_library( src/TruncatedSinusoid.cc LIBRARIES PUBLIC - Offline::ConditionsService Offline::DataProducts Offline::MCDataProducts Offline::TrackerConditions @@ -24,7 +23,6 @@ cet_build_plugin(MakeMCKalSeed art::module Offline::TrackerMC Offline::BFieldGeom - Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts Offline::ProditionsService @@ -70,7 +68,6 @@ cet_build_plugin(StrawDigisFromStrawGasSteps art::module Offline::TrackerMC Offline::BFieldGeom - Offline::ConditionsService Offline::ConfigTools Offline::DataProducts Offline::GeometryService diff --git a/TrackerMC/src/SConscript b/TrackerMC/src/SConscript index 5172a60bdf..0be87f8c35 100644 --- a/TrackerMC/src/SConscript +++ b/TrackerMC/src/SConscript @@ -15,7 +15,6 @@ rootlibs = env['ROOTLIBS'] rootlibs = env['ROOTLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_TrackerConditions', - 'mu2e_ConditionsService', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', 'mu2e_DataProducts', @@ -37,7 +36,6 @@ helper.make_plugins( [ mainlib, 'mu2e_SeedService', 'mu2e_TrackerConditions', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_TrackerGeom', diff --git a/Trigger/CMakeLists.txt b/Trigger/CMakeLists.txt index ee3999620b..df3dd537d4 100644 --- a/Trigger/CMakeLists.txt +++ b/Trigger/CMakeLists.txt @@ -28,7 +28,6 @@ cet_build_plugin(ReadTriggerInfo art::module LIBRARIES REG Offline::BFieldGeom - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::GlobalConstantsService diff --git a/Trigger/src/SConscript b/Trigger/src/SConscript index 061ff2dff3..66e7cfdd9e 100644 --- a/Trigger/src/SConscript +++ b/Trigger/src/SConscript @@ -27,7 +27,6 @@ helper.make_plugins( [ mainlib, 'mu2e_ParticleID', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', diff --git a/TrkDiag/CMakeLists.txt b/TrkDiag/CMakeLists.txt index e95ebc9b7c..723803bda7 100644 --- a/TrkDiag/CMakeLists.txt +++ b/TrkDiag/CMakeLists.txt @@ -100,7 +100,6 @@ cet_build_plugin(StrawHitDiag art::module LIBRARIES REG Offline::TrkDiag - Offline::ConditionsService Offline::DataProducts Offline::GeometryService Offline::MCDataProducts diff --git a/TrkDiag/src/SConscript b/TrkDiag/src/SConscript index c6be1273d3..0cd8b4a9d6 100644 --- a/TrkDiag/src/SConscript +++ b/TrkDiag/src/SConscript @@ -21,7 +21,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_TrackerGeom', @@ -68,7 +67,6 @@ helper.make_plugins( [ 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_SeedService', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_Mu2eHallGeom', diff --git a/TrkFilters/src/SConscript b/TrkFilters/src/SConscript index 3e41a97cbd..607b95d2b4 100644 --- a/TrkFilters/src/SConscript +++ b/TrkFilters/src/SConscript @@ -19,7 +19,6 @@ helper.make_plugins( [ mainlib, 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_SeedService', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', 'mu2e_TrackerGeom', diff --git a/TrkHitReco/CMakeLists.txt b/TrkHitReco/CMakeLists.txt index cdd4a88946..3bb335179d 100644 --- a/TrkHitReco/CMakeLists.txt +++ b/TrkHitReco/CMakeLists.txt @@ -36,7 +36,6 @@ cet_build_plugin(FlagBkgHits art::module art_root_io::TFileService_service Offline::TrkHitReco - Offline::ConditionsService Offline::ConfigTools Offline::DataProducts Offline::MCDataProducts @@ -81,7 +80,6 @@ cet_build_plugin(StrawHitReco art::module Offline::TrkHitReco Offline::ConditionsBase - Offline::ConditionsService Offline::ConfigTools Offline::DataProducts Offline::GeometryService diff --git a/TrkHitReco/src/SConscript b/TrkHitReco/src/SConscript index 56c66ec59c..963b4ecca7 100755 --- a/TrkHitReco/src/SConscript +++ b/TrkHitReco/src/SConscript @@ -15,7 +15,6 @@ rootlibs = env['ROOTLIBS'] mainlib = helper.make_mainlib([ 'mu2e_TrackerConditions', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_RecoDataProducts', 'mu2e_TrackerGeom', @@ -43,7 +42,6 @@ mainlib = helper.make_mainlib([ helper.make_plugins([mainlib, - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_TrackerGeom', diff --git a/TrkPatRec/CMakeLists.txt b/TrkPatRec/CMakeLists.txt index b69049e2ba..9098221709 100644 --- a/TrkPatRec/CMakeLists.txt +++ b/TrkPatRec/CMakeLists.txt @@ -35,7 +35,6 @@ cet_build_plugin(KalSeedFit art::module Offline::BFieldGeom Offline::BTrkData - Offline::ConditionsService Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService diff --git a/TrkPatRec/src/SConscript b/TrkPatRec/src/SConscript index 09863a8945..67a8643a87 100644 --- a/TrkPatRec/src/SConscript +++ b/TrkPatRec/src/SConscript @@ -19,7 +19,6 @@ helper = mu2e_helper(env) mainlib = helper.make_mainlib(['mu2e_Mu2eBTrk', 'mu2e_TrkReco', 'mu2e_BTrkData', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', @@ -54,7 +53,6 @@ helper.make_plugins([mainlib, 'mu2e_Mu2eUtilities', 'mu2e_TrkReco', 'mu2e_BTrkData', - 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index fcaebfdf39..fc51c2e28b 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -20,7 +20,6 @@ cet_make_library( Offline::BFieldGeom Offline::BTrkData Offline::CalorimeterGeom - Offline::ConditionsService Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService @@ -93,7 +92,6 @@ cet_build_plugin(TrkRecoMcUtils art::tool LIBRARIES REG Offline::TrkReco Offline::BTrkData - Offline::ConditionsService Offline::MCDataProducts Offline::Mu2eUtilities Offline::RecoDataProducts diff --git a/TrkReco/src/SConscript b/TrkReco/src/SConscript index 5b8933e4fa..09fa8e66d5 100644 --- a/TrkReco/src/SConscript +++ b/TrkReco/src/SConscript @@ -17,7 +17,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_BTrkData', 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', 'mu2e_BFieldGeom', @@ -57,7 +56,6 @@ helper.make_plugins( [ 'mu2e_BTrkData', 'mu2e_Mu2eUtilities', 'mu2e_SeedService', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', 'mu2e_BFieldGeom', From 36c0213ff3ca46fc16000ebc8e658864067267f5 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 30 Jan 2026 14:49:33 -0800 Subject: [PATCH 092/174] More removal --- BTrkLegacy/inc/HelixParams.hh | 1 + BTrkLegacy/inc/HelixTraj.hh | 46 ------------------------- BTrkLegacy/src/ExternalInfo.cc | 2 +- BTrkLegacy/src/TrkParticle.cc | 8 ++--- CalPatRec/inc/CalHelixFinderData.hh | 7 ++-- CalPatRec/inc/CalHelixFinder_module.hh | 2 +- CalPatRec/src/CalHelixFinderAlg.cc | 2 +- CalPatRec/src/CalHelixFinderData.cc | 2 +- CaloDiag/src/CaloClusterCheck_module.cc | 4 --- ParticleID/src/ParticleIDRead_module.cc | 2 +- RecoDataProducts/src/TrackSummary.cc | 15 ++++---- 11 files changed, 19 insertions(+), 72 deletions(-) delete mode 100644 BTrkLegacy/inc/HelixTraj.hh diff --git a/BTrkLegacy/inc/HelixParams.hh b/BTrkLegacy/inc/HelixParams.hh index 26ad2c434b..6f73e591ca 100644 --- a/BTrkLegacy/inc/HelixParams.hh +++ b/BTrkLegacy/inc/HelixParams.hh @@ -11,6 +11,7 @@ namespace mu2e { HelixParams(const CLHEP::HepVector& pvec, const CLHEP::HepSymMatrix& pcov) : parvec(pvec), parcov(pcov) {} ~HelixParams(){} + HelixParams* clone() const { return new HelixParams(*this); } double d0() const {return parvec[d0Index];} double phi0() const {return parvec[phi0Index];} diff --git a/BTrkLegacy/inc/HelixTraj.hh b/BTrkLegacy/inc/HelixTraj.hh deleted file mode 100644 index 498d5c369b..0000000000 --- a/BTrkLegacy/inc/HelixTraj.hh +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef HELIXTRAJ_HH -#define HELIXTRAJ_HH -#include "CLHEP/Matrix/Vector.h" -#include - - -class HelixParams; - -class HelixTraj{ -private: - CLHEP::HepVector pvec_; - CLHEP::HepSymMatrix pcov_; -public: - HelixTraj(const CLHEP::HepVector& pvec,const CLHEP::HepSymMatrix& pcov ) : pvec_(pvec), pcov_(pcov) - { - if (omega() == 0.0) pvec_[omegaIndex] = 1.e-9; - } - HelixTraj( const HelixTraj& h ) : pvec_(h.pvec_), pcov_(h.pcov_) - { - } - - - HelixTraj* clone() const - { - return new HelixTraj(*this); - } - - enum ParIndex {d0Index=0, phi0Index, omegaIndex, z0Index, tanDipIndex, NHLXPRM}; - double d0() const {return pvec_[d0Index];} - double phi0() const; - double omega() const {return pvec_[omegaIndex]; } - double z0() const {return pvec_[z0Index]; } - double tanDip() const { return pvec_[tanDipIndex]; } - - - double z( const double& ) const; - double zFlight(double zpos) const; - double dip() const {return atan(tanDip());} - double cosDip() const {return 1./sqrt(1.+(tanDip()*tanDip())); } - double sinDip() const {return tanDip()*cosDip(); } - double translen(const double& f) const {return cosDip()*f;} - double arc( const double& f) const {return translen(f)*omega();} - double angle(const double& f) const; -}; -#endif - diff --git a/BTrkLegacy/src/ExternalInfo.cc b/BTrkLegacy/src/ExternalInfo.cc index 6fc4ac6fef..df996f17e7 100644 --- a/BTrkLegacy/src/ExternalInfo.cc +++ b/BTrkLegacy/src/ExternalInfo.cc @@ -1,4 +1,4 @@ -#include "BTrkLegacy/inc/ExternalInfo.hh" +#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" #include diff --git a/BTrkLegacy/src/TrkParticle.cc b/BTrkLegacy/src/TrkParticle.cc index 5a356b77bb..a25184ec63 100644 --- a/BTrkLegacy/src/TrkParticle.cc +++ b/BTrkLegacy/src/TrkParticle.cc @@ -1,9 +1,9 @@ // particle description used for tracking // the implementation depends on the mu2e conditions service, but // not the interface -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrkLegacy/inc/ExternalInfo.hh" -#include "BTrkLegacy/inc/ParticleInfoInterface.hh" +#include "Offline/BTrkLegacy/TrkParticle.hh" +#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" +#include "Offline/BTrkLegacy/inc/ParticleInfoInterface.hh" #include @@ -153,4 +153,4 @@ TrkParticle::betagamma(double momentum) const { double TrkParticle::gamma(double momentum) const { return energy(momentum)/mass(); -} \ No newline at end of file +} diff --git a/CalPatRec/inc/CalHelixFinderData.hh b/CalPatRec/inc/CalHelixFinderData.hh index 89e67e5d94..0a799f2da0 100644 --- a/CalPatRec/inc/CalHelixFinderData.hh +++ b/CalPatRec/inc/CalHelixFinderData.hh @@ -4,8 +4,8 @@ #include "Offline/Mu2eUtilities/inc/LsqSums4.hh" -#include "BTrkLegacy/inc/TrkErrCode.hh" -#include "BTrkLegacy/inc/TrkParticle.hh" +#include "Offline/BTrkLegacy/inc/TrkErrCode.hh" +#include "Offline/BTrkLegacy/inc/TrkParticle.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" #include "Offline/RecoDataProducts/inc/StrawHitPosition.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" @@ -14,12 +14,11 @@ #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/StrawHit.hh" #include "Offline/DataProducts/inc/Helicity.hh" - #include "Offline/TrkReco/inc/TrkFaceData.hh" +#include "Offline/BTrkLegacy/inc/HelixParams.hh" #include -class HelixTraj; namespace mu2e { diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index 510a5b2d61..d9d04fd100 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -20,7 +20,7 @@ #include "Offline/DataProducts/inc/Helicity.hh" // BaBar -#include "BTrkLegacy/inc/HelixTraj.hh" +#include "Offline/BTrkLegacy/inc/HelixParams.hh" #include "Offline/BFieldGeom/inc/BFieldConfig.hh" #include "Offline/CalPatRec/inc/CalHelixFinder_types.hh" diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index c9d7fa2d08..e4dcd87753 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -7,7 +7,7 @@ // [00:13] : Giani // [14:15] : Pasha - parameters of fit with non-equal weights // -#include "BTrkLegacy/inc/HelixParams.hh" +#include "Offline/BTrkLegacy/inc/HelixParams.hh" #include "Offline/CalPatRec/inc/CalHelixFinderAlg.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" diff --git a/CalPatRec/src/CalHelixFinderData.cc b/CalPatRec/src/CalHelixFinderData.cc index afd2429374..cc51de38ba 100644 --- a/CalPatRec/src/CalHelixFinderData.cc +++ b/CalPatRec/src/CalHelixFinderData.cc @@ -2,7 +2,7 @@ #include "Offline/RecoDataProducts/inc/TimeCluster.hh" #include "Offline/CalPatRec/inc/CalHelixFinderData.hh" -#include "BTrk/TrkBase/HelixTraj.hh" +#include "Offline/BTrkLegacy/inc/HelixParams.hh" using CLHEP::HepVector; using CLHEP::HepSymMatrix; diff --git a/CaloDiag/src/CaloClusterCheck_module.cc b/CaloDiag/src/CaloClusterCheck_module.cc index 0d3bf4178c..2dacbc96ba 100644 --- a/CaloDiag/src/CaloClusterCheck_module.cc +++ b/CaloDiag/src/CaloClusterCheck_module.cc @@ -14,10 +14,6 @@ #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GeometryService/inc/VirtualDetector.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/HelixTraj.hh" #include "Offline/MCDataProducts/inc/GenParticle.hh" #include "Offline/MCDataProducts/inc/SimParticle.hh" diff --git a/ParticleID/src/ParticleIDRead_module.cc b/ParticleID/src/ParticleIDRead_module.cc index b163242684..e0287eb7d8 100644 --- a/ParticleID/src/ParticleIDRead_module.cc +++ b/ParticleID/src/ParticleIDRead_module.cc @@ -21,7 +21,7 @@ #include "Offline/RecoDataProducts/inc/PIDProduct.hh" -#include "BTrkLegacy/inc/TrkParticle.hh" +#include "Offline/BTrkLegacy/inc/TrkParticle.hh" // mu2e tracking #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" diff --git a/RecoDataProducts/src/TrackSummary.cc b/RecoDataProducts/src/TrackSummary.cc index 2430aa5b5f..8e0bc18d03 100644 --- a/RecoDataProducts/src/TrackSummary.cc +++ b/RecoDataProducts/src/TrackSummary.cc @@ -6,12 +6,9 @@ #include "CLHEP/Matrix/Vector.h" -// BaBar -#include "BTrk/BaBar/BaBar.hh" -//#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" +#include "KinKal/General/Chisq.hh" -namespace mu2e { +namespace mu2e { /* TODO: Delete if OK. Also check if can use BTrkLegacy HelixParams to substitute TrackSummary::HelixParams::HelixParams(const TrkSimpTraj& ltraj) : d0_(ltraj.parameters()->parameter()[d0Index]) @@ -35,12 +32,12 @@ namespace mu2e { static const double pi = 4.*atan(1.); // M_PI is not in the standard return 2 * pi * radius() * tanDip_; } - + double TrackSummary::fitcon() const { - ChisqConsistency cs(chi2(), ndof()); - return cs.significanceLevel(); + KinKal::Chisq cs(chi2(), ndof()); + return cs.probability(); } - + void TrackSummary::addState(const TrackSummary::TrackStateAtPoint& st) { states_.emplace_back(st); } From ebdfcdabc714b88529895738b929cccaff07b070 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 09:03:24 -0800 Subject: [PATCH 093/174] Remove all BTrk and KalRep references. Remove TrkExt and TrackCaloMatching packages. Refactor TrkParticle --- Analyses/CMakeLists.txt | 25 - Analyses/src/CaloCalib_module.cc | 9 +- Analyses/src/CaloTrackMatchExample_module.cc | 360 -- Analyses/src/CosmicAnalysis_module.cc | 615 --- Analyses/src/SConscript | 2 - Analyses/test/printKalReps.fcl | 35 - Analyses/test/testKalRepProvenanceHelpers.fcl | 31 - BTrkData/CMakeLists.txt | 14 - BTrkData/inc/Doublet.hh | 82 - BTrkData/inc/TrkCaloHit.hh | 67 - BTrkData/inc/TrkStrawHit.hh | 126 - BTrkData/src/Doublet.cc | 95 - BTrkData/src/SConscript | 32 - BTrkData/src/TrkCaloHit.cc | 155 - BTrkData/src/TrkStrawHit.cc | 272 -- BTrkLegacy/CMakeLists.txt | 4 +- BTrkLegacy/inc/ExternalInfo.hh | 52 - BTrkLegacy/inc/ParticleInfo.hh | 58 - BTrkLegacy/inc/ParticleInfoInterface.hh | 30 - BTrkLegacy/inc/TrkParticle.hh | 73 +- BTrkLegacy/src/ExternalInfo.cc | 16 - BTrkLegacy/src/TrkParticle.cc | 46 +- CMakeLists.txt | 12 +- CRVResponse/test/CRVResponseDAQ.fcl | 1 - CRVResponse/test/CRVResponseDAQExtracted.fcl | 1 - CRVResponse/test/CRVResponseExtracted.fcl | 1 - CRVResponse/test/CRVResponsePlot_v05.fcl | 1 - CRVResponse/test/CRVResponseReco.fcl | 1 - CRVResponse/test/CRVResponseRecoExtracted.fcl | 1 - CRVResponse/test/CRVResponse_v05.fcl | 1 - CRVResponse/test/CRVResponse_v07.fcl | 1 - CalPatRec/CMakeLists.txt | 36 +- CalPatRec/inc/CalTimePeakFinder_module.hh | 3 - CalPatRec/inc/HlPrint.hh | 2 - CalPatRec/inc/MergePatRec_types.hh | 3 - CalPatRec/inc/ObjectDumpUtils.hh | 8 - CalPatRec/src/CalTimePeakFinderDiag_tool.cc | 2 - CalPatRec/src/MergePatRecDiag_tool.cc | 35 +- CalPatRec/src/SConscript | 8 - CalPatRec/test/calPatRec.fcl | 1 - CalPatRec/test/calPatRec_01.fcl | 1 - CalPatRec/test/calPatRec_02.fcl | 1 - CalPatRec/test/calPatRec_display.fcl | 1 - CalPatRec/test/calPatRec_display_cnv00502.fcl | 1 - CalPatRec/test/calPatRec_display_read.fcl | 1 - CalPatRec/test/deltaFinder_debug_ce.fcl | 1 - CalPatRec/test/mergePatRec.fcl | 1 - CalPatRec/test/mergePatRec_02.fcl | 1 - CalPatRec/test/mergePatRec_03.fcl | 1 - CalPatRec/test/mergePatRec_display.fcl | 1 - CalPatRec/test/mergePatRec_display_read.fcl | 1 - CalPatRec/test/printTrackerNumerology.fcl | 1 - CalPatRec/test/trkPatRec_01.fcl | 1 - CalPatRec/test/trkPatRec_02.fcl | 1 - CalPatRec/test/trkPatRec_display.fcl | 1 - CalPatRec/test/trkPatRec_display_read.fcl | 1 - CaloDiag/src/SConscript | 2 - CaloFilters/src/SConscript | 2 - CosmicReco/CMakeLists.txt | 26 +- CosmicReco/src/SConscript | 2 - DAQ/CMakeLists.txt | 3 +- EventDisplay/CMakeLists.txt | 1 - EventDisplay/fcl/EventDisplayBase.fcl | 1 - EventDisplay/src/ContentSelector.cc | 18 - EventDisplay/src/ContentSelector.h | 3 - EventDisplay/src/DataInterface.cc | 191 - EventDisplay/src/DataInterface.h | 3 - EventDisplay/src/EventDisplay_module.cc | 31 - EventDisplay/src/SConscript | 2 - Mu2eBTrk/CMakeLists.txt | 22 - Mu2eBTrk/inc/BaBarMu2eField.hh | 38 - Mu2eBTrk/inc/DetStrawElem.hh | 56 - Mu2eBTrk/inc/DetStrawType.hh | 40 - Mu2eBTrk/inc/FileFinder.hh | 53 - Mu2eBTrk/inc/ParticleInfo.hh | 58 - Mu2eBTrk/src/BaBarMu2eField.cc | 43 - Mu2eBTrk/src/DetStrawElem.cc | 143 - Mu2eBTrk/src/ParticleInfo.cc | 83 - Mu2eBTrk/src/SConscript | 77 - Mu2eKinKal/inc/KKFileFinder.hh | 2 - Mu2eUtilities/CMakeLists.txt | 2 - .../inc/KalRepInstanceNameDecoder.hh | 35 - Mu2eUtilities/inc/TrkSpecies.hh | 57 - Mu2eUtilities/inc/polyAtan2.hh | 2 - .../src/KalRepInstanceNameDecoder.cc | 47 - Mu2eUtilities/src/TrkSpecies.cc | 44 - ParticleID/src/ParticleIDRead_module.cc | 6 - ParticleID/src/SConscript | 2 - ParticleID/test/test.fcl | 1 - Print/CMakeLists.txt | 7 +- Print/fcl/printLong.fcl | 5 - Print/src/PrintModule_module.cc | 5 - Print/src/TrkCaloIntersectPrinter.cc | 88 - ProditionsService/CMakeLists.txt | 7 +- ProditionsService/inc/ProditionsService.hh | 6 +- ProditionsService/src/SConscript | 5 - RecoDataProducts/CMakeLists.txt | 4 - RecoDataProducts/inc/KalRepCollection.hh | 16 - RecoDataProducts/inc/KalRepPtrCollection.hh | 26 - RecoDataProducts/inc/TrackCaloAssns.hh | 56 - RecoDataProducts/inc/TrackSummaryRecoMap.hh | 17 - RecoDataProducts/inc/TrkCaloIntersect.hh | 81 - RecoDataProducts/inc/TrkCaloMatch.hh | 71 - RecoDataProducts/inc/TrkExtTraj.hh | 129 - RecoDataProducts/src/SConscript | 12 - RecoDataProducts/src/classes.h | 4 - RecoDataProducts/src/classes_def.xml | 46 - SimulationConditions/src/SConscript | 6 +- TEveEventDisplay/CMakeLists.txt | 8 +- TEveEventDisplay/src/SConscript | 2 - TEveEventDisplay/src/TEveMu2eCustomHelix.cc | 50 - TEveEventDisplay/src/TEveMu2eDataInterface.cc | 2 +- TrackCaloMatching/CMakeLists.txt | 63 - TrackCaloMatching/fcl/prolog.fcl | 477 -- TrackCaloMatching/src/SConscript | 73 - .../src/TrackCaloIntersectionMVA_module.cc | 541 --- .../src/TrackCaloIntersection_module.cc | 507 -- .../src/TrackCaloMatchingExtend_module.cc | 320 -- .../src/TrackCaloMatchingMVA_module.cc | 419 -- TrackCaloMatching/test/AnalysisBaseMatch.C | 724 --- TrackCaloMatching/test/AnalysisBaseMatch.h | 317 -- TrackCaloMatching/test/FitCog.C | 1041 ---- TrackCaloMatching/test/TMVAReadExtend.C | 221 - TrackCaloMatching/test/TMVAReadRegress.C | 315 -- .../test/TMVARegression_BDTGAEl.weights.xml | 4055 ---------------- .../test/TMVARegression_BDTGAMu.weights.xml | 3779 --------------- .../test/TMVARegression_BDTGXEl.weights.xml | 4228 ----------------- .../test/TMVARegression_BDTGXMu.weights.xml | 4174 ---------------- .../test/TMVARegression_BDTGYEl.weights.xml | 4219 ---------------- .../test/TMVARegression_BDTGYMu.weights.xml | 4018 ---------------- TrackCaloMatching/test/TMVAWriteRegress.C | 139 - TrackCaloMatching/test/caloMatching.fcl | 144 - TrackCaloMatching/test/doTrainTestProd | 20 - TrackCaloMatching/test/producers.fcl | 45 - TrackCaloMatching/test/readCaloMatching.fcl | 232 - TrackCaloMatching/test/readExtrapol.fcl | 157 - TrackCaloMatching/test/trkExtrapol.fcl | 117 - TrackerConditions/CMakeLists.txt | 1 - TrackerConditions/inc/StrawResponse.hh | 9 - TrackerConditions/src/SConscript | 4 - TrackerConditions/src/StrawDriftMaker.cc | 1 - TrackerConditions/src/StrawPhysics.cc | 1 - TrackerConditions/src/StrawResponse.cc | 28 - TrackerConditions/src/StrawResponseMaker.cc | 1 - TrackerMC/src/MakeMCKalSeed_module.cc | 1 - TrackerMC/src/MakeStrawGasSteps_module.cc | 1 - TrackerMC/src/SConscript | 1 - .../src/StrawDigisFromStrawGasSteps_module.cc | 1 - Trigger/src/SConscript | 2 - TrkDiag/CMakeLists.txt | 31 +- TrkDiag/inc/TrkCaloDiag.hh | 61 - TrkDiag/inc/TrkComp.hh | 19 - TrkDiag/inc/TrkMCTools.hh | 1 - TrkDiag/src/SConscript | 4 - TrkDiag/src/TrkCaloDiag.cc | 82 - TrkDiag/src/TrkComp.cc | 97 - TrkDiag/src/TrkMCTools.cc | 1 - TrkExt/CMakeLists.txt | 43 - TrkExt/inc/TrkExtDetectors.hh | 59 - TrkExt/inc/TrkExtDiag.hh | 227 - TrkExt/inc/TrkExtInstanceName.hh | 71 - TrkExt/inc/TrkExtMCHits.hh | 53 - TrkExt/inc/TrkExtMaterial.hh | 57 - TrkExt/inc/TrkExtProtonAbsorber.hh | 42 - TrkExt/inc/TrkExtShape.hh | 34 - TrkExt/inc/TrkExtStoppingTarget.hh | 52 - TrkExt/inc/TrkExtToyDS.hh | 39 - TrkExt/src/SConscript | 81 - TrkExt/src/TrkExtDetectors.cc | 128 - TrkExt/src/TrkExtDiag.cc | 978 ---- TrkExt/src/TrkExtInstanceName.cc | 99 - TrkExt/src/TrkExtMCHits.cc | 227 - TrkExt/src/TrkExtMaterial.cc | 138 - TrkExt/src/TrkExtProtonAbsorber.cc | 102 - TrkExt/src/TrkExtShape.cc | 58 - TrkExt/src/TrkExtStoppingTarget.cc | 80 - TrkExt/src/TrkExtToyDS.cc | 64 - TrkExt/src/TrkExt_module.cc | 1167 ----- TrkExt/test/TrkExt.fcl | 156 - TrkFilters/fcl/TTDigis.fcl | 1 - TrkFilters/src/SConscript | 1 - TrkPatRec/CMakeLists.txt | 69 - TrkPatRec/src/SConscript | 5 +- TrkReco/CMakeLists.txt | 22 - TrkReco/inc/RobustHelixFinderData.hh | 1 - TrkReco/inc/TrkUtilities.hh | 17 - TrkReco/src/SConscript | 3 - TrkReco/src/TrkUtilities.cc | 133 +- TrkReco/src/classes.h | 9 - Validation/CMakeLists.txt | 7 +- ups/product_deps | 3 +- 191 files changed, 141 insertions(+), 38859 deletions(-) delete mode 100644 Analyses/src/CaloTrackMatchExample_module.cc delete mode 100644 Analyses/src/CosmicAnalysis_module.cc delete mode 100644 Analyses/test/printKalReps.fcl delete mode 100644 Analyses/test/testKalRepProvenanceHelpers.fcl delete mode 100644 BTrkData/CMakeLists.txt delete mode 100644 BTrkData/inc/Doublet.hh delete mode 100644 BTrkData/inc/TrkCaloHit.hh delete mode 100644 BTrkData/inc/TrkStrawHit.hh delete mode 100644 BTrkData/src/Doublet.cc delete mode 100644 BTrkData/src/SConscript delete mode 100644 BTrkData/src/TrkCaloHit.cc delete mode 100644 BTrkData/src/TrkStrawHit.cc delete mode 100644 BTrkLegacy/inc/ExternalInfo.hh delete mode 100644 BTrkLegacy/inc/ParticleInfo.hh delete mode 100644 BTrkLegacy/inc/ParticleInfoInterface.hh delete mode 100644 BTrkLegacy/src/ExternalInfo.cc delete mode 100644 Mu2eBTrk/CMakeLists.txt delete mode 100644 Mu2eBTrk/inc/BaBarMu2eField.hh delete mode 100644 Mu2eBTrk/inc/DetStrawElem.hh delete mode 100644 Mu2eBTrk/inc/DetStrawType.hh delete mode 100644 Mu2eBTrk/inc/FileFinder.hh delete mode 100644 Mu2eBTrk/inc/ParticleInfo.hh delete mode 100644 Mu2eBTrk/src/BaBarMu2eField.cc delete mode 100644 Mu2eBTrk/src/DetStrawElem.cc delete mode 100644 Mu2eBTrk/src/ParticleInfo.cc delete mode 100644 Mu2eBTrk/src/SConscript delete mode 100644 Mu2eUtilities/inc/KalRepInstanceNameDecoder.hh delete mode 100644 Mu2eUtilities/inc/TrkSpecies.hh delete mode 100644 Mu2eUtilities/src/KalRepInstanceNameDecoder.cc delete mode 100644 Mu2eUtilities/src/TrkSpecies.cc delete mode 100644 Print/src/TrkCaloIntersectPrinter.cc delete mode 100644 RecoDataProducts/inc/KalRepCollection.hh delete mode 100644 RecoDataProducts/inc/KalRepPtrCollection.hh delete mode 100644 RecoDataProducts/inc/TrackCaloAssns.hh delete mode 100644 RecoDataProducts/inc/TrackSummaryRecoMap.hh delete mode 100644 RecoDataProducts/inc/TrkCaloIntersect.hh delete mode 100644 RecoDataProducts/inc/TrkCaloMatch.hh delete mode 100644 RecoDataProducts/inc/TrkExtTraj.hh delete mode 100644 TEveEventDisplay/src/TEveMu2eCustomHelix.cc delete mode 100644 TrackCaloMatching/CMakeLists.txt delete mode 100644 TrackCaloMatching/fcl/prolog.fcl delete mode 100644 TrackCaloMatching/src/SConscript delete mode 100644 TrackCaloMatching/src/TrackCaloIntersectionMVA_module.cc delete mode 100644 TrackCaloMatching/src/TrackCaloIntersection_module.cc delete mode 100644 TrackCaloMatching/src/TrackCaloMatchingExtend_module.cc delete mode 100644 TrackCaloMatching/src/TrackCaloMatchingMVA_module.cc delete mode 100644 TrackCaloMatching/test/AnalysisBaseMatch.C delete mode 100644 TrackCaloMatching/test/AnalysisBaseMatch.h delete mode 100644 TrackCaloMatching/test/FitCog.C delete mode 100644 TrackCaloMatching/test/TMVAReadExtend.C delete mode 100644 TrackCaloMatching/test/TMVAReadRegress.C delete mode 100644 TrackCaloMatching/test/TMVARegression_BDTGAEl.weights.xml delete mode 100644 TrackCaloMatching/test/TMVARegression_BDTGAMu.weights.xml delete mode 100644 TrackCaloMatching/test/TMVARegression_BDTGXEl.weights.xml delete mode 100644 TrackCaloMatching/test/TMVARegression_BDTGXMu.weights.xml delete mode 100644 TrackCaloMatching/test/TMVARegression_BDTGYEl.weights.xml delete mode 100644 TrackCaloMatching/test/TMVARegression_BDTGYMu.weights.xml delete mode 100644 TrackCaloMatching/test/TMVAWriteRegress.C delete mode 100644 TrackCaloMatching/test/caloMatching.fcl delete mode 100644 TrackCaloMatching/test/doTrainTestProd delete mode 100644 TrackCaloMatching/test/producers.fcl delete mode 100644 TrackCaloMatching/test/readCaloMatching.fcl delete mode 100644 TrackCaloMatching/test/readExtrapol.fcl delete mode 100644 TrackCaloMatching/test/trkExtrapol.fcl delete mode 100644 TrkDiag/inc/TrkCaloDiag.hh delete mode 100644 TrkDiag/inc/TrkComp.hh delete mode 100644 TrkDiag/src/TrkCaloDiag.cc delete mode 100644 TrkDiag/src/TrkComp.cc delete mode 100644 TrkExt/CMakeLists.txt delete mode 100644 TrkExt/inc/TrkExtDetectors.hh delete mode 100644 TrkExt/inc/TrkExtDiag.hh delete mode 100644 TrkExt/inc/TrkExtInstanceName.hh delete mode 100644 TrkExt/inc/TrkExtMCHits.hh delete mode 100644 TrkExt/inc/TrkExtMaterial.hh delete mode 100644 TrkExt/inc/TrkExtProtonAbsorber.hh delete mode 100644 TrkExt/inc/TrkExtShape.hh delete mode 100644 TrkExt/inc/TrkExtStoppingTarget.hh delete mode 100644 TrkExt/inc/TrkExtToyDS.hh delete mode 100644 TrkExt/src/SConscript delete mode 100644 TrkExt/src/TrkExtDetectors.cc delete mode 100644 TrkExt/src/TrkExtDiag.cc delete mode 100644 TrkExt/src/TrkExtInstanceName.cc delete mode 100644 TrkExt/src/TrkExtMCHits.cc delete mode 100644 TrkExt/src/TrkExtMaterial.cc delete mode 100644 TrkExt/src/TrkExtProtonAbsorber.cc delete mode 100644 TrkExt/src/TrkExtShape.cc delete mode 100644 TrkExt/src/TrkExtStoppingTarget.cc delete mode 100644 TrkExt/src/TrkExtToyDS.cc delete mode 100644 TrkExt/src/TrkExt_module.cc delete mode 100644 TrkExt/test/TrkExt.fcl delete mode 100644 TrkReco/src/classes.h diff --git a/Analyses/CMakeLists.txt b/Analyses/CMakeLists.txt index 985a29b59b..d931978166 100644 --- a/Analyses/CMakeLists.txt +++ b/Analyses/CMakeLists.txt @@ -69,17 +69,6 @@ cet_build_plugin(CaloHitFinderInspect art::module Offline::RecoDataProducts ) -cet_build_plugin(CaloTrackMatchExample art::module - REG_SOURCE src/CaloTrackMatchExample_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::GlobalConstantsService - Offline::MCDataProducts - Offline::RecoDataProducts -) - cet_build_plugin(CollectionSizeAnalyzer art::module REG_SOURCE src/CollectionSizeAnalyzer_module.cc LIBRARIES REG @@ -108,20 +97,6 @@ cet_build_plugin(CORSIKAGenPlots art::module Offline::Mu2eUtilities ) -cet_build_plugin(CosmicAnalysis art::module - REG_SOURCE src/CosmicAnalysis_module.cc - LIBRARIES REG - - - Offline::BTrkData - Offline::CosmicRayShieldGeom - Offline::DataProducts - Offline::GeometryService - Offline::MCDataProducts - Offline::Mu2eUtilities - Offline::RecoDataProducts -) - cet_build_plugin(CosmicFilter art::module REG_SOURCE src/CosmicFilter_module.cc LIBRARIES REG diff --git a/Analyses/src/CaloCalib_module.cc b/Analyses/src/CaloCalib_module.cc index b4bedc5225..e8c8c36b62 100644 --- a/Analyses/src/CaloCalib_module.cc +++ b/Analyses/src/CaloCalib_module.cc @@ -18,7 +18,6 @@ #include "Offline/MCDataProducts/inc/GenParticle.hh" #include "Offline/MCDataProducts/inc/SimParticle.hh" -//#include "MCDataProducts/inc/StatusG4.hh" #include "Offline/MCDataProducts/inc/StepPointMC.hh" #include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" #include "Offline/MCDataProducts/inc/GenId.hh" @@ -46,12 +45,8 @@ #include "TH2.h" // Mu2e includes. -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - - #include #include #include @@ -118,7 +113,6 @@ namespace mu2e { std::string _trkPatRecModuleLabel; std::string _instanceName; - TrkParticle _tpart; TrkFitDirection _fdir; @@ -159,13 +153,12 @@ namespace mu2e { _caloClusterModuleLabel(pset.get("caloClusterModuleLabel","CaloClusterMakerNew")), _virtualDetectorLabel(pset.get("virtualDetectorName","virtualdetector")), _trkPatRecModuleLabel(pset.get("trkPatRecModuleLabel","TPRDownstreameMinus")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), _hviewxy(0),_hviewxz(0), _Ntup(0) { - _instanceName = _fdir.name() + _tpart.name(); + _instanceName = _fdir.name(); } void CaloCalib::beginJob(){ diff --git a/Analyses/src/CaloTrackMatchExample_module.cc b/Analyses/src/CaloTrackMatchExample_module.cc deleted file mode 100644 index 35d7b372b0..0000000000 --- a/Analyses/src/CaloTrackMatchExample_module.cc +++ /dev/null @@ -1,360 +0,0 @@ - // -// An EDAnalyzer module that reads back the hits created by the calorimeter and produces an ntuple -// -// -// Original author Bertrand Echenard -// - -#include "CLHEP/Units/SystemOfUnits.h" -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/unknownPDGIdName.hh" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" - -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - - -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloMatch.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" - -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Principal/Selector.h" -#include "art/Framework/Principal/Provenance.h" -#include "art/Framework/Services/Registry/ServiceDefinitionMacros.h" -#include "cetlib_except/exception.h" -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -#include "canvas/Utilities/InputTag.h" - -#include "TDirectory.h" -#include "TNtuple.h" -#include "TTree.h" - -#include -#include -#include -#include -#include - - - - -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::keV; - - - -namespace mu2e { - - - class CaloTrackMatchExample : public art::EDAnalyzer { - - public: - - explicit CaloTrackMatchExample(fhicl::ParameterSet const& pset) : - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel",0)), - _nProcess(0), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel")), - _caloClusterModuleLabel(pset.get("caloClusterModuleLabel")), - _trkCaloMatchModuleLabel(pset.get("trkCaloMatchModuleLabel")), - _trkFitterModuleLabel(pset.get("fitterModuleLabel")), - _g4ModuleLabel(pset.get("g4ModuleLabel")), - _virtualDetectorLabel(pset.get("virtualDetectorName")), - _maxChi2Match(pset.get("maxChi2Match")), - _Ntup(0) - - { - } - - - virtual ~CaloTrackMatchExample() { } - - virtual void beginJob(); - virtual void endJob(); - - // This is called for each event. - virtual void analyze(const art::Event& e); - - - - - - private: - - int findBestCluster(TrkCaloMatchCollection const& trkCaloMatches, int trkId, double maxChi2); - int findBestTrack( TrkCaloMatchCollection const& trkCaloMatches, int cluId, double maxChi2); - - int _diagLevel; - int _nProcess; - - std::string _caloCrystalModuleLabel; - std::string _caloClusterModuleLabel; - std::string _trkCaloMatchModuleLabel; - std::string _trkFitterModuleLabel; - std::string _trkfitInstanceName; - std::string _g4ModuleLabel; - std::string _virtualDetectorLabel; - double _maxChi2Match; - - - - - - TTree* _Ntup; - - int _evt,_run; - - int _nHits,_cryId[16384],_crySectionId[16384],_crySimIdx[16384],_crySimLen[16384]; - float _cryEtot,_cryTime[16384],_cryEdep[16384],_cryDose[16384],_cryPosX[16384],_cryPosY[16384],_cryPosZ[16384],_cryLeak[16384]; - - int _nCluster,_cluNcrys[16384]; - float _cluEnergy[16384],_cluTime[16384],_cluCogX[16384],_cluCogY[16384],_cluCogZ[16384]; - std::vector > _cluList; - - int _nTrk,_trkCluIdx[8192]; - - int _nVd,_vdId[1024],_vdPdgId[1024]; - float _vdTime[1024],_vdPosX[1024],_vdPosY[1024],_vdPosZ[1024],_vdMom[1024],_vdMomX[1024],_vdMomY[1024],_vdMomZ[1024]; - - - }; - - - - void CaloTrackMatchExample::beginJob(){ - - art::ServiceHandle tfs; - - _Ntup = tfs->make("CaloTrackMatch", "CaloTrackMatch"); - - - - _Ntup->Branch("evt", &_evt , "evt/I"); - _Ntup->Branch("run", &_run , "run/I"); - - _Ntup->Branch("nCry", &_nHits , "nCry/I"); - _Ntup->Branch("cryId", &_cryId , "cryId[nCry]/I"); - _Ntup->Branch("crySectionId", &_crySectionId, "crySectionId[nCry]/I"); - _Ntup->Branch("cryPosX", &_cryPosX , "cryPosX[nCry]/F"); - _Ntup->Branch("cryPosY", &_cryPosY , "cryPosY[nCry]/F"); - _Ntup->Branch("cryPosZ", &_cryPosZ , "cryPosZ[nCry]/F"); - _Ntup->Branch("cryEdep", &_cryEdep , "cryEdep[nCry]/F"); - _Ntup->Branch("cryTime", &_cryTime , "cryTime[nCry]/F"); - - _Ntup->Branch("nCluster", &_nCluster , "nCluster/I"); - _Ntup->Branch("cluEnergy", &_cluEnergy , "cluEnergy[nCluster]/F"); - _Ntup->Branch("cluTime", &_cluTime , "cluTime[nCluster]/F"); - _Ntup->Branch("cluCogX", &_cluCogX , "cluCogX[nCluster]/F"); - _Ntup->Branch("cluCogY", &_cluCogY , "cluCogY[nCluster]/F"); - _Ntup->Branch("cluCogZ", &_cluCogZ , "cluCogZ[nCluster]/F"); - _Ntup->Branch("cluNcrys", &_cluNcrys , "cluNcrys[nCluster]/I"); - _Ntup->Branch("cluList", &_cluList); - - _Ntup->Branch("nTrk", &_nTrk , "nTrk/I"); - _Ntup->Branch("trkCluIdx", &_trkCluIdx, "trkCluIdx[nTrk]/I"); - - _Ntup->Branch("nVd", &_nVd , "nVd/I"); - _Ntup->Branch("vdId", &_vdId , "vdId[nVd]/I"); - _Ntup->Branch("vdPdgId", &_vdPdgId , "vdPdgId[nVd]/I"); - _Ntup->Branch("vdMom", &_vdMom , "vdMom[nVd]/F"); - _Ntup->Branch("vdMomX", &_vdMomX , "vdMomX[nVd]/F"); - _Ntup->Branch("vdMomY", &_vdMomY , "vdMomY[nVd]/F"); - _Ntup->Branch("vdMomZ", &_vdMomZ , "vdMomZ[nVd]/F"); - _Ntup->Branch("vdPosX", &_vdPosX , "vdPosX[nVd]/F"); - _Ntup->Branch("vdPosY", &_vdPosY , "vdPosY[nVd]/F"); - _Ntup->Branch("vdPosZ", &_vdPosZ , "vdPosZ[nVd]/F"); - _Ntup->Branch("vdTime", &_vdTime , "vdTime[nVd]/F"); - - } - - - - void CaloTrackMatchExample::endJob(){ - } - - - - - void CaloTrackMatchExample::analyze(const art::Event& event) { - - ++_nProcess; - if (_diagLevel && _nProcess%10==0) std::cout<<"Processing event from CaloTrackMatchExample = "<<_nProcess < geom; - if( ! geom->hasElement() ) return; - Calorimeter const & cal = *(GeomHandle()); - - - // Get crystal hits - art::Handle CaloHitsHandle; - event.getByLabel(_caloCrystalModuleLabel, CaloHitsHandle); - CaloHitCollection const& CaloHits(*CaloHitsHandle); - - // Get tracks - art::Handle trksHandle; - event.getByLabel(_trkFitterModuleLabel,trksHandle); - KalRepPtrCollection const& trksPtrColl(*trksHandle); - - // Get clusters - art::Handle caloClustersHandle; - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - CaloClusterCollection const& caloClusters(*caloClustersHandle); - - // Get track calorimeter matches - art::Handle trkCaloMatchHandle; - event.getByLabel(_trkCaloMatchModuleLabel, trkCaloMatchHandle); - TrkCaloMatchCollection const& trkCaloMatches(*trkCaloMatchHandle); - - //Get virtual detector hits - art::Handle vdhits; - event.getByLabel(_g4ModuleLabel,_virtualDetectorLabel,vdhits); - - - - - - - - - //-------------------------- Do generated particles -------------------------------- - _evt = event.id().event(); - _run = event.run(); - - - //-------------------------- Do calorimeter hits -------------------------------- - - _nHits = 0; - for (unsigned int ic=0; ic _list; - for (int i=0;isize();++i) - _list.push_back( int(clusterIt->caloHitsPtrVector().at(i).get()- &CaloHits.at(0)) ); - - _cluEnergy[_nCluster] = clusterIt->energyDep(); - _cluTime[_nCluster] = clusterIt->time(); - _cluNcrys[_nCluster] = clusterIt->size(); - _cluCogX[_nCluster] = clusterIt->cog3Vector().x(); - _cluCogY[_nCluster] = clusterIt->cog3Vector().y(); - _cluCogZ[_nCluster] = clusterIt->cog3Vector().z(); - _cluList.push_back(_list); - - ++_nCluster; - } - - - //-------------------------- Do tracks -------------------------------- - // we just want the cluster that matches the track. - // For information about the track at the entrance of the calorimeter, look at the - // Analysis/src/ReadTrackCaloMatching_module.cc mdoule - - _nTrk = 0; - for (unsigned int i=0;i< trksPtrColl.size(); ++i) - { - //KalRepPtr const& trkPtr = trksPtrColl.at(i); - _trkCluIdx[_nTrk] = findBestCluster(trkCaloMatches,i,_maxChi2Match); - ++_nTrk; - - } - - - - //-------------------------- Dump virtual detector info -------------------------------- - _nVd=0; - for (auto iter=vdhits->begin(), ie=vdhits->end(); iter!=ie; ++iter) - { - const StepPointMC& hit = *iter; - - if (hit.volumeId()<73 || hit.volumeId() > 80) continue; - if (_nVd > 999) std::cout<<"Problem, nVd = "<<_nVd <pdgId(); - _vdTime[_nVd] = hit.time(); - _vdPosX[_nVd] = hit.position().x(); - _vdPosY[_nVd] = hit.position().y(); - _vdPosZ[_nVd] = hit.position().z(); - _vdMom[_nVd] = hit.momentum().mag(); - _vdMomX[_nVd] = hit.momentum().x(); - _vdMomY[_nVd] = hit.momentum().y(); - _vdMomZ[_nVd] = hit.momentum().z(); - ++_nVd; - } - - - - _Ntup->Fill(); - - - - - - } - - int CaloTrackMatchExample::findBestCluster(TrkCaloMatchCollection const& trkCaloMatches, int trkId, double maxChi2) - { - double chi2Best(maxChi2), cluBest(-1); - for (auto const& trkCaloMatch: trkCaloMatches) - { - if (trkCaloMatch.trkId()==trkId && trkCaloMatch.chi2() < chi2Best) - { - chi2Best= trkCaloMatch.chi2(); - cluBest = trkCaloMatch.cluId(); - } - } - return cluBest; - } - - int CaloTrackMatchExample::findBestTrack(TrkCaloMatchCollection const& trkCaloMatches, int cluId, double maxChi2) - { - double chi2Best(maxChi2), trkBest(-1); - for (auto const& trkCaloMatch: trkCaloMatches) - { - if (trkCaloMatch.cluId()==cluId && trkCaloMatch.chi2() < chi2Best) - { - chi2Best= trkCaloMatch.chi2(); - trkBest = trkCaloMatch.trkId(); - } - } - return trkBest; - } - - -} - -DEFINE_ART_MODULE(mu2e::CaloTrackMatchExample) - - diff --git a/Analyses/src/CosmicAnalysis_module.cc b/Analyses/src/CosmicAnalysis_module.cc deleted file mode 100644 index 999466462b..0000000000 --- a/Analyses/src/CosmicAnalysis_module.cc +++ /dev/null @@ -1,615 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "CLHEP/Units/GlobalSystemOfUnits.h" -#include "Offline/CosmicRayShieldGeom/inc/CosmicRayShield.hh" -#include "Offline/DataProducts/inc/CRSScintillatorBarIndex.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/PhysicalVolumeInfoMultiCollection.hh" -#include "Offline/MCDataProducts/inc/MCTrajectoryCollection.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/Mu2eUtilities/inc/PhysicalVolumeMultiHelper.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/CrvCoincidence.hh" -#include "Offline/RecoDataProducts/inc/CrvRecoPulse.hh" -#include "Offline/DataProducts/inc/PDGCode.hh" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/SubRun.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Core/EDAnalyzer.h" -#include "art_root_io/TFileService.h" -#include "fhiclcpp/ParameterSet.h" - -using namespace CLHEP; -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -typedef struct -{ - double cosmic_pos[3]; - double cosmic_E, cosmic_p; - double cosmic_ph, cosmic_th, cosmic_costh; - char cosmic_particle[100]; - - int reco_n; //number of reconstructed tracks - double reco_t0, reco_p0; - - char simreco_particle[100]; - char simreco_production_process[100], simreco_production_volume[100]; - double simreco_startp, simreco_endp, simreco_startp_z; - double simreco_pos[3]; - - double xplane1[3], xplane2[3], xplane3[3]; - double yplane1[3]; - double zplane1[3], zplane2[3], zplane3[3]; - - double xplane1Dir[3], xplane2Dir[3], xplane3Dir[3]; - double yplane1Dir[3]; - double zplane1Dir[3], zplane2Dir[3], zplane3Dir[3]; - - double firstCoincidenceHitTime; - int firstCoincidenceHitSectorType; - double firstCoincidenceHitPos[3]; - - bool CRVveto_allSectors; - bool CRVveto[8]; - double CRVvetoTime[8]; - double CRVvetoPos[8][3]; - - bool CRVhit_allSectors; - bool CRVhit[8]; - double CRVhitTime[8]; - double CRVhitPos[8][3]; - double CRVhitDir[8][3]; - - int run_number, subrun_number, event_number; - - char filename[200]; - - void clear() - { - reco_n=0; - reco_t0=NAN; - reco_p0=NAN; - filename[0]='\0'; - simreco_particle[0]='\0'; - simreco_production_process[0]='\0'; - simreco_production_volume[0]='\0'; - simreco_startp=NAN; - simreco_endp=NAN; - simreco_startp_z=NAN; - - for(int i=0; i<3; i++) - { - simreco_pos[i]=NAN; - xplane1[i]=NAN; - xplane2[i]=NAN; - xplane3[i]=NAN; - yplane1[i]=NAN; - zplane1[i]=NAN; - zplane2[i]=NAN; - zplane3[i]=NAN; - xplane1Dir[i]=NAN; - xplane2Dir[i]=NAN; - xplane3Dir[i]=NAN; - yplane1Dir[i]=NAN; - zplane1Dir[i]=NAN; - zplane2Dir[i]=NAN; - zplane3Dir[i]=NAN; - firstCoincidenceHitPos[i]=NAN; - } - - firstCoincidenceHitTime=NAN; - - CRVveto_allSectors=false; - CRVhit_allSectors=false; - for(int i=0; i<8; i++) - { - CRVveto[i]=false; - CRVvetoTime[i]=NAN; - CRVhit[i]=false; - CRVhitTime[i]=NAN; - for(int j=0; j<3; j++) - { - CRVvetoPos[i][j]=NAN; - CRVhitPos[i][j]=NAN; - CRVhitDir[i][j]=NAN; - } - } - }; -} EventInfo; - -namespace mu2e -{ - class CosmicAnalysis : public art::EDAnalyzer - { - public: - explicit CosmicAnalysis(fhicl::ParameterSet const &pset); - virtual ~CosmicAnalysis() { } - virtual void beginJob(); - void analyze(const art::Event& e); - void findCrossingDetails(const std::vector &trajectoryPoints, int dim, double crossingPos, - double *crossingPoint, double *crossingDirection); - void findCrossings(const art::Event& event, const cet::map_vector_key& particleKey); - - private: - std::string _fitterModuleLabel; - std::string _fitterModuleInstance; - std::string _g4ModuleLabel; - std::string _generatorModuleLabel; - std::string _hitmakerModuleLabel; - std::string _hitmakerModuleInstance; - std::string _crvCoincidenceModuleLabel; - std::string _crvRecoPulseModuleLabel; - std::string _volumeModuleLabel; - std::string _filenameSearchPattern; - EventInfo _eventinfo; - TTree *_tree; - - CLHEP::Hep3Vector _detSysOrigin; - double _zent; - }; - - CosmicAnalysis::CosmicAnalysis(fhicl::ParameterSet const &pset) - : - art::EDAnalyzer(pset), - _fitterModuleLabel(pset.get("fitterModuleLabel")), - _fitterModuleInstance(pset.get("fitterModuleInstance")), - _g4ModuleLabel(pset.get("g4ModuleLabel","detectorFilter")), - _generatorModuleLabel(pset.get("generatorModuleLabel")), - _hitmakerModuleLabel(pset.get("hitmakerModuleLabel")), - _hitmakerModuleInstance(pset.get("hitmakerModuleInstance")), - _crvCoincidenceModuleLabel(pset.get("crvCoincidenceModuleLabel")), - _crvRecoPulseModuleLabel(pset.get("crvRecoPulseModuleLabel")), - _volumeModuleLabel(pset.get("volumeModuleLabel")), - _filenameSearchPattern(pset.get("filenameSearchPattern")) - { - } - - void CosmicAnalysis::beginJob() - { - art::ServiceHandle tfs; - art::TFileDirectory tfdir = tfs->mkdir("cosmicInfo"); - _tree = tfdir.make("cosmicInfoTree","cosmicInfoTree"); - - EventInfo &e=_eventinfo; - _tree->Branch("cosmic_pos",e.cosmic_pos,"cosmic_pos[3]/D"); - _tree->Branch("cosmic_E",&e.cosmic_E,"cosmic_E/D"); - _tree->Branch("cosmic_p",&e.cosmic_p,"cosmic_p/D"); - _tree->Branch("cosmic_ph",&e.cosmic_ph,"cosmic_ph/D"); - _tree->Branch("cosmic_th",&e.cosmic_th,"cosmic_th/D"); - _tree->Branch("cosmic_costh",&e.cosmic_costh,"cosmic_costh/D"); - _tree->Branch("cosmic_particle",e.cosmic_particle,"cosmic_particle[100]/C"); - _tree->Branch("reco_n",&e.reco_n,"reco_n/I"); - _tree->Branch("reco_t0",&e.reco_t0,"reco_t0/D"); - _tree->Branch("reco_p0",&e.reco_p0,"reco_p0/D"); - _tree->Branch("simreco_particle",e.simreco_particle,"simreco_particle[100]/C"); - _tree->Branch("simreco_production_process",e.simreco_production_process,"simreco_production_process[100]/C"); - _tree->Branch("simreco_production_volume",e.simreco_production_volume,"simreco_production_volume[100]/C"); - _tree->Branch("simreco_startp",&e.simreco_startp,"simreco_startp/D"); - _tree->Branch("simreco_endp",&e.simreco_endp,"simreco_endp/D"); - _tree->Branch("simreco_startp_z",&e.simreco_startp_z,"simreco_startp_z/D"); - _tree->Branch("simreco_pos",e.simreco_pos,"simreco_pos[3]/D"); - _tree->Branch("xplane1",e.xplane1,"xplane1[3]/D"); - _tree->Branch("xplane2",e.xplane2,"xplane2[3]/D"); - _tree->Branch("xplane3",e.xplane3,"xplane3[3]/D"); - _tree->Branch("yplane1",e.yplane1,"yplane1[3]/D"); - _tree->Branch("zplane1",e.zplane1,"zplane1[3]/D"); - _tree->Branch("zplane2",e.zplane2,"zplane2[3]/D"); - _tree->Branch("zplane3",e.zplane3,"zplane3[3]/D"); - _tree->Branch("xplane1Dir",e.xplane1Dir,"xplane1Dir[3]/D"); - _tree->Branch("xplane2Dir",e.xplane2Dir,"xplane2Dir[3]/D"); - _tree->Branch("xplane3Dir",e.xplane3Dir,"xplane3Dir[3]/D"); - _tree->Branch("yplane1Dir",e.yplane1Dir,"yplane1Dir[3]/D"); - _tree->Branch("zplane1Dir",e.zplane1Dir,"zplane1Dir[3]/D"); - _tree->Branch("zplane2Dir",e.zplane2Dir,"zplane2Dir[3]/D"); - _tree->Branch("zplane3Dir",e.zplane3Dir,"zplane3Dir[3]/D"); - _tree->Branch("firstCoincidenceHitTime",&e.firstCoincidenceHitTime,"firstCoincidenceHitTime/D"); - _tree->Branch("firstCoincidenceHitSectorType",&e.firstCoincidenceHitSectorType,"firstCoincidenceHitSectorType/I"); - _tree->Branch("firstCoincidenceHitPos",e.firstCoincidenceHitPos,"firstCoincidenceHitPos[3]/D"); - _tree->Branch("CRVveto_allSectors",&e.CRVveto_allSectors,"CRVveto_allSectors/O"); - _tree->Branch("CRVveto",e.CRVveto,"CRVveto[8]/O"); - _tree->Branch("CRVvetoTime",e.CRVvetoTime,"CRVvetoTime[8]/D"); - _tree->Branch("CRVvetoPos",e.CRVvetoPos,"CRVvetoPos[8][3]/D"); - _tree->Branch("CRVhit_allSectors",&e.CRVhit_allSectors,"CRVhit_allSectors/O"); - _tree->Branch("CRVhit",e.CRVhit,"CRVhit[8]/O"); - _tree->Branch("CRVhitTime",e.CRVhitTime,"CRVhitTime[8]/D"); - _tree->Branch("CRVhitPos",e.CRVhitPos,"CRVhitPos[8][3]/D"); - _tree->Branch("CRVhitDir",e.CRVhitDir,"CRVhitDir[8][3]/D"); - _tree->Branch("run_number",&e.run_number,"run_number/I"); - _tree->Branch("subrun_number",&e.subrun_number,"subrun_number/I"); - _tree->Branch("event_number",&e.event_number,"event_number/I"); - _tree->Branch("filename",e.filename,"filename[200]/C"); - } - - void CosmicAnalysis::findCrossingDetails(const std::vector &trajectoryPoints, int dim, double crossingPos, - double *crossingPoint, double *crossingDirection) - { - if(!std::isnan(crossingPoint[0])) return; //point already found - for(unsigned int i=1; i=crossingPos && point2[dim]<=crossingPos) - || (point1[dim]<=crossingPos && point2[dim]>=crossingPos)) - { - double ratio=(crossingPos - point1[dim])/diffVector[dim]; - CLHEP::Hep3Vector point=ratio*diffVector+point1; - for(int i=0; i<3; i++) - { - crossingPoint[i]=point[i]; - crossingDirection[i]=diffVector.unit()[i]; - } - return; //don't look for a second point - } - } - } - - void CosmicAnalysis::findCrossings(const art::Event& event, const cet::map_vector_key& particleKey) - { - double xCrossing1= -2525.4; //CRV-R - double xCrossing2= 2525.4; //CRV-L - double xCrossing3= 3800.0; //TS entrance - double yCrossing1= 2589.7; //CRV-T / CRV-TS - double zCrossing1=-12496.8; //CRV-U - double zCrossing2= -7512.6; //open left side at the TS entrance - double zCrossing3= 8571.0; //CRV-D - - std::string productInstanceName=""; - art::Handle _mcTrajectories; - if(event.getByLabel(_g4ModuleLabel,productInstanceName,_mcTrajectories)) - { - std::map,mu2e::MCTrajectory>::const_iterator traj_iter; - for(traj_iter=_mcTrajectories->begin(); traj_iter!=_mcTrajectories->end(); traj_iter++) - { - if(traj_iter->first->id()==particleKey) - { - const auto &trajectoryPoints = traj_iter->second.points(); - findCrossingDetails(trajectoryPoints, 0, xCrossing1, _eventinfo.xplane1, _eventinfo.xplane1Dir); - findCrossingDetails(trajectoryPoints, 0, xCrossing2, _eventinfo.xplane2, _eventinfo.xplane2Dir); - findCrossingDetails(trajectoryPoints, 0, xCrossing3, _eventinfo.xplane3, _eventinfo.xplane3Dir); - findCrossingDetails(trajectoryPoints, 1, yCrossing1, _eventinfo.yplane1, _eventinfo.yplane1Dir); - findCrossingDetails(trajectoryPoints, 2, zCrossing1, _eventinfo.zplane1, _eventinfo.zplane1Dir); - findCrossingDetails(trajectoryPoints, 2, zCrossing2, _eventinfo.zplane2, _eventinfo.zplane2Dir); - findCrossingDetails(trajectoryPoints, 2, zCrossing3, _eventinfo.zplane3, _eventinfo.zplane3Dir); - } - } - } - } - - inline bool operator < (const art::Ptr l, const art::Ptr r) - { - return l->id()id(); - } - - void CosmicAnalysis::analyze(const art::Event& event) - { -//FIXME -//Will be fixed later after the update of the CRV code is done -/* - _eventinfo.clear(); - - for(int i=0; iGetListOfFiles()->GetEntries(); i++) - { - std::string filename=((TFile*)gROOT->GetListOfFiles()->At(i))->GetName(); - if(filename.find(_filenameSearchPattern)!=std::string::npos) strncpy(_eventinfo.filename, filename.c_str(),199); - } - - _eventinfo.run_number=event.id().run(); - _eventinfo.subrun_number=event.id().subRun(); - _eventinfo.event_number=event.id().event(); - - GeomHandle det; - GeomHandle vdg; - _detSysOrigin = det->getOrigin(); - _zent = det->toDetector(vdg->getGlobal(VirtualDetectorId::TT_FrontPA)).z(); - -//generated cosmic ray muons - art::Handle genParticles; - if(event.getByLabel(_generatorModuleLabel, genParticles)) - { - if(genParticles.product()!=NULL) - { - if(genParticles->size()>0) //there shouldn't be more than 1 particle - { - const mu2e::GenParticle &particle=genParticles->at(0); - _eventinfo.cosmic_pos[0]=particle.position().x()-_detSysOrigin.x(); - _eventinfo.cosmic_pos[1]=particle.position().y()-_detSysOrigin.y(); - _eventinfo.cosmic_pos[2]=particle.position().z()-_detSysOrigin.z(); - _eventinfo.cosmic_E=particle.momentum().e(); - - double p=particle.momentum().vect().mag(); - double px=particle.momentum().px(); - double py=particle.momentum().py(); - double pz=particle.momentum().pz(); - double zenith=acos(py/p)*180.0/TMath::Pi(); - double azimuth=atan2(px,pz)*180.0/TMath::Pi(); - if(azimuth<0) azimuth+=360.0; - - _eventinfo.cosmic_p=p; - _eventinfo.cosmic_ph=azimuth; - _eventinfo.cosmic_th=zenith; - _eventinfo.cosmic_costh=py/p; - - PDGCode::type pdgId = particle.pdgId(); - strncpy(_eventinfo.cosmic_particle, HepPID::particleName(pdgId).c_str(),99); - } - } - } - -//particles crossing the CRV planes - std::string productInstanceName=""; - art::Handle simParticleCollection; - if(event.getByLabel(_g4ModuleLabel,productInstanceName,simParticleCollection)) - { - if(simParticleCollection.product()!=NULL) - { - cet::map_vector::const_iterator iter; - for(iter=simParticleCollection->begin(); iter!=simParticleCollection->end(); iter++) - { - const mu2e::SimParticle& particle = iter->second; - int pdgId=particle.pdgId(); - if(abs(pdgId)==11 || abs(pdgId)==13) - { - const cet::map_vector_key& particleKey = iter->first; - findCrossings(event,particleKey); //if a second particle crosses the same plane, it will be ignored - } - } - } - } - -//get the physical volume information for later - art::Handle physicalVolumesMulti; - bool hasPhysicalVolumes=event.getSubRun().getByLabel(_volumeModuleLabel, physicalVolumesMulti); - -//find the straw hits used by the reconstructed track - std::map, int> simParticles; // < operator defined above - - art::Handle kalReps; - art::Handle stepPointVectors; - if(event.getByLabel(_fitterModuleLabel,_fitterModuleInstance,kalReps) && event.getByLabel(_hitmakerModuleLabel,_hitmakerModuleInstance,stepPointVectors)) - { - if(kalReps.product()!=NULL && stepPointVectors.product()!=NULL) - { - if(kalReps->size()>0) - { - - //if multiple reco tracks, selected reco track which has a momentum which is closest to 104.375 MeV/c - size_t selectedTrack=0; - double minMomentumDifference=NAN; - for(size_t k=0; ksize(); k++) - { - double momentumDifference=fabs(kalReps->at(k).momentum(0).mag()-104.375); - if(momentumDifferenceat(selectedTrack); - _eventinfo.reco_n=kalReps->size(); - _eventinfo.reco_t0=particle.t0().t0(); - - //from TrkDiag/src/KalDiag.cc - double firsthitfltlen = particle.lowFitRange(); - double lasthitfltlen = particle.hiFitRange(); - double entlen = std::min(firsthitfltlen,lasthitfltlen); - TrkHelixUtils::findZFltlen(particle.traj(),_zent,entlen,0.1); - _eventinfo.reco_p0=particle.momentum(entlen).mag(); - - TrkHitVector const& hots = particle.hitVector(); - for(auto iter=hots.begin(); iter!=hots.end(); iter++) - { - const TrkHit *hitOnTrack = *iter; - const mu2e::TrkStrawHit* trkStrawHit = dynamic_cast(hitOnTrack); - if(trkStrawHit) - { - //get the sim particles which caused this hit - int stepPointVectorsIndex = trkStrawHit->index(); - const mu2e::PtrStepPointMCVector &stepPointVector = stepPointVectors->at(stepPointVectorsIndex); - for(auto iterStepPoint=stepPointVector.begin(); iterStepPoint!=stepPointVector.end(); iterStepPoint++) - { - const art::Ptr stepPoint = *iterStepPoint; - simParticles[stepPoint->simParticle()]++; - } - } - } - - //find simparticle which matches the highest number of straw hits associated with the reconstructed track - int largestNumberOfHits=0; - art::Ptr matchingSimparticle; - std::map, int>::const_iterator simParticleIter; - for(simParticleIter=simParticles.begin(); simParticleIter!=simParticles.end(); simParticleIter++) - { - if(simParticleIter->second>largestNumberOfHits) - { - largestNumberOfHits=simParticleIter->second; - matchingSimparticle=simParticleIter->first; - } - } - - //access the simparticle found above - if(largestNumberOfHits>0) - { - _eventinfo.simreco_endp=matchingSimparticle->endMomentum().vect().mag(); - - //this sim particle may have been create in the previous simulation stage - //therefore, a particle which has the creation code "primary", may not be a primary - //but a continuation of a particle from a previous stage. - //this particle from the previous stage is this particle's parent - if(matchingSimparticle->creationCode()==ProcessCode::mu2ePrimary && - matchingSimparticle->hasParent()) matchingSimparticle=matchingSimparticle->parent(); - - ProcessCode productionProcess = matchingSimparticle->creationCode(); - strncpy(_eventinfo.simreco_production_process, productionProcess.name().c_str(),99); - - int pdgId=matchingSimparticle->pdgId(); - strncpy(_eventinfo.simreco_particle, HepPID::particleName(pdgId).c_str(),99); - - _eventinfo.simreco_startp=matchingSimparticle->startMomentum().vect().mag(); - _eventinfo.simreco_startp_z=matchingSimparticle->startMomentum().vect().z(); - _eventinfo.simreco_pos[0]=matchingSimparticle->startPosition().x()-_detSysOrigin.x(); - _eventinfo.simreco_pos[1]=matchingSimparticle->startPosition().y()-_detSysOrigin.y(); - _eventinfo.simreco_pos[2]=matchingSimparticle->startPosition().z()-_detSysOrigin.z(); - - std::string productionVolumeName="unknown volume"; - if(hasPhysicalVolumes && physicalVolumesMulti.product()!=NULL) - { - mu2e::PhysicalVolumeMultiHelper volumeMultiHelper(physicalVolumesMulti.product()); - productionVolumeName=volumeMultiHelper.startVolume(*matchingSimparticle).name(); - } - strncpy(_eventinfo.simreco_production_volume, productionVolumeName.c_str(),99); - } - } //kalReps.size()>0 - } //kalReps.product()!=0 - } //event.getByLabel - - if(strlen(_eventinfo.simreco_particle)==0) //this mostly likely happened because the reconstructed track wasn't found - { //don't record such events - std::cout<<"Will not record event "<<_eventinfo.event_number<<" of subrun "<<_eventinfo.subrun_number<<" in file "<<_eventinfo.filename<<", "; - std::cout<<"since either the reco or the MC track is missing."< CRS; - - art::Handle crvCoincidenceCheckResult; - std::string crvCoincidenceInstanceName=""; - - if(event.getByLabel(_crvCoincidenceModuleLabel,crvCoincidenceInstanceName,crvCoincidenceCheckResult)) - { - const std::vector &coincidenceCombinations = crvCoincidenceCheckResult->GetCoincidenceCombinations(); - for(unsigned int i=0; igetBar(barIndex); - int sectorNumber = CRSbar.id().getShieldNumber(); - int sectorType = CRS->getCRSScintillatorShield(sectorNumber).getSectorType(); - sectorType--; - if(sectorType>=8 || sectorType<0) continue; - - _eventinfo.CRVveto_allSectors=true; - _eventinfo.CRVveto[sectorType]=true; - - for(int j=0; j<3; j++) - { - double t=coincidenceCombinations[i]._time[j]; - barIndex=coincidenceCombinations[i]._counters[j]; - CLHEP::Hep3Vector pos = CRS->getBar(barIndex).getPosition()-_detSysOrigin; - - if(std::isnan(_eventinfo.firstCoincidenceHitTime) || t<_eventinfo.firstCoincidenceHitTime) - { - _eventinfo.firstCoincidenceHitTime=t; - _eventinfo.firstCoincidenceHitSectorType=sectorType; - for(int k=0; k<3; k++) _eventinfo.firstCoincidenceHitPos[k]=pos[k]; - } - - if(std::isnan(_eventinfo.CRVvetoTime[sectorType]) || t<_eventinfo.CRVvetoTime[sectorType]) - { - _eventinfo.CRVvetoTime[sectorType]=t; - for(int k=0; k<3; k++) _eventinfo.CRVvetoPos[sectorType][k]=pos[k]; - } - } - } - } - -//check for CRV step points - std::vector > CRVStepsVector; - art::Selector selector(art::ProductInstanceNameSelector("CRV") && - art::ProcessNameSelector("*")); - - event.getMany(selector, CRVStepsVector); - for(size_t i=0; i &CRVSteps = CRVStepsVector[i]; - - for(StepPointMCCollection::const_iterator iter=CRVSteps->begin(); iter!=CRVSteps->end(); iter++) - { - StepPointMC const& step(*iter); - int PDGcode = step.simParticle()->pdgId(); -// if(abs(PDGcode)!=11 && abs(PDGcode)!=13) continue; - if(abs(PDGcode)!=13) continue; //ignore cases where a CRV hit is created by a particle other than a muon - - const CRSScintillatorBar &CRSbar = CRS->getBar(step.barIndex()); - - int sectorNumber = CRSbar.id().getShieldNumber(); - int sectorType = CRS->getCRSScintillatorShield(sectorNumber).getSectorType(); - sectorType--; - if(sectorType>=8 || sectorType<0) continue; - // 0: R - // 1: L - // 2: T - // 3: D - // 4: U - // 5,6,7: C1,C2,C3 - - double t = step.time(); - CLHEP::Hep3Vector pos = step.position()-_detSysOrigin; - CLHEP::Hep3Vector dir = step.momentum().unit(); - - _eventinfo.CRVhit_allSectors =true; - _eventinfo.CRVhit[sectorType]=true; - if(_eventinfo.CRVhitTime[sectorType]>t || std::isnan(_eventinfo.CRVhitTime[sectorType])) - { - _eventinfo.CRVhitTime[sectorType]=t; - for(int j=0; j<3; j++) - { - _eventinfo.CRVhitPos[sectorType][j]=pos[j]; - _eventinfo.CRVhitDir[sectorType][j]=dir[j]; - } - } - } - } -*/ - -/***************/ -/* only a test */ -/* - art::Handle crvRecoPulsesCollection; - event.getByLabel("CrvRecoPulses","",crvRecoPulsesCollection); - for(CrvRecoPulsesCollection::const_iterator iter=crvRecoPulsesCollection->begin(); - iter!=crvRecoPulsesCollection->end(); iter++) - { - const CRSScintillatorBarIndex &barIndex = iter->first; - const CRSScintillatorBar &CRSbar = CRS->getBar(barIndex); - - const CrvRecoPulses &crvRecoPulses = iter->second; - for(int SiPM=0; SiPM<4; SiPM++) - { - const std::vector &pulseVector = crvRecoPulses.GetRecoPulses(SiPM); - for(unsigned int i = 0; iFill(); -*/ - } -} - -using mu2e::CosmicAnalysis; -DEFINE_ART_MODULE(CosmicAnalysis) - diff --git a/Analyses/src/SConscript b/Analyses/src/SConscript index 64bc12f926..f262417679 100644 --- a/Analyses/src/SConscript +++ b/Analyses/src/SConscript @@ -21,8 +21,6 @@ mainlib = helper.make_mainlib ( ['fhiclcpp_types', helper.make_plugins( [ mainlib, 'mu2e_TrkExt', 'mu2e_TrkDiag', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_BFieldGeom', diff --git a/Analyses/test/printKalReps.fcl b/Analyses/test/printKalReps.fcl deleted file mode 100644 index 4afde16ba1..0000000000 --- a/Analyses/test/printKalReps.fcl +++ /dev/null @@ -1,35 +0,0 @@ -# -# Print information about KalReps -# -# Contact person Rob Kutschke -# - -#include "Offline/Analyses/test/genReco.fcl" - -physics.analyzers.printTRFDeM : { - module_type : KalRepsPrinter - tracksTag : "TRFDeM:DeM" - kalDiag : @local::KalDiagReadCD3 - outputFilename : "TrkPatRec.txt" -} - -physics.analyzers.printCPRDeM : { - module_type : KalRepsPrinter - tracksTag : "CalPatRecDem:DeM" - kalDiag : @local::KalDiagReadCD3 - outputFilename : "CalPatRec.txt" - -} - -physics.analyzers.testTrkPatRecType1 : { - module_type : TestKalRepProvenanceHelpers - tracksTag : "MergePatRecDem:DeM" -} - -physics.e1 : [ printTRFDeM, printCPRDeM, testTrkPatRecType1 ] -#physics.out : [ dumper ] - -outputs.dumper : { - module_type : FileDumperOutput - wantProductFullClassName : true -} diff --git a/Analyses/test/testKalRepProvenanceHelpers.fcl b/Analyses/test/testKalRepProvenanceHelpers.fcl deleted file mode 100644 index 13a4c105bf..0000000000 --- a/Analyses/test/testKalRepProvenanceHelpers.fcl +++ /dev/null @@ -1,31 +0,0 @@ -# -# Exercise TestKalRepProvenanceHelpers by running it on the -# track collections produced by genReco.fcl -# -# Contact person Rob Kutschke -# - -#include "Offline/Analyses/test/genReco.fcl" - -physics.analyzers.testTrkPatRecType0 : { - module_type : TestKalRepProvenanceHelpers - tracksTag : "TRFDeM:DeM" -} - -physics.analyzers.testTrkPatRecType1 : { - module_type : TestKalRepProvenanceHelpers - tracksTag : "MergePatRecDem:DeM" -} - -physics.analyzers.testTrkPatRecType2 : { - module_type : TestKalRepProvenanceHelpers - tracksTag : "MergePatRecDmm:DmuM" -} - -physics.e1 : [ testTrkPatRecType0, testTrkPatRecType1, testTrkPatRecType2 ] -#physics.out : [ dumper ] - -outputs.dumper : { - module_type : FileDumperOutput - wantProductFullClassName : true -} diff --git a/BTrkData/CMakeLists.txt b/BTrkData/CMakeLists.txt deleted file mode 100644 index f8525baf1b..0000000000 --- a/BTrkData/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cet_make_library( - SOURCE - src/Doublet.cc - src/TrkCaloHit.cc - src/TrkStrawHit.cc - LIBRARIES PUBLIC - - Offline::RecoDataProducts - Offline::TrackerConditions - Offline::TrackerGeom -) - -install_source(SUBDIRS src) -install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/BTrkData/inc/Doublet.hh b/BTrkData/inc/Doublet.hh deleted file mode 100644 index ce634133b4..0000000000 --- a/BTrkData/inc/Doublet.hh +++ /dev/null @@ -1,82 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// utilities for the Module to perform BaBar Kalman fit -// 2015 - 02 - 17 G. Pezzullo created class for housing the straw hits doublets -// -/////////////////////////////////////////////////////////////////////////////// -/* -#ifndef BTrkData_Doublet_hh -#define BTrkData_Doublet_hh - -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" - -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/BTrkLegacy/HelixParams.hh" - -// C++ -#include - -using namespace std; - -namespace mu2e { - - class Doublet{ - public: - enum { kMaxNHits = 9, - kMaxNComb = 4 - } ; - - int fIndex; // doublet index in the list - int fStationId; - int fPanelId; - CLHEP::Hep3Vector fShDir; - int fNStrawHits; - int fOldAmbig [kMaxNHits]; - int fStrawAmbig[kMaxNHits]; - CLHEP::Hep3Vector fTrkDir [kMaxNHits]; - CLHEP::Hep3Vector fTrkPos [kMaxNHits]; - mu2e::TrkStrawHit* fHit [kMaxNHits]; - double fMcDoca [kMaxNHits]; // signed MC distance of closest approach - int fHitIndex [2]; // indices of the used pair of hits - double fTrkDxDz; // track dx/dz in the local panel frame - double fDxDz [kMaxNComb]; // combinations - double fChi2Slope [kMaxNComb]; // - double fChi2Coord [kMaxNComb]; // - double fChi2 [kMaxNComb]; // - int fIBest; // best combination - int fINext; // next best combination - int fOs; // 0:opposite sign, +/-2:same sign -//----------------------------------------------------------------------------- -// constructors and such -//----------------------------------------------------------------------------- - Doublet(); - Doublet(int index, - int station, int panel, - CLHEP::Hep3Vector shdir, - CLHEP::Hep3Vector trkdir, - CLHEP::Hep3Vector trkpos, - TrkStrawHit* hit); - - double chi2Best () const { return fChi2 [fIBest]; } - double chi2SlopeBest() const { return fChi2Slope[fIBest]; } - double chi2CoordBest() const { return fChi2Coord[fIBest]; } - - void addStrawHit(CLHEP::Hep3Vector trkdir, - CLHEP::Hep3Vector trkpos, - TrkStrawHit* hit); - - int isSameSign() const { return (fIBest == 0) || (fIBest == 2) ; } - - double bestDxDz () const { return fDxDz[fIBest]; } - double trkDxDz () const { return fTrkDxDz; } - double bestDxDzRes() const { return fTrkDxDz-fDxDz[fIBest];} - - }; - - typedef std::vector DoubletCollection; -} - -#endif -*/ diff --git a/BTrkData/inc/TrkCaloHit.hh b/BTrkData/inc/TrkCaloHit.hh deleted file mode 100644 index 1e627a7d9b..0000000000 --- a/BTrkData/inc/TrkCaloHit.hh +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef TrkCaloHit_HH -#define TrkCaloHit_HH -// BaBar -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "BTrk/TrkBase/TrkDifPieceTraj.hh" -#include "BTrk/TrkBase/TrkHit.hh" - -#include "Offline/RecoDataProducts/inc/HitT0.hh" -// Mu2e -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/TrackerGeom/inc/Straw.hh" -// CLHEP -#include "CLHEP/Vector/ThreeVector.h" -// c++ -#include -// forward refs -class TrkDifTraj; -class TrkDifPieceTraj; - -namespace mu2e -{ - class TrkCaloHit : public TrkHit { - public: - TrkCaloHit(CaloCluster const& caloCluster, CLHEP::Hep3Vector const& caloClusterPos, - double crystalLength, CLHEP::Hep3Vector const& clusterAxis, - const HitT0& trkt0, double fltlen, double timeWeight, - double hiterr, double terr, double _dtoffset); - virtual ~TrkCaloHit(); -// implementation of TrkHit interface - virtual const TrkLineTraj* hitTraj() const { return _hittraj; } - -// correct the hit time - virtual double time () const; -// virtual bool time (HitT0&t0); - virtual void hitPosition (CLHEP::Hep3Vector& hpos) const; - virtual bool signalPropagationTime( TrkT0& t0); // this function should be const FIXME!!! - // the followin function isn't used and should be removed FIXME! - virtual void trackT0Time (double& htime, double t0flt, const TrkDifPieceTraj* ptraj, double vflt); - // test the consistincy of this hit with 'physical' limts, with a given # of sigma - virtual bool isPhysical (double maxchi) const; - -// intrinsic hit error (mm) - double hitErr () const { return _hitErr; } - - void print (std::ostream& ) const; -// caloCluster specific interface - const CaloCluster& caloCluster() const { return _caloCluster; } - double timeOffset() const { return _dtoffset; } - double timeErr() const { return _tErr; } - protected: - virtual TrkErrCode updateMeasurement(const TrkDifTraj* traj); - - const CaloCluster& _caloCluster; - double _clen; // crystal length - double _dtoffset; - TrkLineTraj* _hittraj; - double _hitErr; // geometric error on the cluster transverse position for POCA calculation - double _tErr; // error on the calorimeter time - }; - -// define TrkStrawHitVector, to allow explicit conversion and construction - typedef std::vector TrkCaloHitVector; -// utility function to convert vector of TrkHits into TrkCaloHits - void convert(TrkHitVector const& thv, TrkCaloHitVector& tshv); -} - -#endif diff --git a/BTrkData/inc/TrkStrawHit.hh b/BTrkData/inc/TrkStrawHit.hh deleted file mode 100644 index b9e45d2654..0000000000 --- a/BTrkData/inc/TrkStrawHit.hh +++ /dev/null @@ -1,126 +0,0 @@ - -// BaBar hit object corresponding to a single straw hit -// -// Original author David Brown, LBNL -// -#ifndef TrkStrawHit_HH -#define TrkStrawHit_HH -// BTrk -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "BTrk/TrkBase/TrkDifPieceTraj.hh" -#include "BTrk/TrkBase/TrkHit.hh" -#include "Offline/BTrkLegacy/inc/TrkT0.hh" -// Mu2e -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/TrackerGeom/inc/Straw.hh" -#include "Offline/TrackerConditions/inc/StrawResponse.hh" -// CLHEP -#include "CLHEP/Vector/ThreeVector.h" -// c++ -#include -#include -// forward refs -class TrkDifTraj; -class TrkDifPieceTraj; - -namespace mu2e -{ - class TrkStrawHit : public TrkHit { - public: - // enum for hit flags - TrkStrawHit(StrawResponse::cptr_t strawResponse, - const ComboHit& strawhit, const Tracker& tracker,StrawHitIndex index, - const TrkT0& trkt0, double fltlen, double maxdriftpull, - double timeWeight); - virtual ~TrkStrawHit(); -// implementation of TrkHit interface - virtual const TrkLineTraj* hitTraj() const { return _hittraj; } - int ambig() const { return _iamb; } - virtual void setAmbig(int newambig); - StrawHitIndex index() const { return _index; } // index into StrawHit vector - double hitRMS() const { return _rdrifterr;} -// strawhit specific interface - const ComboHit& comboHit() const { return _combohit; } - const Straw& straw() const { return _straw; } - virtual double time() const { return _combohit.time(); } - // virtual bool time(HitT0& t0) ;// 2019-04-22: GIANIPEZ change - StrawEnd const& earlyEnd() const { return _combohit.earlyEnd(); } - double driftTime() const; // drift time for the current end strategy - double driftPhi() const { return _phi;} - double driftRadius() const { return _rdrift;} - double driftRadiusErr() const { return _rdrifterr;} - double driftVelocity() const { return _vdriftinst; } - double timeDiffDist() const { return _combohit.wireDist(); } - double timeDiffDistErr() const { return _combohit.wireRes(); } - const CLHEP::Hep3Vector& wirePosition() const { return _wpos; } - void hitPosition(CLHEP::Hep3Vector& hpos) const; - virtual bool signalPropagationTime( TrkT0& t0 ); // time and error - virtual void trackT0Time(double &htime, double t0flt, const TrkDifPieceTraj* ptraj, double vflt); - - double signalTime() const { return _stime; } // time for signal to reach the end of the wire -// error to penalize mis-assigned ambiguity - double penaltyErr() const { return _penerr; } -// error ON RDrift and residual coming from hit t0 error - double t0Err() const { return hitT0()._t0err*_vdriftinst; } -// total error - double totalErr() const { return _toterr; } -// intrinsic hit error (mm) - virtual double hitErr() const { return _rdrifterr; } - // test the consistincy of this hit with 'physical' limts, with a given # of sigma - virtual bool isPhysical(double maxchi) const; - virtual void print(std::ostream& ) const; - - //************************************************** - // SET VALUES - //************************************************** - // set the penalty error: this is set when we can't resolve the ambiguity - void setPenalty(double penerr) { _penerr = penerr; } - - protected: - - virtual TrkErrCode updateMeasurement(const TrkDifTraj* traj); - virtual void updateDrift(); - virtual void updateSignalTime(); - //private: - - StrawResponse::cptr_t _strawResponse; - - const ComboHit& _combohit; - const Straw& _straw; - double _rstraw; // straw radius; cached from Tracker - StrawHitIndex _index; - TrkLineTraj* _hittraj; - CLHEP::Hep3Vector _wpos; - CLHEP::Hep3Vector _wpos_err; - double _penerr,_toterr; - int _iamb; - double _rdrift; - double _rdrifterr; - double _phi; - double _vdriftinst; - double _vprop; // effective signal propagation velocity - double _stime; // signal propagation time - double _maxdriftpull; - - }; - -// binary functor to sort TrkStrawHits by StrawHit index - struct indexcomp { - bool operator()(const TrkStrawHit* x,const TrkStrawHit* y) { return x->index() < y->index(); } - }; - -// unary functor to select TrkStrawHit from a given hit - struct FindTrkStrawHit { - FindTrkStrawHit(ComboHit const& strawhit) : _combohit(strawhit) {} - bool operator () (TrkStrawHit* const& tsh ) { return &tsh->comboHit() == &_combohit; } - ComboHit const& _combohit; - }; -// define TrkStrawHitVector, to allow explicit conversion and construction - typedef std::vector TrkStrawHitVector; -// utility function to convert vector of TrkHits into TrkStrawHits - void convert(TrkHitVector const& thv, TrkStrawHitVector& tshv); -} - -#endif diff --git a/BTrkData/src/Doublet.cc b/BTrkData/src/Doublet.cc deleted file mode 100644 index 0e8678216a..0000000000 --- a/BTrkData/src/Doublet.cc +++ /dev/null @@ -1,95 +0,0 @@ -// -/* -#include "Offline/BTrkData/inc/Doublet.hh" - - -namespace mu2e { - -//----------------------------------------------------------------------------- -// make sure neither number makes sense upon initialization -//----------------------------------------------------------------------------- - Doublet::Doublet() { - fIndex = -1; - fStationId = -1; - fPanelId = -1; - fShDir.set(0,0,0); - fNStrawHits = -1.; - for (int i=0; i - -using namespace std; -using CLHEP::Hep3Vector; - -namespace mu2e -{ - TrkCaloHit::TrkCaloHit(CaloCluster const& caloCluster, Hep3Vector const& caloClusterPos, - double crystalLength, Hep3Vector const& clusterAxis, - const HitT0& hitt0,double fltlen, double timeWeight, - double hiterr, double terr, double dtoffset) : - _caloCluster(caloCluster), _clen(crystalLength), - _dtoffset(dtoffset), - _hitErr(hiterr) , _tErr(terr) - { -// the hit trajectory is defined as a line segment directed along the cluster axis - _hittraj = new TrkLineTraj(HepPoint(caloClusterPos.x(), caloClusterPos.y(), caloClusterPos.z()), - clusterAxis, 0.0, crystalLength); - setHitLen(0.5*crystalLength); // approximpate - setFltLen(fltlen); -// compute initial hit t0 - setHitT0(hitt0); - setActivity(true); - - sett0Weight(timeWeight); -// std::cout << "creating TrkCaloHit " << this << std::endl; - } - - - TrkCaloHit::~TrkCaloHit(){ -// delete the trajectory - delete _hittraj; - _parentRep=0; - } - - - //2019-05-02 Gianipez: the following function will change meaning in the near future. FIXME! - double - TrkCaloHit::time() const{ - return caloCluster().time() + _dtoffset; // following Pasha's convention - } - - // bool - // TrkCaloHit::time(HitT0& t0) const{ - // HitT0 st0; - // if (signalPropagationTime(st0)){ - // t0._t0 = caloCluster().time() - st0._t0 -_dtoffset; - // t0._t0err = st0._t0err; - // return true; - // }else { - // return false; - // } - // } - - TrkErrCode - TrkCaloHit::updateMeasurement(const TrkDifTraj* traj) { - TrkErrCode status(TrkErrCode::fail); - // find POCA to the wire - updatePoca(traj); - if( poca().status().success()) { -// check the cluster distance to make sure we're on the right loop - if(hitLen() < _hittraj->lowRange() || hitLen() > 1.5*_hittraj->hiRange()){ - double cost = traj->direction(fltLen()).dot(_hittraj->direction(hitLen())); - double smax = 0.5*_hittraj->hiRange(); // approximate shwowermax - double dflt = (hitLen()-smax)/cost; - setFltLen(fltLen() - dflt); - setHitLen(smax); - updatePoca(traj); - } - status = poca().status(); - double residual = poca().doca(); - setHitResid(residual); - double totErr = _hitErr; // geometric error is unaffected by temperature - setHitRms(totErr); - } else { -// cout << "TrkCaloHit:: updateMeasurement() failed" << endl; - setFlag(updateFail); - setHitResid(999999); - setHitRms(999999); - setActivity(false); - } - return status; - } - - void - TrkCaloHit::hitPosition(CLHEP::Hep3Vector& hpos) const{ - hpos.setX(hitTraj()->position(hitLen()).x()); - hpos.setY(hitTraj()->position(hitLen()).y()); - hpos.setZ(hitTraj()->position(hitLen()).z()); - //hpos = _caloClusterPos; - } - - - bool TrkCaloHit::signalPropagationTime(TrkT0& t0) { - // compute the light propagation time. - // light propagation velocity should come from configuration FIXME! - static const double vlprop =200.0; // mm/nsec Needs better calibration FIXME!! - double tlight =0.0; - if(poca().status().success()){ -// time for light to get to SIPMs at the back of the crystals, bounded by crystal length - double clen = _clen-std::min(_clen,std::max(0.0,poca().flt2())); - tlight = clen/vlprop; - } - t0._t0 = tlight; - t0._t0err = _tErr; // intrinsic error on time, used in T0 updating. - //Contribution from the uncertainty of the light propagation is below 100 ps - - return true;//FIXME! - } - -// this function isn't used and needs to be removed FIXME! - void - TrkCaloHit::trackT0Time(double& htime, double t0flt, const TrkDifPieceTraj* ptraj, double vflt){ - throw cet::exception("RECO")<<"mu2e::TrkCaloHit: obsolete function"<< endl; - } - - bool - TrkCaloHit::isPhysical(double maxchi) const { - return true;//FIXME! - } - - void TrkCaloHit::print(std::ostream& o) const { - o<<"------------------- TrkCaloHit -------------------"<(*ith); - if(tsh != 0) tshv.push_back(tsh); - } - } - -} diff --git a/BTrkData/src/TrkStrawHit.cc b/BTrkData/src/TrkStrawHit.cc deleted file mode 100644 index a9ee11b402..0000000000 --- a/BTrkData/src/TrkStrawHit.cc +++ /dev/null @@ -1,272 +0,0 @@ -// -// BaBar hit object corresponding to a single straw hit -// -// Original author David Brown, LBNL -// -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -// BTrk -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/TrkBase/TrkErrCode.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/TrkDifTraj.hh" -#include "BTrk/TrkBase/TrkDifPieceTraj.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/TrkHit.hh" -// -#include "CLHEP/Vector/ThreeVector.h" - -#include "cetlib_except/coded_exception.h" -#include - -using namespace std; -using CLHEP::Hep3Vector; - -namespace mu2e -{ - TrkStrawHit::TrkStrawHit(StrawResponse::cptr_t strawResponse, - const ComboHit& strawhit , Tracker const& tracker, StrawHitIndex index, - const TrkT0& hitt0 , double fltlen , double maxdriftpull, - double timeWeight) : - _strawResponse(strawResponse), - _combohit(strawhit), - _straw(tracker.getStraw(strawhit.strawId())), - _rstraw(tracker.strawOuterRadius()), - _index(index), - _penerr(0.0), - _toterr(0.0), - _iamb(0), - _maxdriftpull(maxdriftpull) - { -// make sure this ComboHit represents only a single straw hit - if(_combohit.nStrawHits() != 1 || _combohit.earlyEnd() == StrawEnd::unknown) - throw cet::exception("RECO")<<"mu2e::TrkStrawHit: ComboHit > 1 StrawHit"<< endl; - // The StrawResponse should be passsed in from outside FIXME! - Hep3Vector const& wiredir = _straw.getDirection(); - Hep3Vector const& mid = _straw.getMidPoint(); - // cache the propagation velocity: this depends just on the pulseheight - _vprop = 2.0*_strawResponse->halfPropV(_combohit.strawId(),1000.0*_combohit.energyDep()); // edep in KeV, FIXME! - // initialize wire position using time difference - _wpos = mid +_combohit.wireDist()*wiredir; -// the hit trajectory is defined as a line segment directed along the wire direction starting from the wire center -// ugly conversion to HepPoint FIXME! - _hittraj = new TrkLineTraj(HepPoint(mid.x(),mid.y(),mid.z()),wiredir, - timeDiffDist()-timeDiffDistErr(), - timeDiffDist()+timeDiffDistErr()); - setHitLen(timeDiffDist()); - setFltLen(fltlen); -// update electroncs signal propagation time - updateSignalTime(); -// compute initial hit t0 and drift -// updateHitT0(hitt0); - setHitT0(hitt0); - setHitRms(1.e-6); // to make sure that the print routine bomb if called from SeedFit - setActivity(true); - sett0Weight(timeWeight); - setTemperature(0.0); // initially no temperature - } - - - TrkStrawHit::~TrkStrawHit(){ -// delete the trajectory - delete _hittraj; - _parentRep=0; - } - - double - TrkStrawHit::driftTime() const { - return comboHit().time() - _stime - hitT0()._t0; - } - - - // bool TrkStrawHit::time( TrkT0& t0 ) { - // HitT0 st0; - // if (signalPropagationTime(st0)){ - // t0._t0 = comboHit().time() - st0._t0; - // t0._t0err = st0._t0err; - // return true; - // }else { - // return false; - // } - // } - - - bool TrkStrawHit::signalPropagationTime( TrkT0& t0 ){ -// propagation includes drift and signal propagation along the wire. First, compute the drift -// time from the distance of closest approach -// correct this for the most recent fit, excluding the effect of this hit on the fit - double resid, residerr; - bool retval = this->resid(resid,residerr,true); - if(retval ) { - double doca; - // 0-ambig hit residual is WRT the wire - if(_iamb == 0) - doca = fabs(resid); - else - doca = _rdrift + _iamb*resid; - // restrict the range, symmetrically to avoid bias - double mint0doca = _strawResponse->BTrk_Mint0doca(); - if(doca > mint0doca && doca < _rstraw-mint0doca){ - // compute phi WRT BField for lorentz drift. - CLHEP::Hep3Vector trjDir(parentRep()->traj().direction(fltLen())); - Hep3Vector tperp = trjDir - trjDir.dot(straw().getDirection())*straw().getDirection(); - double phi = tperp.theta(); // This assumes B along z, FIXME! - // translate the DOCA into a time - double tdrift = _strawResponse->BTrk_driftDistanceToTime(_combohit.strawId(), doca, phi); - double vdrift = _strawResponse->BTrk_driftInstantSpeed(_combohit.strawId(),doca, phi); - t0._t0 = tdrift + _stime; - t0._t0err = residerr/vdrift;// instantaneous velocity to translate the error on the residual - } else { - retval = false; - } - } - return retval; - } - - void - TrkStrawHit::trackT0Time(double &Htime, double T0flt, const TrkDifPieceTraj* Ptraj, double Vflt){ - throw cet::exception("RECO")<<"mu2e::TrkStrawHit: obsolete function"<< endl; - } - - void - TrkStrawHit::updateDrift() { -// compute the drift time - double tdrift = driftTime(); -// find the track direction at this hit - Hep3Vector tdir = getParentRep()->traj().direction(fltLen()); -// convert time to distance. This computes the intrinsic drift radius error as well - - Hep3Vector tperp = tdir - tdir.dot(straw().getDirection())*straw().getDirection(); - _phi = tperp.theta(); - _rdrift = _strawResponse->BTrk_driftTimeToDistance(_combohit.strawId(),tdrift,_phi); - _vdriftinst = _strawResponse->BTrk_driftInstantSpeed(_combohit.strawId(),fabs(poca().doca()),_phi); - double vdriftconst = _strawResponse->driftConstantSpeed(); - _rdrifterr = _strawResponse->BTrk_driftDistanceError(_combohit.strawId(),fabs(poca().doca()),_phi); - -// Propogate error in t0, using local drift velocity - double rt0err = hitT0()._t0err*_vdriftinst; - // annealing error depends on the 'temperature' - double exterr = vdriftconst*temperature(); - // total hit error is the sum of all - _toterr = sqrt(_rdrifterr*_rdrifterr + rt0err*rt0err + exterr*exterr + _penerr*_penerr); -// If the hit is wildly away from the track , disable it - if(!isPhysical(_maxdriftpull)){ - setActivity(false); - setFlag(driftFail); - } else { -// otherwise restrict to a physical range - if (_rdrift < 0.0){ - _rdrift = 0.0; - } else if( _rdrift > _rstraw){ - _rdrift = _rstraw; - } - } - } - - bool TrkStrawHit::isPhysical(double maxchi) const { - return _rdrift < _rstraw + maxchi*_toterr && - _rdrift > -maxchi*_toterr; - } - - void - TrkStrawHit::updateSignalTime() { -// compute the electronics propagation time for the 2 ends. -// note: the wire (U) direction points from HV to Cal (Duke convention) - if( poca().status().success()){ - switch (_combohit.earlyEnd()) { - case StrawEnd::cal: - _stime = (straw().halfLength()+hitLen())/_vprop; - break; - case StrawEnd::hv: - _stime = (straw().halfLength()-hitLen())/_vprop; - break; - } - } else { -// if we're missing poca information, use time division instead - switch (_combohit.earlyEnd()) { - case StrawEnd::cal: - _stime = (straw().halfLength()+timeDiffDist())/_vprop; - break; - case StrawEnd::hv: - _stime = (straw().halfLength()-timeDiffDist())/_vprop; - break; - } - } - } - - void - TrkStrawHit::setAmbig(int newambig){ -// if the state changes and the hit is active, warn the rep - if(isActive() && newambig != _iamb && parentRep() != 0){ - parentRep()->setCurrent(false); -// std::cout << "changing hit ambiguity " << std::endl; - } - if(newambig > 0) - _iamb = 1; - else if(newambig < 0) - _iamb = -1; - else - _iamb = 0; - } - - TrkErrCode - TrkStrawHit::updateMeasurement(const TrkDifTraj* traj) { - TrkErrCode status(TrkErrCode::fail); -// find POCA to the wire - updatePoca(traj); - if( poca().status().success()) { - status = poca().status(); -// update the signal propagation time along the wire - updateSignalTime(); -// update the drift distance using this traj direction - updateDrift(); -// sign drift distance by ambiguity. Note that an ambiguity of 0 means to ignore the drift - double residual = poca().doca() - _rdrift*_iamb; - setHitResid(residual); - setHitRms(_toterr); - } else { -// cout << "TrkStrawHit:: updateMeasurement() failed" << endl; - setFlag(updateFail); - setHitResid(999999); - setHitRms(999999); - setActivity(false); - } - return status; - } - - void - TrkStrawHit::hitPosition(Hep3Vector& hpos) const{ - if( poca().status().success() && _iamb!=0){ - Hep3Vector pdir = (trkTraj()->position(fltLen()) - hitTraj()->position(hitLen())).unit(); - hpos = _wpos + pdir*_rdrift*_iamb; - } else { - hpos = _wpos; - } - } - - - void TrkStrawHit::print(std::ostream& o) const { - o<<"------------------- TrkStrawHit -------------------"<(*ith); - if(tsh != 0) tshv.push_back(tsh); - } - } - -} diff --git a/BTrkLegacy/CMakeLists.txt b/BTrkLegacy/CMakeLists.txt index 298627eb8a..416e71bc4a 100644 --- a/BTrkLegacy/CMakeLists.txt +++ b/BTrkLegacy/CMakeLists.txt @@ -1,8 +1,10 @@ cet_make_library( SOURCE - src/ExternalInfo.cc src/TrkParticle.cc LIBRARIES PUBLIC + Offline::DataProducts + Offline::GeneralUtilities + Offline::GlobalConstantsService ) install_source(SUBDIRS src) diff --git a/BTrkLegacy/inc/ExternalInfo.hh b/BTrkLegacy/inc/ExternalInfo.hh deleted file mode 100644 index 6eb88a720d..0000000000 --- a/BTrkLegacy/inc/ExternalInfo.hh +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef BaBar_ExternalInfo -#define BaBar_ExternalInfo - -// -// Manage access to externally supplied information. -// - -class FileFinderInterface; -class ParticleInfoInterface; - -class ExternalInfo { - -public: - - // It is not possible to make an object of this type. - // All information is accessed via static member functions. - ExternalInfo () = delete; - ~ExternalInfo () = delete; - ExternalInfo ( ExternalInfo const& ) = delete; - ExternalInfo ( ExternalInfo&& ) = delete; - ExternalInfo& operator= ( ExternalInfo const& ) = delete; - ExternalInfo& operator= ( ExternalInfo&& ) = delete; - - // Checked and unchecked accessors. - static FileFinderInterface const* fileFinderInstance(); - static FileFinderInterface const* uncheckedFileFinderInstance(){ - return _findFile; - } - - static ParticleInfoInterface const* particleInfoInstance(); - static ParticleInfoInterface const* uncheckedParticleInfoInstance(){ - return _particleInfo; - } - - // Setters - static void set ( FileFinderInterface const* findFile ){ - _findFile = findFile; - } - - static void set ( ParticleInfoInterface const* particleInfo ){ - _particleInfo = particleInfo; - } - -private: - - // Non-owning pointers to externally managed objects. - static FileFinderInterface const* _findFile; - static ParticleInfoInterface const* _particleInfo; - -}; - -#endif // end BaBar_ExternalInfo diff --git a/BTrkLegacy/inc/ParticleInfo.hh b/BTrkLegacy/inc/ParticleInfo.hh deleted file mode 100644 index 89eed26fca..0000000000 --- a/BTrkLegacy/inc/ParticleInfo.hh +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef BTrkHelper_ParticleInfo_hh -#define BTrkHelper_ParticleInfo_hh - -// -// Supply information about particles to the btrk code. -// - btrk code makes calls indexed by TrkParicle::type. -// - PDT is indexed by PDGCode::type -// This code looks after the translation and caches results. -// - -#include "Offline/GlobalConstantsService/inc/ParticleData.hh" - -#include "Offline/BTrkLegacy/inc/ParticleInfoInterface.hh" - -#include -#include - -namespace mu2e { - - class ParticleDataList; - - class ParticleInfo : public ParticleInfoInterface { - - public: - - ParticleInfo(); - - double mass ( TrkParticle::type id ) const override { - return getParticle(id)->mass(); - } - - double charge( TrkParticle::type id ) const override { - return getParticle(id)->charge(); - } - - std::string name ( TrkParticle::type id ) const override { - return getParticle(id)->name(); - } - - private: - - //the following has to be mutable because BTrk holds this - //with a const pointer - - // Guaranteed valid throughout the job. - ParticleDataList const& pdt_; - - // Local cache of the information for particles that we care about; - // indexed by TrkParticle::type, not by PDG::id. - mutable std::map table_; - - // Find particle data in the local cache; fault to the full cache as needed. - ParticleData const* getParticle( TrkParticle::type ) const; - - }; -} - -#endif /* btrkHelper_ParticleInfo_hh */ diff --git a/BTrkLegacy/inc/ParticleInfoInterface.hh b/BTrkLegacy/inc/ParticleInfoInterface.hh deleted file mode 100644 index d527c69dd7..0000000000 --- a/BTrkLegacy/inc/ParticleInfoInterface.hh +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ParticleInfoInterface_hh -#define ParticleInfoInterface_hh - -// -// Definition of an interface for information that must be -// supplied by external code. -// - -// FIMXE: -// This generates a compile time circular dependence - it needs to know the type -// of TrkParticle::type. It does NOT generate a link time or run time circular depennndence. -#include "BTrkLegacy/inc/TrkParticle.hh" - -#include - -class ParticleInfoInterface { - -public: - - virtual double mass ( TrkParticle::type ) const = 0; - virtual double charge( TrkParticle::type ) const = 0; - virtual std::string name ( TrkParticle::type ) const = 0; - -protected: - ParticleInfoInterface(){} - virtual ~ParticleInfoInterface(){} - -}; - -#endif // end ParticleInfoInterface_hh diff --git a/BTrkLegacy/inc/TrkParticle.hh b/BTrkLegacy/inc/TrkParticle.hh index 3f7fd9709d..f164441cbd 100644 --- a/BTrkLegacy/inc/TrkParticle.hh +++ b/BTrkLegacy/inc/TrkParticle.hh @@ -1,5 +1,6 @@ // Class to define particle types which can be reconstructed as tracks. // the type values are copied from the PDG codes. +// this class is DEPRECATED AND SHOULD NOT BE USED IN ANY NEW CODE. New codes needing this functionality should use PartcleDataList #ifndef TrkParticle_hh #define TrkParticle_hh #include @@ -8,42 +9,42 @@ class TrkParticle { public: - enum type { - e_minus = 11 , - e_plus = -11 , - mu_minus = 13 , - mu_plus = -13 , - pi_plus = 211 , - pi_minus = -211 , - K_plus = 321 , - K_minus = -321 , - p_plus = 2212 , - anti_p_minus = -2212, - deuterium = 1000010020, - tritium = 1000010030, - He3 = 1000020030, - He4 = 100002004 - }; -// construct from a type - TrkParticle(type ptype=e_minus); - TrkParticle(TrkParticle const& other); - ~TrkParticle(); -// basic accessor - type particleType() const { return _type; } - bool operator == (TrkParticle const& other) const { return _type == other._type; } - bool operator != (TrkParticle const& other) const { return ! this->operator==(other); } - TrkParticle & operator =(TrkParticle const& other); -// return basic information - double mass() const; - double charge() const; - std::string const& name() const; -// basic kinematics; provide momentum in CLHEP units - double energy(double momentum) const; // return value in CLHEP units - double beta(double momentum) const; - double betagamma(double momentum) const; - double gamma(double momentum) const; + enum type { + e_minus = 11 , + e_plus = -11 , + mu_minus = 13 , + mu_plus = -13 , + pi_plus = 211 , + pi_minus = -211 , + K_plus = 321 , + K_minus = -321 , + p_plus = 2212 , + anti_p_minus = -2212, + deuterium = 1000010020, + tritium = 1000010030, + He3 = 1000020030, + He4 = 100002004 + }; + // construct from a type + TrkParticle(type ptype=e_minus); + TrkParticle(TrkParticle const& other); + ~TrkParticle(); + // basic accessor + type particleType() const { return _type; } + bool operator == (TrkParticle const& other) const { return _type == other._type; } + bool operator != (TrkParticle const& other) const { return ! this->operator==(other); } + TrkParticle & operator =(TrkParticle const& other); + // return basic information + double mass() const; + double charge() const; + std::string const& name() const; + // basic kinematics; provide momentum in CLHEP units + double energy(double momentum) const; // return value in CLHEP units + double beta(double momentum) const; + double betagamma(double momentum) const; + double gamma(double momentum) const; private: - type _type; + type _type; }; -#endif \ No newline at end of file +#endif diff --git a/BTrkLegacy/src/ExternalInfo.cc b/BTrkLegacy/src/ExternalInfo.cc deleted file mode 100644 index df996f17e7..0000000000 --- a/BTrkLegacy/src/ExternalInfo.cc +++ /dev/null @@ -1,16 +0,0 @@ -#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" - -#include - -FileFinderInterface const* ExternalInfo::_findFile = nullptr; -ParticleInfoInterface const* ExternalInfo::_particleInfo = nullptr; - -FileFinderInterface const* ExternalInfo::fileFinderInstance(){ - if ( _findFile != nullptr ) return _findFile; - throw std::runtime_error("BaBar ExternalInfo::fileFinderInstance: instance pointer is null"); -} - -ParticleInfoInterface const* ExternalInfo::particleInfoInstance(){ - if ( _particleInfo != nullptr ) return _particleInfo; - throw std::runtime_error("BaBar ExternalInfo::particleInfoInstance: instance pointer is null"); -} diff --git a/BTrkLegacy/src/TrkParticle.cc b/BTrkLegacy/src/TrkParticle.cc index a25184ec63..148c6b8859 100644 --- a/BTrkLegacy/src/TrkParticle.cc +++ b/BTrkLegacy/src/TrkParticle.cc @@ -1,9 +1,10 @@ // particle description used for tracking // the implementation depends on the mu2e conditions service, but // not the interface -#include "Offline/BTrkLegacy/TrkParticle.hh" -#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" -#include "Offline/BTrkLegacy/inc/ParticleInfoInterface.hh" +#include "Offline/BTrkLegacy/inc/TrkParticle.hh" +#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" +#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" +#include "Offline/DataProducts/inc/PDGCode.hh" #include @@ -24,33 +25,45 @@ TrkParticle::operator =(TrkParticle const& other) { } +using mu2e::PDGCodeDetail; +using mu2e::ParticleDataList; +using mu2e::GlobalConstantsHandle; double TrkParticle::mass() const { -// avoid calling the Particle Data table on each call by buffering results in statics + static bool first=true; + static double e_mass; + static double mu_mass; + static double pi_mass; + static double K_mass; + static double p_mass; + if(first){ + auto const& ptable = GlobalConstantsHandle(); + e_mass = ptable->particle(PDGCodeDetail::e_plus).mass(); + mu_mass = ptable->particle(PDGCodeDetail::mu_plus).mass(); + pi_mass = ptable->particle(PDGCodeDetail::pi_plus).mass(); + K_mass = ptable->particle(PDGCodeDetail::K_plus).mass(); + p_mass = ptable->particle(PDGCodeDetail::proton).mass(); + first = false; + } double retval(-1.0); switch (_type) { case e_minus: case e_plus: { - static double e_mass = ExternalInfo::particleInfoInstance()->mass( e_plus ); return e_mass; } case mu_minus: case mu_plus: { - static double mu_mass = ExternalInfo::particleInfoInstance()->mass( mu_plus ); return mu_mass; } case pi_minus: case pi_plus: { - static double pi_mass = ExternalInfo::particleInfoInstance()->mass( pi_plus ); return pi_mass; } case K_minus: case K_plus: { - static double K_mass = ExternalInfo::particleInfoInstance()->mass( K_plus ); return K_mass; } case anti_p_minus: case p_plus: { - static double p_mass = ExternalInfo::particleInfoInstance()->mass( p_plus ); return p_mass; } @@ -62,19 +75,24 @@ TrkParticle::mass() const { double TrkParticle::charge() const { -// avoid calling the Particle Data table on each call by buffering results in statics + static bool first=true; + static double minus_charge; + static double plus_charge; + if(first){ + auto const& ptable = GlobalConstantsHandle(); + minus_charge = ptable->particle(PDGCodeDetail::e_minus).charge(); + plus_charge = ptable->particle(PDGCodeDetail::e_plus).charge(); + first = false; + } double retval(0.0); switch (_type) { case e_minus: case mu_minus: case pi_minus: case K_minus: case anti_p_minus: { - static double minus_charge = ExternalInfo::particleInfoInstance()->charge( e_minus ); return minus_charge; } case e_plus: case mu_plus: case pi_plus: case K_plus: case p_plus: { - static double plus_charge = ExternalInfo::particleInfoInstance()->charge( e_plus ); return plus_charge; } - default: { } } @@ -84,8 +102,6 @@ TrkParticle::charge() const { std::string const& TrkParticle::name() const { -// I can't use HepPDT for the names as those include Latex characters and so conflict -// with many standard software lexicons (like root). switch (_type) { case e_minus: { static std::string e_minus_name = "eMinus"; diff --git a/CMakeLists.txt b/CMakeLists.txt index f7c2085f53..429a629c98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ endif() # empty defaults to off option(BUILD_PYTHON_INTERFACE "Generate Python bindings via SWIG" FALSE) -if( BUILD_PYTHON_INTERFACE ) +if( BUILD_PYTHON_INTERFACE ) message("--> Adding SWIG calls to generate Python interface") find_package(SWIG REQUIRED EXPORT) include(${SWIG_USE_FILE}) @@ -94,17 +94,17 @@ if( BUILD_PYTHON_INTERFACE ) if(NOT Python3_FOUND) message(FATAL_ERROR "Python3 not found. Please install Python3 development files.") endif() - + # Define these ONCE here so they are available everywhere set(PYTHON_VER "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") set(PYTHON_INSTALL_DIR "lib/python${PYTHON_VER}/site-packages" CACHE INTERNAL "Python install destination") include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/build/cmake/Mu2eSwigHelper.cmake) - + message("--> Python install directory set to: ${PYTHON_INSTALL_DIR}") endif() -# BTrk and KinKal have non-standard Find*.cmake... +# KinKal has non-standard Find*.cmake... if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../KinKal/KinKalTargets.cmake) include(${CMAKE_CURRENT_BINARY_DIR}/../KinKal/KinKalTargets.cmake) endif() @@ -124,7 +124,6 @@ add_subdirectory(BFieldTest) add_subdirectory(Blinding) add_subdirectory(bin) add_subdirectory(boost_fix) -add_subdirectory(BTrkData) add_subdirectory(BTrkLegacy) add_subdirectory(CaloCluster) add_subdirectory(CaloConditions) @@ -174,7 +173,6 @@ add_subdirectory(MBSGeom) add_subdirectory(MCDataProducts) add_subdirectory(MECOStyleProtonAbsorberGeom) add_subdirectory(Mu2e) -add_subdirectory(Mu2eBTrk) if( ${WITH_G4} ) message("---> ADDING G4 DIRS") add_subdirectory(EventGenerator) @@ -213,14 +211,12 @@ add_subdirectory(STMReco) add_subdirectory(StoppingTargetGeom) add_subdirectory(TestTools) add_subdirectory(TEveEventDisplay) -add_subdirectory(TrackCaloMatching) add_subdirectory(TrackerConditions) add_subdirectory(TrackerConfig) add_subdirectory(TrackerGeom) add_subdirectory(TrackerMC) add_subdirectory(Trigger) add_subdirectory(TrkDiag) -add_subdirectory(TrkExt) add_subdirectory(TrkFilters) add_subdirectory(TrkHitReco) add_subdirectory(TrkPatRec) diff --git a/CRVResponse/test/CRVResponseDAQ.fcl b/CRVResponse/test/CRVResponseDAQ.fcl index 9baa017919..9d673e2b2a 100644 --- a/CRVResponse/test/CRVResponseDAQ.fcl +++ b/CRVResponse/test/CRVResponseDAQ.fcl @@ -8,7 +8,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponseDAQExtracted.fcl b/CRVResponse/test/CRVResponseDAQExtracted.fcl index 6f2bae72f2..800964f49d 100644 --- a/CRVResponse/test/CRVResponseDAQExtracted.fcl +++ b/CRVResponse/test/CRVResponseDAQExtracted.fcl @@ -8,7 +8,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponseExtracted.fcl b/CRVResponse/test/CRVResponseExtracted.fcl index bb5d5335ba..8e10ec7de3 100644 --- a/CRVResponse/test/CRVResponseExtracted.fcl +++ b/CRVResponse/test/CRVResponseExtracted.fcl @@ -8,7 +8,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponsePlot_v05.fcl b/CRVResponse/test/CRVResponsePlot_v05.fcl index 294033c587..cef37d6764 100644 --- a/CRVResponse/test/CRVResponsePlot_v05.fcl +++ b/CRVResponse/test/CRVResponsePlot_v05.fcl @@ -8,7 +8,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*", "drop *Crv*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponseReco.fcl b/CRVResponse/test/CRVResponseReco.fcl index bcb1c861ed..1a28f38182 100644 --- a/CRVResponse/test/CRVResponseReco.fcl +++ b/CRVResponse/test/CRVResponseReco.fcl @@ -9,7 +9,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponseRecoExtracted.fcl b/CRVResponse/test/CRVResponseRecoExtracted.fcl index 25a0c224c4..63e423261e 100644 --- a/CRVResponse/test/CRVResponseRecoExtracted.fcl +++ b/CRVResponse/test/CRVResponseRecoExtracted.fcl @@ -9,7 +9,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponse_v05.fcl b/CRVResponse/test/CRVResponse_v05.fcl index b9c4d36999..56770be046 100644 --- a/CRVResponse/test/CRVResponse_v05.fcl +++ b/CRVResponse/test/CRVResponse_v05.fcl @@ -8,7 +8,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*", "drop *Crv*_*_*_*"] } diff --git a/CRVResponse/test/CRVResponse_v07.fcl b/CRVResponse/test/CRVResponse_v07.fcl index 0d81134aa2..740d99dd48 100644 --- a/CRVResponse/test/CRVResponse_v07.fcl +++ b/CRVResponse/test/CRVResponse_v07.fcl @@ -8,7 +8,6 @@ source : { module_type : RootInput inputCommands: ["keep *", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/CalPatRec/CMakeLists.txt b/CalPatRec/CMakeLists.txt index 49e04fed03..f178a86cd1 100644 --- a/CalPatRec/CMakeLists.txt +++ b/CalPatRec/CMakeLists.txt @@ -12,9 +12,8 @@ cet_make_library( src/HlPrint_ComboHit.cc src/ProtonCandidate.cc LIBRARIES PUBLIC - + Offline::BFieldGeom - Offline::BTrkData Offline::CalorimeterGeom Offline::ConditionsService Offline::DataProducts @@ -31,7 +30,7 @@ cet_build_plugin(AgnosticHelixFinder art::module REG_SOURCE src/AgnosticHelixFinder_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::BFieldGeom Offline::CalorimeterGeom Offline::ConditionsService @@ -46,7 +45,7 @@ cet_build_plugin(CalHelixFinder art::module REG_SOURCE src/CalHelixFinder_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::BFieldGeom Offline::CalorimeterGeom Offline::ConditionsService @@ -61,7 +60,7 @@ cet_build_plugin(CalTimePeakFinder art::module REG_SOURCE src/CalTimePeakFinder_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::CalorimeterGeom Offline::ConditionsService Offline::ConfigTools @@ -75,7 +74,7 @@ cet_build_plugin(ComboHitFilter art::module REG_SOURCE src/ComboHitFilter_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::CalorimeterGeom Offline::ConditionsService Offline::GeometryService @@ -89,7 +88,7 @@ cet_build_plugin(DeltaFinderAna art::module REG_SOURCE src/DeltaFinderAna_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::ConditionsService Offline::DataProducts Offline::GeometryService @@ -102,7 +101,7 @@ cet_build_plugin(DeltaFinder art::module REG_SOURCE src/DeltaFinder_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::CalorimeterGeom Offline::ConditionsService Offline::GeometryService @@ -115,7 +114,7 @@ cet_build_plugin(PhiClusterFinder art::module REG_SOURCE src/PhiClusterFinder_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::ConfigTools Offline::GeneralUtilities Offline::Mu2eUtilities @@ -127,7 +126,7 @@ cet_build_plugin(PrefetchData art::module REG_SOURCE src/PrefetchData_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::ConditionsService Offline::GeometryService Offline::MCDataProducts @@ -140,7 +139,7 @@ cet_build_plugin(TZClusterFinder art::module REG_SOURCE src/TZClusterFinder_module.cc LIBRARIES REG Offline::CalPatRec - + Offline::ConfigTools Offline::Mu2eUtilities Offline::RecoDataProducts @@ -150,7 +149,7 @@ cet_build_plugin(CalHelixFinderDiag art::tool REG_SOURCE src/CalHelixFinderDiag_tool.cc LIBRARIES REG Offline::CalPatRec - + Offline::MCDataProducts Offline::Mu2eUtilities ) @@ -159,7 +158,7 @@ cet_build_plugin(AgnosticHelixFinderDiag art::tool REG_SOURCE src/AgnosticHelixFinderDiag_tool.cc LIBRARIES REG Offline::CalPatRec - + Offline::MCDataProducts Offline::Mu2eUtilities ) @@ -169,8 +168,7 @@ cet_build_plugin(CalTimePeakFinderDiag art::tool REG_SOURCE src/CalTimePeakFinderDiag_tool.cc LIBRARIES REG Offline::CalPatRec - - Offline::BTrkData + Offline::Mu2eUtilities Offline::RecoDataProducts Offline::TrackerGeom @@ -180,7 +178,7 @@ cet_build_plugin(DeltaFinderDiag art::tool REG_SOURCE src/DeltaFinderDiag_tool.cc LIBRARIES REG Offline::CalPatRec - + Offline::DataProducts Offline::MCDataProducts Offline::Mu2eUtilities @@ -190,7 +188,7 @@ cet_build_plugin(MergePatRecDiag art::tool REG_SOURCE src/MergePatRecDiag_tool.cc LIBRARIES REG Offline::CalPatRec - + Offline::Mu2eUtilities ) @@ -198,7 +196,7 @@ cet_build_plugin(PhiClusterFinderDiag art::tool REG_SOURCE src/PhiClusterFinderDiag_tool.cc LIBRARIES REG Offline::CalPatRec - + Offline::MCDataProducts Offline::Mu2eUtilities Offline::RecoDataProducts @@ -214,7 +212,7 @@ cet_build_plugin(TZClusterFinderDiag art::tool REG_SOURCE src/TZClusterFinderDiag_tool.cc LIBRARIES REG Offline::CalPatRec - + Offline::MCDataProducts Offline::Mu2eUtilities Offline::RecoDataProducts diff --git a/CalPatRec/inc/CalTimePeakFinder_module.hh b/CalPatRec/inc/CalTimePeakFinder_module.hh index b884c91732..99fbfa00c3 100644 --- a/CalPatRec/inc/CalTimePeakFinder_module.hh +++ b/CalPatRec/inc/CalTimePeakFinder_module.hh @@ -24,9 +24,6 @@ namespace art { #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" #include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - #include "Offline/CalPatRec/inc/CalTimePeakFinder_types.hh" // Mu2e diff --git a/CalPatRec/inc/HlPrint.hh b/CalPatRec/inc/HlPrint.hh index 9157cd6f9a..6b1a82b0a5 100644 --- a/CalPatRec/inc/HlPrint.hh +++ b/CalPatRec/inc/HlPrint.hh @@ -12,8 +12,6 @@ #include "Offline/RecoDataProducts/inc/ComboHit.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -class KalRep; - namespace mu2e { class StrawHit; diff --git a/CalPatRec/inc/MergePatRec_types.hh b/CalPatRec/inc/MergePatRec_types.hh index de4c84b63e..e401f7ca75 100644 --- a/CalPatRec/inc/MergePatRec_types.hh +++ b/CalPatRec/inc/MergePatRec_types.hh @@ -1,7 +1,6 @@ #ifndef CalPatRec_MergePatRec_types_hh #define CalPatRec_MergePatRec_types_hh -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/KalSeed.hh" namespace art { @@ -22,8 +21,6 @@ namespace mu2e { struct Data_t { const art::Event* event; const Tracker* tracker; - const KalRepPtrCollection* list_of_kreps_tpr; - const KalRepPtrCollection* list_of_kreps_cpr; const KalSeedCollection* list_of_kseed_tpr; const KalSeedCollection* list_of_kseed_cpr; int debugLevel; // printout level diff --git a/CalPatRec/inc/ObjectDumpUtils.hh b/CalPatRec/inc/ObjectDumpUtils.hh index ef149a602e..a5ce873178 100644 --- a/CalPatRec/inc/ObjectDumpUtils.hh +++ b/CalPatRec/inc/ObjectDumpUtils.hh @@ -17,10 +17,8 @@ namespace art { class Event; } -class KalRep; #include "Offline/MCDataProducts/inc/StrawDigiMC.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/CaloProtoCluster.hh" namespace mu2e { @@ -50,12 +48,6 @@ namespace mu2e { static void printEventHeader(const art::Event* Event, const char* Message = ""); - static void printKalRep(const KalRep* Krep, const char* Opt = "", const char* Prefix = ""); - - static void printKalRepCollection(const art::Event* Event , - const KalRepPtrCollection* Coll , - int PrintHits = 0); - static void printCaloProtoCluster(const mu2e::CaloProtoCluster* Cluster, const char* Opt = ""); static void printCaloProtoClusterCollection(const mu2e::CaloProtoClusterCollection* Coll); diff --git a/CalPatRec/src/CalTimePeakFinderDiag_tool.cc b/CalPatRec/src/CalTimePeakFinderDiag_tool.cc index 2a833b3caa..07ad330816 100644 --- a/CalPatRec/src/CalTimePeakFinderDiag_tool.cc +++ b/CalPatRec/src/CalTimePeakFinderDiag_tool.cc @@ -9,8 +9,6 @@ #include "CLHEP/Matrix/SymMatrix.h" #include "CLHEP/Vector/ThreeVector.h" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" - #include "Offline/CalPatRec/inc/CalTimePeakFinder_types.hh" #include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh" #include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" diff --git a/CalPatRec/src/MergePatRecDiag_tool.cc b/CalPatRec/src/MergePatRecDiag_tool.cc index e8440ca9a4..fdf0a041d7 100644 --- a/CalPatRec/src/MergePatRecDiag_tool.cc +++ b/CalPatRec/src/MergePatRecDiag_tool.cc @@ -72,7 +72,6 @@ namespace mu2e { void bookTrackHistograms(TrackHist_t* Hist, art::TFileDirectory* Dir); void fillEventHistograms(EventHist_t* Hist); - void fillTrackHistograms(TrackHist_t* Hist, const KalRep* KRep); //----------------------------------------------------------------------------- // overriden virtual functions of the base class //----------------------------------------------------------------------------- @@ -189,27 +188,14 @@ namespace mu2e { Hist->fEventNumber->Fill(event_number); Hist->fRunNumber ->Fill(run_number); - int ntpr = _data->list_of_kreps_tpr->size(); + int ntpr = _data->list_of_kseed_tpr->size(); Hist->fNTprTracks->Fill(ntpr); - int ncpr = _data->list_of_kreps_cpr->size(); + int ncpr = _data->list_of_kseed_cpr->size(); Hist->fNCprTracks->Fill(ncpr); } //----------------------------------------------------------------------------- - void MergePatRecDiag::fillTrackHistograms(TrackHist_t* Hist, const KalRep* KRep) { - - Hep3Vector mom = KRep->momentum(0); - float chi2 = KRep->chisq(); - // int nhits = KRep->hitVector().size(); - int nactive = KRep->nActive(); - - Hist->fChi2Dof->Fill(chi2/(nactive-5+1.e-12)); - Hist->fMom->Fill(mom.mag()); - Hist->fNActive->Fill(nactive); - } - - //----------------------------------------------------------------------------- // main fill histograms function called once per event // 'Mode' not used @@ -229,27 +215,14 @@ namespace mu2e { // event histograms - just one set //----------------------------------------------------------------------------- fillEventHistograms(_hist.fEvent[0]); + return 0; + } //----------------------------------------------------------------------------- // fill TrkPatRec histograms //----------------------------------------------------------------------------- - const KalRep *tpr, *cpr; - - int ntpr = _data->list_of_kreps_tpr->size(); - for(int i=0; ilist_of_kreps_tpr->at(i).get(); - fillTrackHistograms(_hist.fTpr[0],tpr); - } //----------------------------------------------------------------------------- // fill CalPatRec histograms //----------------------------------------------------------------------------- - int ncpr = _data->list_of_kreps_cpr->size(); - for(int i=0; ilist_of_kreps_cpr->at(i).get(); - fillTrackHistograms(_hist.fCpr[0],cpr); - } - return 0; - } - //----------------------------------------------------------------------------- // debugLevel > 0: print seeds //----------------------------------------------------------------------------- diff --git a/CalPatRec/src/SConscript b/CalPatRec/src/SConscript index 2951b5738f..ec011e367b 100644 --- a/CalPatRec/src/SConscript +++ b/CalPatRec/src/SConscript @@ -18,8 +18,6 @@ helper=mu2e_helper(env); mainlib = helper.make_mainlib( [ 'mu2e_CalPatRec_dict', 'mu2e_CaloCluster', 'mu2e_TrkReco', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_ConditionsService', 'mu2e_TrackerConditions', @@ -56,8 +54,6 @@ mainlib = helper.make_mainlib( [ 'mu2e_CalPatRec_dict', helper.make_plugins( [ mainlib, 'mu2e_TrkReco', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_ConditionsService', @@ -100,10 +96,6 @@ helper.make_dict_and_map( [ # mainlib, 'mu2e_GeomPrimitives', 'mu2e_GeneralUtilities', 'mu2e_TrackerGeom', - 'BTrk_KalmanTrack', - 'BTrk_TrkBase', - 'BTrk_ProbTools', - 'BTrk_BaBar', 'art_Persistency_Common', 'art_Persistency_Provenance', 'art_Utilities', diff --git a/CalPatRec/test/calPatRec.fcl b/CalPatRec/test/calPatRec.fcl index 8d7bdc88ad..daac3c359b 100644 --- a/CalPatRec/test/calPatRec.fcl +++ b/CalPatRec/test/calPatRec.fcl @@ -40,7 +40,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/calPatRec_01.fcl b/CalPatRec/test/calPatRec_01.fcl index 1925b78799..d7fcdeb625 100644 --- a/CalPatRec/test/calPatRec_01.fcl +++ b/CalPatRec/test/calPatRec_01.fcl @@ -42,7 +42,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/calPatRec_02.fcl b/CalPatRec/test/calPatRec_02.fcl index 565665212b..d7b1e957f8 100644 --- a/CalPatRec/test/calPatRec_02.fcl +++ b/CalPatRec/test/calPatRec_02.fcl @@ -41,7 +41,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/calPatRec_display.fcl b/CalPatRec/test/calPatRec_display.fcl index a8049fa624..a75f2ec66e 100644 --- a/CalPatRec/test/calPatRec_display.fcl +++ b/CalPatRec/test/calPatRec_display.fcl @@ -52,7 +52,6 @@ services : { #GeometryService : { inputFile : "murat/geom/geom_common_BaF2_r_1_1.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/calPatRec_display_cnv00502.fcl b/CalPatRec/test/calPatRec_display_cnv00502.fcl index 3793f95374..ac729dbddb 100644 --- a/CalPatRec/test/calPatRec_display_cnv00502.fcl +++ b/CalPatRec/test/calPatRec_display_cnv00502.fcl @@ -52,7 +52,6 @@ services : { #GeometryService : { inputFile : "murat/geom/geom_common_BaF2_r_1_1.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/calPatRec_display_read.fcl b/CalPatRec/test/calPatRec_display_read.fcl index 2437c10451..98c00fbe36 100644 --- a/CalPatRec/test/calPatRec_display_read.fcl +++ b/CalPatRec/test/calPatRec_display_read.fcl @@ -52,7 +52,6 @@ services : { #GeometryService : { inputFile : "murat/geom/geom_common_BaF2_r_1_1.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/deltaFinder_debug_ce.fcl b/CalPatRec/test/deltaFinder_debug_ce.fcl index c31e37832a..86c0a67753 100644 --- a/CalPatRec/test/deltaFinder_debug_ce.fcl +++ b/CalPatRec/test/deltaFinder_debug_ce.fcl @@ -20,7 +20,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/CalPatRec/test/mergePatRec.fcl b/CalPatRec/test/mergePatRec.fcl index 31a480dda8..dabda57bcc 100644 --- a/CalPatRec/test/mergePatRec.fcl +++ b/CalPatRec/test/mergePatRec.fcl @@ -34,7 +34,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/mergePatRec_02.fcl b/CalPatRec/test/mergePatRec_02.fcl index 92778f54e1..14664e5fcb 100644 --- a/CalPatRec/test/mergePatRec_02.fcl +++ b/CalPatRec/test/mergePatRec_02.fcl @@ -43,7 +43,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/mergePatRec_03.fcl b/CalPatRec/test/mergePatRec_03.fcl index 928a5f7bd4..0bf5169b6f 100644 --- a/CalPatRec/test/mergePatRec_03.fcl +++ b/CalPatRec/test/mergePatRec_03.fcl @@ -44,7 +44,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/mergePatRec_display.fcl b/CalPatRec/test/mergePatRec_display.fcl index 460bdd7216..005f6a816f 100644 --- a/CalPatRec/test/mergePatRec_display.fcl +++ b/CalPatRec/test/mergePatRec_display.fcl @@ -51,7 +51,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/mergePatRec_display_read.fcl b/CalPatRec/test/mergePatRec_display_read.fcl index 5348c7a916..b334a0679e 100644 --- a/CalPatRec/test/mergePatRec_display_read.fcl +++ b/CalPatRec/test/mergePatRec_display_read.fcl @@ -50,7 +50,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/printTrackerNumerology.fcl b/CalPatRec/test/printTrackerNumerology.fcl index c8008ece5f..f8c68b27b2 100644 --- a/CalPatRec/test/printTrackerNumerology.fcl +++ b/CalPatRec/test/printTrackerNumerology.fcl @@ -22,7 +22,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/CalPatRec/test/trkPatRec_01.fcl b/CalPatRec/test/trkPatRec_01.fcl index b923795cb3..6a53694858 100644 --- a/CalPatRec/test/trkPatRec_01.fcl +++ b/CalPatRec/test/trkPatRec_01.fcl @@ -40,7 +40,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } # SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/trkPatRec_02.fcl b/CalPatRec/test/trkPatRec_02.fcl index 6d40bb4059..4e39a4fa16 100644 --- a/CalPatRec/test/trkPatRec_02.fcl +++ b/CalPatRec/test/trkPatRec_02.fcl @@ -39,7 +39,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/trkPatRec_display.fcl b/CalPatRec/test/trkPatRec_display.fcl index 7004599185..a6c8553784 100644 --- a/CalPatRec/test/trkPatRec_display.fcl +++ b/CalPatRec/test/trkPatRec_display.fcl @@ -40,7 +40,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/trkPatRec_display_read.fcl b/CalPatRec/test/trkPatRec_display_read.fcl index 9a2d680a25..d7e4a3e551 100644 --- a/CalPatRec/test/trkPatRec_display_read.fcl +++ b/CalPatRec/test/trkPatRec_display_read.fcl @@ -44,7 +44,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault # Mu2eG4Helper : { } # SeedService : @local::automaticSeeds } diff --git a/CaloDiag/src/SConscript b/CaloDiag/src/SConscript index 2dce910286..adee66db91 100644 --- a/CaloDiag/src/SConscript +++ b/CaloDiag/src/SConscript @@ -21,8 +21,6 @@ mainlib = helper.make_mainlib ( ['fhiclcpp_types', helper.make_plugins( [ mainlib, 'mu2e_TrkExt', 'mu2e_TrkDiag', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_BFieldGeom', diff --git a/CaloFilters/src/SConscript b/CaloFilters/src/SConscript index 2780e77bb4..2652a22825 100644 --- a/CaloFilters/src/SConscript +++ b/CaloFilters/src/SConscript @@ -20,8 +20,6 @@ mainlib = helper.make_mainlib ( [] ) helper.make_plugins( [ mainlib, 'mu2e_TrkExt', 'mu2e_TrkDiag', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_ParticleID', diff --git a/CosmicReco/CMakeLists.txt b/CosmicReco/CMakeLists.txt index 2efc7cfb0e..100ce7d384 100644 --- a/CosmicReco/CMakeLists.txt +++ b/CosmicReco/CMakeLists.txt @@ -6,8 +6,7 @@ cet_make_library( src/MinuitDriftFitter.cc src/PDFFit.cc LIBRARIES PUBLIC - - Offline::BTrkData + Offline::DataProducts Offline::GeometryService Offline::Mu2eUtilities @@ -21,7 +20,7 @@ cet_build_plugin(CosmicAnalyzer art::module REG_SOURCE src/CosmicAnalyzer_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService @@ -36,7 +35,7 @@ cet_build_plugin(CosmicFitDisplay art::module REG_SOURCE src/CosmicFitDisplay_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::GeneralUtilities Offline::GeometryService Offline::MCDataProducts @@ -51,7 +50,7 @@ cet_build_plugin(CosmicMCRecoDiff art::module REG_SOURCE src/CosmicMCRecoDiff_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService @@ -68,7 +67,7 @@ cet_build_plugin(CosmicMuonInfo art::module REG_SOURCE src/CosmicMuonInfo_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::DataProducts Offline::MCDataProducts Offline::RecoDataProducts @@ -78,7 +77,7 @@ cet_build_plugin(CosmicSeedFilter art::module REG_SOURCE src/CosmicSeedFilter_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::RecoDataProducts ) @@ -86,7 +85,7 @@ cet_build_plugin(CosmicShowerFilter art::module REG_SOURCE src/CosmicShowerFilter_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::ProditionsService Offline::RecoDataProducts Offline::TrackerConditions @@ -96,7 +95,7 @@ cet_build_plugin(CosmicTrackDetails art::module REG_SOURCE src/CosmicTrackDetails_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService @@ -113,7 +112,7 @@ cet_build_plugin(CosmicTrackDiag art::module REG_SOURCE src/CosmicTrackDiag_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService @@ -128,8 +127,7 @@ cet_build_plugin(CosmicTrackFinder art::module REG_SOURCE src/CosmicTrackFinder_module.cc LIBRARIES REG Offline::CosmicReco - - Offline::BTrkData + Offline::GeneralUtilities Offline::GeometryService Offline::Mu2eUtilities @@ -143,7 +141,7 @@ cet_build_plugin(LineFinder art::module REG_SOURCE src/LineFinder_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::GeometryService Offline::Mu2eUtilities Offline::ProditionsService @@ -155,7 +153,7 @@ cet_build_plugin(SimpleTimeCluster art::module REG_SOURCE src/SimpleTimeCluster_module.cc LIBRARIES REG Offline::CosmicReco - + Offline::DataProducts Offline::GeneralUtilities Offline::Mu2eUtilities diff --git a/CosmicReco/src/SConscript b/CosmicReco/src/SConscript index 376225852e..c81cc92257 100644 --- a/CosmicReco/src/SConscript +++ b/CosmicReco/src/SConscript @@ -14,8 +14,6 @@ rootlibs = env['ROOTLIBS'] babarlibs = env['BABARLIBS'] extrarootlibs = [ 'TMVA' , 'Minuit' , 'XMLIO', 'Minuit2', 'Geom', 'Geom', 'GeomPainter', 'Ged'] mainlib = helper.make_mainlib ( [ - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_ConditionsService', 'mu2e_GeometryService', diff --git a/DAQ/CMakeLists.txt b/DAQ/CMakeLists.txt index d32ee8e7c6..1f6fcd8d54 100644 --- a/DAQ/CMakeLists.txt +++ b/DAQ/CMakeLists.txt @@ -97,9 +97,8 @@ cet_build_plugin(STMWaveformDigisFromFragments art::module Offline::ProditionsService Offline::DataProducts Offline::RecoDataProducts - BTrk_difAlgebra ) - + cet_build_plugin(StrawDigisFromArtdaqFragments art::module REG_SOURCE src/StrawDigisFromArtdaqFragments_module.cc LIBRARIES REG diff --git a/EventDisplay/CMakeLists.txt b/EventDisplay/CMakeLists.txt index 957d780c83..5cd68340a5 100644 --- a/EventDisplay/CMakeLists.txt +++ b/EventDisplay/CMakeLists.txt @@ -6,7 +6,6 @@ cet_make_library( src/TrackColorSelector.cc LIBRARIES PUBLIC - Offline::BTrkData Offline::CalorimeterGeom Offline::ConfigTools Offline::CosmicRayShieldGeom diff --git a/EventDisplay/fcl/EventDisplayBase.fcl b/EventDisplay/fcl/EventDisplayBase.fcl index a1e7a26615..2a1c78d98f 100644 --- a/EventDisplay/fcl/EventDisplayBase.fcl +++ b/EventDisplay/fcl/EventDisplayBase.fcl @@ -12,7 +12,6 @@ source : module_type : RootInput inputCommands: ["keep *", "drop *CrvStatus*_*_*_*", - "drop *KalRepPayload*_*_*_*", "drop *CaloCrystalOnlyHit*_*_*_*"] } diff --git a/EventDisplay/src/ContentSelector.cc b/EventDisplay/src/ContentSelector.cc index 67c3359256..3c8cad09ad 100644 --- a/EventDisplay/src/ContentSelector.cc +++ b/EventDisplay/src/ContentSelector.cc @@ -21,7 +21,6 @@ void ContentSelector::firstLoop() //This is useful for now, but may be changed entry=_hitBox->FindEntry("StrawHit:makeSH:"); if(entry==nullptr) entry=_hitBox->FindEntry("StrawHit:makeDcH:"); - if(entry==nullptr) entry=_hitBox->FindEntry("KalRep:TrkPatRec:DownstreameMinus"); if(entry!=nullptr) _hitBox->Select(entry->EntryId()); entry=_caloHitBox->FindEntry("CaloHit:CaloHitsMaker:"); @@ -29,8 +28,6 @@ void ContentSelector::firstLoop() //This is useful for now, but may be changed entry=_trackBox->FindEntry("TrkExtTraj:TrkExt:"); if(entry!=nullptr) _trackBox->Select(entry->EntryId()); - entry=_trackBox->FindEntry("KalRep:TrkPatRec:DownstreameMinus"); - if(entry!=nullptr) _trackBox->Select(entry->EntryId()); entry=_trackBox->FindEntry("SimParticle:g4run:"); if(entry!=nullptr) _trackBox->Select(entry->EntryId()); @@ -75,8 +72,6 @@ void ContentSelector::setAvailableCollections(const art::Event& event) newEntries.push_back(nothingSelected); createNewEntries(_stepPointMCVector, event, "StepPointMC", newEntries, 1); createNewEntries(_strawHitVector, event, "StrawHit", newEntries, 2); - createNewEntries(_hitOnTrackVector, event, "KalRep", newEntries, 3); - createNewEntries(_kalSeedHitVector, event, "KalSeed", newEntries, 4); if(newEntries!=_hitEntries) { @@ -153,8 +148,6 @@ void ContentSelector::setAvailableCollections(const art::Event& event) //Track Selection newEntries.clear(); createNewEntries(_simParticleVector, event, "SimParticle", newEntries, 1); - createNewEntries(_trkRecoTrkVector, event, "KalRep", newEntries, 2); - createNewEntries(_trkExtTrajVector, event, "TrkExtTraj", newEntries, 3); createNewEntries(_kalSeedTrkVector, event, "KalSeed", newEntries, 4); if(newEntries!=_trackEntries) @@ -258,9 +251,6 @@ const CollectionType* ContentSelector::getSelectedHitCollection() const case 2 : if(typeid(CollectionType)!=typeid(mu2e::StrawHitCollection)) return(nullptr); if(index>=static_cast(_strawHitVector.size())) return(nullptr); return(reinterpret_cast(_strawHitVector[index].product())); - case 3 : if(typeid(CollectionType)!=typeid(mu2e::KalRepCollection)) return(nullptr); - if(index>=static_cast(_hitOnTrackVector.size())) return(nullptr); - return(reinterpret_cast(_hitOnTrackVector[index].product())); case 4 : if(typeid(CollectionType)!=typeid(mu2e::KalSeedCollection)) return(nullptr); if(index>=static_cast(_kalSeedHitVector.size())) return(nullptr); return(reinterpret_cast(_kalSeedHitVector[index].product())); @@ -277,7 +267,6 @@ const CollectionType* ContentSelector::getSelectedHitCollection() const } template const mu2e::StepPointMCCollection* ContentSelector::getSelectedHitCollection() const; template const mu2e::StrawHitCollection* ContentSelector::getSelectedHitCollection() const; -template const mu2e::KalRepCollection* ContentSelector::getSelectedHitCollection() const; template const mu2e::KalSeedCollection* ContentSelector::getSelectedHitCollection() const; template @@ -379,12 +368,6 @@ std::vector ContentSelector::getSelectedTrackCollection(s t.productId=_simParticleVector[index].id(); v.push_back(t); break; - case 2 : if(typeid(CollectionType)!=typeid(mu2e::KalRepCollection)) break; - if(index>=static_cast(_trkRecoTrkVector.size())) break; - to_return.push_back(reinterpret_cast(_trkRecoTrkVector[index].product())); - t.productId=_trkRecoTrkVector[index].id(); - v.push_back(t); - break; case 3 : if(typeid(CollectionType)!=typeid(mu2e::TrkExtTrajCollection)) break; if(index>=static_cast(_trkExtTrajVector.size())) break; to_return.push_back(reinterpret_cast(_trkExtTrajVector[index].product())); @@ -402,7 +385,6 @@ std::vector ContentSelector::getSelectedTrackCollection(s return(to_return); } template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; -template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; diff --git a/EventDisplay/src/ContentSelector.h b/EventDisplay/src/ContentSelector.h index 75280abfc7..1d69320e04 100644 --- a/EventDisplay/src/ContentSelector.h +++ b/EventDisplay/src/ContentSelector.h @@ -28,7 +28,6 @@ #include using namespace CLHEP; -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" #include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" namespace mu2e_eventdisplay @@ -50,8 +49,6 @@ class ContentSelector std::vector > _crvDigisVector; std::vector > _simParticleVector; std::vector > _mcTrajectoryVector; - std::vector > _trkRecoTrkVector; - std::vector > _hitOnTrackVector; //Hits on Tracks are stored inside of KalRep std::vector > _kalSeedTrkVector; std::vector > _kalSeedHitVector; std::vector > _trkExtTrajVector; diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index c1b5ea8186..ef3d24113f 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -53,10 +53,6 @@ using namespace std; #include using namespace CLHEP; -//#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -//#include "Offline/BTrkData/inc/TrkStrawHit.hh" -//#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkLegacy/inc/ExternalInfo.hh" namespace mu2e_eventdisplay { @@ -74,9 +70,6 @@ DataInterface::DataInterface(EventDisplayFrame *mainframe, double kalStepSize): _showNeutrinos=true; _showNeutrons=true; _showOthers=true; - - _particleInfo = make_unique(); - ExternalInfo::set(_particleInfo.get()); } DataInterface::~DataInterface() @@ -913,87 +906,6 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS } } } - /* - const mu2e::KalRepCollection *kalRepHits=contentSelector->getSelectedHitCollection(); - if(kalRepHits!=nullptr) - { - boost::shared_ptr residualGraph(new TGraphErrors()); - residualGraph->SetTitle("Residual Graph"); - - for(unsigned int i=0; isize(); i++) - { - const KalRep &particle = kalRepHits->at(i); - TrkHitVector const& hots = particle.hitVector(); - if(hots.size() > 0) - { - _numberHits+=hots.size(); - for(auto iter=hots.begin(); iter!=hots.end(); iter++) - { - const TrkHit *hitOnTrack = *iter; - const mu2e::TrkStrawHit* strawHit = dynamic_cast(hitOnTrack); - if(strawHit) - { - int sid=strawHit->straw().id().asUint16(); - double time = strawHit->time(); - double hitT0 = strawHit->hitT0()._t0; //this is the time the hit "arrived at the straw" - //don't know what the other times are - double strawtime = strawHit->comboHit().time(); - double driftRadius = strawHit->driftRadius(); - const HepPoint &p=strawHit->hitTraj()->position(strawHit->hitLen()); - double theta = strawHit->straw().getDirection().theta(); - double phi = strawHit->straw().getDirection().phi(); - - double residual, residualError; - if(strawHit->resid(residual, residualError)) - { - int n=residualGraph->GetN(); - residualGraph->SetPoint(n,p.z(),residual); - residualGraph->SetPointError(n,0,residualError); - } - - std::map >::iterator straw=_straws.find(sid); - if(straw!=_straws.end() && !std::isnan(time)) - { - double previousStartTime=straw->second->getStartTime(); - if(std::isnan(previousStartTime)) - { - findBoundaryT(_hitsTimeMinmax, hitT0); //is it Ok to exclude all following hits from the time window? - straw->second->setStartTime(hitT0); - straw->second->getComponentInfo()->setText(1,Form("hitT0(s): %gns",hitT0/CLHEP::ns)); - straw->second->getComponentInfo()->setText(2,Form("hit time(s): %gns",time/CLHEP::ns)); - straw->second->getComponentInfo()->setText(3,Form("strawhit time(s): %gns",strawtime/CLHEP::ns)); - residualGraph->GetXaxis()->SetTitle("z [mm]"); - residualGraph->GetYaxis()->SetTitle("Residual [??]"); - straw->second->getComponentInfo()->getHistVector().push_back(boost::dynamic_pointer_cast(residualGraph)); - _hits.push_back(straw->second); - } - else - { - straw->second->getComponentInfo()->expandLine(1,Form("%gns",hitT0/CLHEP::ns)); - straw->second->getComponentInfo()->expandLine(2,Form("%gns",time/CLHEP::ns)); - straw->second->getComponentInfo()->expandLine(3,Form("%gns",strawtime/CLHEP::ns)); - } - - const boost::shared_ptr strawname=straw->second->getComponentInfo()->getName(); - boost::shared_ptr info(new ComponentInfo()); - info->setName(Form("Drift Radius for %s",strawname->c_str())); - info->setText(0,strawname->c_str()); - info->setText(1,Form("Drift Radius %gcm",driftRadius/CLHEP::cm)); - boost::shared_ptr driftradius(new Cylinder(p.x(),p.y(),p.z(), - phi+TMath::Pi()/2.0,theta,0, - 5, //the halflength of 5 has no meaning - 0,driftRadius,hitT0, - _geometrymanager, _topvolume, _mainframe, info, false)); - _components.push_back(driftradius); - _driftradii.push_back(driftradius); - } - } - } - } - } - } - - */ // KalSeed hits const mu2e::KalSeedCollection *kalSeedsWithHits=contentSelector->getSelectedHitCollection(); if(kalSeedsWithHits!=NULL) @@ -1274,109 +1186,6 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS _tracks.push_back(shape); } } - /* - trackInfos.clear(); - std::vector kalRepCollectionVector=contentSelector->getSelectedTrackCollection(trackInfos); - for(unsigned int i=0; isize(); j++) - { - KalRep const* kalrep = kalReps->get(j); - int trackclass=trackInfos[i].classID; - int trackclassindex=trackInfos[i].index; - std::string trackcollection=trackInfos[i].entryText; - int particleid=kalrep->particleType().particleType(); - std::string particlename=ptable->particle(particleid).name(); - std::string c=Form("Kalman Track %i %s (%s)",j,particlename.c_str(),trackcollection.c_str()); - boost::shared_ptr info(new ComponentInfo()); - info->setName(c.c_str()); - info->setText(0,c.c_str()); - - double hitcount=0; - double offset=0; - TrkHitVector const& hots=kalrep->hitVector(); - if(hots.size()>0) - { - boost::shared_ptr residualGraph(new TGraphErrors()); - residualGraph->SetTitle("Residual Graph"); - for(auto iter=hots.begin(); iter!=hots.end(); iter++) - { - const TrkHit *hitOnTrack = *iter; - const mu2e::TrkStrawHit* strawHit = dynamic_cast(hitOnTrack); - if(strawHit) - { - double strawTime = strawHit->hitT0()._t0/CLHEP::ns; - double trackTime = strawTime*CLHEP::ns; //TODO: add correction for drift time - double weight= strawHit->weight(); - double fltLen= strawHit->fltLen(); - const HepPoint &p=strawHit->hitTraj()->position(strawHit->hitLen()); - double t = kalrep->arrivalTime(fltLen); - offset+=(trackTime-t)*weight; - hitcount+=weight; - - double residual, residualError; - if(strawHit->resid(residual, residualError)) - { - int n=residualGraph->GetN(); - residualGraph->SetPoint(n,p.z(),residual); - residualGraph->SetPointError(n,0,residualError); - } - } - } - residualGraph->GetXaxis()->SetTitle("z [mm]"); - residualGraph->GetYaxis()->SetTitle("Residual [??]"); - info->getHistVector().push_back(boost::dynamic_pointer_cast(residualGraph)); - } - if(hitcount>0) offset/=hitcount; else offset=0; - - double fltLMin=kalrep->startValidRange(); - double fltLMax=kalrep->endValidRange(); - double p1=kalrep->momentum(fltLMin).mag(); - double p2=kalrep->momentum(fltLMax).mag(); - double x1=kalrep->position(fltLMin).x(); - double y1=kalrep->position(fltLMin).y(); - double z1=kalrep->position(fltLMin).z(); - double x2=kalrep->position(fltLMax).x(); - double y2=kalrep->position(fltLMax).y(); - double z2=kalrep->position(fltLMax).z(); - double t1=kalrep->arrivalTime(fltLMin)+offset; - double t2=kalrep->arrivalTime(fltLMax)+offset; - boost::shared_ptr track(new Track(x1,y1,z1,t1, x2,y2,z2,t2, - particleid, trackclass, trackclassindex, p1, - _geometrymanager, _topvolume, _mainframe, info, false)); - _components.push_back(track); - _tracks.push_back(track); - - double fltStep = (fltLMax - fltLMin)/400.0; - for(unsigned int step = 0; step <= 400.0; step++) - { - double fltL = fltLMin + step*fltStep; - double t = kalrep->arrivalTime(fltL)+offset; - HepPoint p = kalrep->position(fltL); - findBoundaryT(_tracksTimeMinmax, t); - findBoundaryP(_tracksMinmax, p.x(), p.y(), p.z()); - track->addTrajectoryPoint(p.x(), p.y(), p.z(), t); - } - - int charge = kalrep->charge(); - double t0=kalrep->t0().t0(); - double firsthitfltlen = kalrep->lowFitRange(); - double lasthitfltlen = kalrep->hiFitRange(); - double entlen = min(firsthitfltlen,lasthitfltlen); - double loclen(0.0); - const TrkSimpTraj* ltraj = kalrep->localTrajectory(entlen,loclen); - const CLHEP::HepVector ¶ms=ltraj->parameters()->parameter(); - double d0 = params[0]; - double om = params[2]; - double rmax = d0+2.0/om; - - info->setText(1,Form("Charge %i",charge)); - info->setText(2,Form("Start Momentum %gMeV/c End Momentum %gMeV/c",p1/CLHEP::MeV,p2/CLHEP::MeV)); - info->setText(3,Form("t0 %gns d0 %gmm rmax %gmm",t0/CLHEP::ns,d0/CLHEP::mm,rmax/CLHEP::mm)); - } - } - */ // KalSeed tracks trackInfos.clear(); std::vector kalSeedCollectionVector=contentSelector->getSelectedTrackCollection(trackInfos); diff --git a/EventDisplay/src/DataInterface.h b/EventDisplay/src/DataInterface.h index af7f288e86..7fab399b6a 100644 --- a/EventDisplay/src/DataInterface.h +++ b/EventDisplay/src/DataInterface.h @@ -13,7 +13,6 @@ #include "Offline/EventDisplay/src/ContentSelector.h" #include "Offline/MCDataProducts/inc/SimParticle.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/Mu2eBTrk/inc/ParticleInfo.hh" #include "art/Framework/Principal/Event.h" #include "boost/shared_ptr.hpp" #include @@ -93,8 +92,6 @@ class DataInterface mu2e::StrawHitFlag _hitFlagSetting; double _kalStepSize; - std::unique_ptr _particleInfo; - void createGeometryManager(); void removeAllComponents(); void removeNonGeometryComponents(); diff --git a/EventDisplay/src/EventDisplay_module.cc b/EventDisplay/src/EventDisplay_module.cc index 5ff4c21f0f..7a636a383e 100644 --- a/EventDisplay/src/EventDisplay_module.cc +++ b/EventDisplay/src/EventDisplay_module.cc @@ -24,7 +24,6 @@ #include "Offline/EventDisplay/src/RootFileManager.h" using namespace CLHEP; -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" namespace mu2e { @@ -42,9 +41,6 @@ namespace mu2e const std::string &classNameToCheck, const mu2e_eventdisplay::EventDisplayFrame *_frame, bool &showEvent); - void checkMinimumHitsKalman(const art::Event &event, - const mu2e_eventdisplay::EventDisplayFrame *_frame, - bool &showEvent); mu2e_eventdisplay::EventDisplayFrame *_frame; bool _firstLoop; @@ -108,7 +104,6 @@ namespace mu2e checkMinimumHits(event, "", _frame, showEvent); checkMinimumHits(event, "", _frame, showEvent); checkMinimumHits(event, "", _frame, showEvent); - checkMinimumHitsKalman(event, _frame, showEvent); if(showEvent) _frame->setEvent(event,_firstLoop,calib); } } @@ -143,32 +138,6 @@ namespace mu2e } } - void EventDisplay::checkMinimumHitsKalman(const art::Event &event, - const mu2e_eventdisplay::EventDisplayFrame *_frame, bool &showEvent) - { - std::string className, moduleLabel, productInstanceName; - bool hasSelectedHits=_frame->getSelectedHitsName(className, moduleLabel, productInstanceName); - if(hasSelectedHits && ((className.find("")!=std::string::npos) || (className.find("")!=std::string::npos))) - { - art::Handle kalmantrackCollection; - if(event.getByLabel(moduleLabel,productInstanceName,kalmantrackCollection)) - { - int numberHits=0; - for(unsigned int i=0; isize(); i++) - { - KalRep const* particle = kalmantrackCollection->get(i); - TrkHitVector const& hots = particle->hitVector(); - numberHits+=hots.size(); - } - if(numberHits < _frame->getMinimumHits()) - { - std::cout<<"event skipped, since it doesn't have enough hits"<getRootFileManager()->write(); diff --git a/EventDisplay/src/SConscript b/EventDisplay/src/SConscript index a3d65a5d28..1ca5843bf7 100644 --- a/EventDisplay/src/SConscript +++ b/EventDisplay/src/SConscript @@ -17,9 +17,7 @@ userlibs = [ rootlibs, extrarootlibs, babarlibs, 'mu2e_DataProducts', - 'mu2e_Mu2eBTrk', 'mu2e_TrkReco', - 'mu2e_BTrkData', 'mu2e_Mu2eUtilities', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', diff --git a/Mu2eBTrk/CMakeLists.txt b/Mu2eBTrk/CMakeLists.txt deleted file mode 100644 index 685476e552..0000000000 --- a/Mu2eBTrk/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cet_make_library( - SOURCE - src/BaBarMu2eField.cc - src/DetStrawElem.cc - src/ParticleInfo.cc - LIBRARIES PUBLIC - - Offline::BFieldGeom - Offline::ConfigTools - Offline::DataProducts - Offline::GeometryService - Offline::GlobalConstantsService - Offline::TrackerGeom - BTrk_BaBar - BTrk_BbrGeom - BTrk_BField - BTrk_DetectorModel - BTrk_TrkBase -) - -install_source(SUBDIRS src) -install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/Mu2eBTrk/inc/BaBarMu2eField.hh b/Mu2eBTrk/inc/BaBarMu2eField.hh deleted file mode 100644 index 7f0c9834fa..0000000000 --- a/Mu2eBTrk/inc/BaBarMu2eField.hh +++ /dev/null @@ -1,38 +0,0 @@ -// Description: Class Header for |BaBarMu2eField| -// Provide an arbitary fixed field -// Author List:A. Snyder, Copyright (C) 1998 SLAC -#ifndef BaBarMu2eField_HH -#define BaBarMu2eField_HH - -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BField/BField.hh" -// CLHEP -#include "CLHEP/Vector/ThreeVector.h" - -// class interface // -namespace mu2e -{ - class BaBarMu2eField : public BField { - - public: - //construct from file; optionally amplify the distortions by the given factor - BaBarMu2eField(CLHEP::Hep3Vector const& origin=CLHEP::Hep3Vector(0.0,0.0,0.0)); - //destroy - virtual ~BaBarMu2eField(); - // field vector at a point. - virtual CLHEP::Hep3Vector bFieldVect - (const HepPoint & point=HepPoint(0,0,0))const; - // override the nominal field - virtual double bFieldNominal()const; - CLHEP::Hep3Vector const& origin() const { return _origin; } - private: - mutable double _bnom; - CLHEP::Hep3Vector _origin; - }; -} -#endif - - - - - diff --git a/Mu2eBTrk/inc/DetStrawElem.hh b/Mu2eBTrk/inc/DetStrawElem.hh deleted file mode 100644 index 79d6011299..0000000000 --- a/Mu2eBTrk/inc/DetStrawElem.hh +++ /dev/null @@ -1,56 +0,0 @@ -//-------------------------------------------------------------------------- -// Name: -// DetStrawElem: class to represent a straw. Depending on the -// type this class can represent the material of the gas, wall, wire, or all -// Copyright (C) 2008 Lawrence Berkeley Laboratory -// Author List: -// Dave Brown 27 May 2011 -//------------------------------------------------------------------------ -#ifndef DetStrawElem_hh -#define DetStrawElem_hh - -#include "BTrk/DetectorModel/DetElem.hh" -#include "Offline/DataProducts/inc/StrawId.hh" -#include - -namespace mu2e { - class Straw; - class Tracker; - class DetStrawType; -// element class - class DetStrawElem : public DetElem { - public: -// construct from a Straw - DetStrawElem(DetStrawType* strawtype, Tracker const& tracker, StrawId const& id); - virtual ~DetStrawElem(); -// DetElem interface; intersect just calls down to reintersect. Note that the entrance -// flag of the DetIntersection defines what parts of the material to model - virtual int intersect(const Trajectory*,DetIntersection&) const; - virtual bool reIntersect(const Trajectory* traj,DetIntersection& dinter) const; -// overwrite the material info function to allow heterogenous materials with a single intersection - virtual void materialInfo(const DetIntersection&, - double momentum, - TrkParticle const& tpart, - double& deflectRMS, - double& pFractionRMS, - double& pFraction, - trkDirection dedxdir=trkOut) const; - // override KalMaterial function which is broken and shouldn't be used - double radiationFraction(const DetIntersection&) const; - // accessors - const Straw* straw() const { return _straw; } - const Trajectory* wireTraj() const { return _wtraj; } -// specific functions for different material intersections - double gasPath(double pdist,CLHEP::Hep3Vector const& tdir) const; // track pathlength through 1/2 the gas of the straw, given distance to the wire center - double wallPath(double pdist,CLHEP::Hep3Vector const& tdir) const; // track pathlength through one wall of the straw, given distance to the wire center - private: - virtual HepPoint coordToPoint( const TypeCoord* aCoord ) const { return HepPoint(0.0,0.0,0.0); } - const Straw* _straw; - double _rstraw, _wthick; // cached from Tracker - Trajectory* _wtraj; // wire trajectory, owned by this object; This should be in the straw, FIXME! - // remember the fully-typed type - const DetStrawType* _stype; - }; -} - -#endif diff --git a/Mu2eBTrk/inc/DetStrawType.hh b/Mu2eBTrk/inc/DetStrawType.hh deleted file mode 100644 index 79de85d51b..0000000000 --- a/Mu2eBTrk/inc/DetStrawType.hh +++ /dev/null @@ -1,40 +0,0 @@ -//-------------------------------------------------------------------------- -// Name: -// DetStrawType: Class to define DetectorModel type for a straw -// Copyright (C) 2011 Lawrence Berkeley Laboratory -// Author List: -// Dave Brown 9 Sept. 2011 -//------------------------------------------------------------------------ -#ifndef DetStrawType_hh -#define DetStrawType_hh - -#include "BTrk/DetectorModel/DetType.hh" -#include "BTrk/DetectorModel/DetMaterial.hh" - -namespace mu2e { -class DetStrawType : public DetType { - public: - DetStrawType(const DetMaterial* gasmat, const DetMaterial* wallmat, const DetMaterial* wiremat, - double offset, double tol, double rfrac) : - _gasmat(gasmat), _wallmat(wallmat), _wiremat(wiremat), _offset(offset), _tol(tol), _rfrac(rfrac) {} - virtual ~DetStrawType() {} -// Trivial implementation of DetType interface; these are not used - virtual bool physicalMaterial(const TypeCoord*) const { return true; } - virtual const DetMaterial& material(const TypeCoord*) const { return *_gasmat; } -// specific functions - const DetMaterial* gasMaterial() const { return _gasmat; } - const DetMaterial* wallMaterial() const { return _wallmat; } - const DetMaterial* wireMaterial() const { return _wiremat; } - double offset() const { return _offset; } - double tolerance() const { return _tol; } - double maxRadiusFraction() const { return _rfrac; } - private: - const DetMaterial* _gasmat; - const DetMaterial* _wallmat; - const DetMaterial* _wiremat; - double _offset; - double _tol; - double _rfrac; - }; -} -#endif diff --git a/Mu2eBTrk/inc/FileFinder.hh b/Mu2eBTrk/inc/FileFinder.hh deleted file mode 100644 index 02f31e2c89..0000000000 --- a/Mu2eBTrk/inc/FileFinder.hh +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef BTrkHelper_FileFinder_hh -#define BTrkHelper_FileFinder_hh - -#include "BTrk/BaBar/FileFinderInterface.hh" -#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" - -#include "fhiclcpp/ParameterSet.h" - -#include - -namespace mu2e { - - class FileFinder : public FileFinderInterface { - - public: - FileFinder(std::string elementsBaseName, - std::string isotopesBaseName, - std::string materialsBaseName): - elementsBaseName_(elementsBaseName), - isotopesBaseName_(isotopesBaseName), - materialsBaseName_(materialsBaseName){} - - std::string matElmDictionaryFileName() const override { - return findFile(elementsBaseName_); - } - - std::string matIsoDictionaryFileName() const override { - return findFile(isotopesBaseName_); - } - - std::string matMtrDictionaryFileName() const override { - return findFile(materialsBaseName_); - } - - std::string findFile( std::string const& path ) const override { - return policy_( path ); - } - - private: - - // mutable because BTrk want to hold this with - // a const pointer, but this needs to alter its internal state - mutable ConfigFileLookupPolicy policy_; - - std::string elementsBaseName_; - std::string isotopesBaseName_; - std::string materialsBaseName_; - - }; - -} - -#endif /* btrkHelper_FileFinder_hh */ diff --git a/Mu2eBTrk/inc/ParticleInfo.hh b/Mu2eBTrk/inc/ParticleInfo.hh deleted file mode 100644 index 7825421c7f..0000000000 --- a/Mu2eBTrk/inc/ParticleInfo.hh +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef BTrkHelper_ParticleInfo_hh -#define BTrkHelper_ParticleInfo_hh - -// -// Supply information about particles to the btrk code. -// - btrk code makes calls indexed by TrkParicle::type. -// - PDT is indexed by PDGCode::type -// This code looks after the translation and caches results. -// - -#include "Offline/GlobalConstantsService/inc/ParticleData.hh" - -#include "BTrk/BaBar/ParticleInfoInterface.hh" - -#include -#include - -namespace mu2e { - - class ParticleDataList; - - class ParticleInfo : public ParticleInfoInterface { - - public: - - ParticleInfo(); - - double mass ( TrkParticle::type id ) const override { - return getParticle(id)->mass(); - } - - double charge( TrkParticle::type id ) const override { - return getParticle(id)->charge(); - } - - std::string name ( TrkParticle::type id ) const override { - return getParticle(id)->name(); - } - - private: - - //the following has to be mutable because BTrk holds this - //with a const pointer - - // Guaranteed valid throughout the job. - ParticleDataList const& pdt_; - - // Local cache of the information for particles that we care about; - // indexed by TrkParticle::type, not by PDG::id. - mutable std::map table_; - - // Find particle data in the local cache; fault to the full cache as needed. - ParticleData const* getParticle( TrkParticle::type ) const; - - }; -} - -#endif /* btrkHelper_ParticleInfo_hh */ diff --git a/Mu2eBTrk/src/BaBarMu2eField.cc b/Mu2eBTrk/src/BaBarMu2eField.cc deleted file mode 100644 index 92e7343145..0000000000 --- a/Mu2eBTrk/src/BaBarMu2eField.cc +++ /dev/null @@ -1,43 +0,0 @@ -// -// BaBar includes -#include "BTrk/BaBar/BaBar.hh" -#include "Offline/Mu2eBTrk/inc/BaBarMu2eField.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" - -namespace mu2e -{ - - BaBarMu2eField::BaBarMu2eField(CLHEP::Hep3Vector const& origin) : _bnom(0.0), _origin(origin) { - } - - BaBarMu2eField::~BaBarMu2eField(){} - - // BaBar interface. Note we have to change units here to the BaBar conventions - CLHEP::Hep3Vector - BaBarMu2eField::bFieldVect (const HepPoint &point)const { - static GeomHandle bfmgr; - static GeomHandle det; - - // change coordinates to mu2e - CLHEP::Hep3Vector vpoint(point.x(),point.y(),point.z()); - CLHEP::Hep3Vector vpoint_mu2e = det->toMu2e(vpoint); - CLHEP::Hep3Vector field = bfmgr->getBField(vpoint_mu2e); - return field; - } - - double - BaBarMu2eField::bFieldNominal() const { - if(_bnom == 0.0){ - // field at tracker origin - // nominal field is the z component of the field at the origin - HepPoint po(_origin.x(),_origin.y(),_origin.z()); - CLHEP::Hep3Vector bo = bFieldVect(po); - _bnom = bo.z(); - } - return _bnom; - } -} - - diff --git a/Mu2eBTrk/src/DetStrawElem.cc b/Mu2eBTrk/src/DetStrawElem.cc deleted file mode 100644 index 77ec734f2e..0000000000 --- a/Mu2eBTrk/src/DetStrawElem.cc +++ /dev/null @@ -1,143 +0,0 @@ -//-------------------------------------------------------------------------- -// Name: -// DetStrawElem: class to represent the straw gas material -// Copyright (C) 2008 Lawrence Berkeley Laboratory -// Author List: -// Dave Brown 27 May 2011 -//------------------------------------------------------------------------ -#include "Offline/Mu2eBTrk/inc/DetStrawElem.hh" -#include "Offline/Mu2eBTrk/inc/DetStrawType.hh" -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/TrackerGeom/inc/Straw.hh" -#include "BTrk/TrkBase/TrkHit.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/DetectorModel/DetIntersection.hh" -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "cetlib_except/coded_exception.h" -#include -#include - -using CLHEP::Hep3Vector; - -namespace mu2e { - DetStrawElem::DetStrawElem(DetStrawType* stype,Tracker const& tracker, StrawId const& id) : - DetElem(stype,"TrackerStraw",id.asUint16()),_straw(&tracker.getStraw(id)), - _rstraw(tracker.strawOuterRadius()), _wthick(tracker.strawWallThickness()), - _wtraj(0), _stype(stype){ -// the traj should be a propoerty of the straw, FIXME!!! - Hep3Vector const& wiredir = _straw->getDirection(); - Hep3Vector const& mid = _straw->getMidPoint(); - _wtraj = new TrkLineTraj(HepPoint(mid.x(),mid.y(),mid.z()),wiredir,0); - } - - DetStrawElem::~DetStrawElem() { - delete _wtraj; - } - - int - DetStrawElem::intersect(const Trajectory* traj, DetIntersection& dinter) const { - if(reIntersect(traj,dinter)) - return 1; - else - return 0; - } - - bool - DetStrawElem::reIntersect(const Trajectory* traj,DetIntersection& dinter) const { - bool retval(false); -// use POCA to determine if the track went through the straw. The DetIntersection -// tolerance defines how close we have to get - TrkPoca poca(*traj,dinter.pathlen,*_wtraj,0); - if(poca.status().success()){ -// if there's an associated active hit with this element, then force the intersection - // otherwise, require the distance to the wire be inside the straw (within tolerance) - // should also check the distance along the wire is inside the active length FIXME!! - if( (dinter.thit != 0 && dinter.thit->isActive()) || - fabs(poca.doca()) < _rstraw + _stype->tolerance() ){ - retval = true; -// call the base class function to update the base members - DetElem::reIntersect(traj,dinter); -// fill the DetIntersection. Use the gas path give the intersection for the whole straw - CLHEP::Hep3Vector tdir = traj->direction(dinter.pathlen); - double dpath = gasPath(fabs(poca.doca()),tdir); - dinter.pathlen = poca.flt1() + _stype->offset(); - dinter.dist = poca.doca(); // NB: this can be negative! - dinter.pathrange[0] = dinter.pathlen-dpath; - dinter.pathrange[1] = dinter.pathlen+dpath; - } - } - return retval; - } - -// compute the material effects of traversing the straw. This includes -// the straw gas and walls (and eventually wire, FIXME!!) - void DetStrawElem::materialInfo(const DetIntersection& dinter, - double momentum, - TrkParticle const& tpart, - double& deflectRMS, - double& pfracRMS, - double& pfrac, - trkDirection dedxdir) const { -// compute the path through the straw wall and gas (and eventually test for wire intersections!) - CLHEP::Hep3Vector tdir = dinter.trajet->direction(dinter.pathlen); - double gaspath = gasPath(dinter.dist,tdir); - double wallpath = wallPath(dinter.dist,tdir); -// compute the material info for these materials using the base class function - double gasdeflectRMS, gaspfracRMS,gaspfrac; - DetElem::materialInfo(*_stype->gasMaterial(),2*gaspath,momentum,tpart,gasdeflectRMS,gaspfracRMS,gaspfrac,dedxdir); - double walldeflectRMS, wallpfracRMS,wallpfrac; - DetElem::materialInfo(*_stype->wallMaterial(),2*wallpath,momentum,tpart,walldeflectRMS,wallpfracRMS,wallpfrac,dedxdir); - // combine these to give the aggregate effect - deflectRMS = sqrt(gasdeflectRMS*gasdeflectRMS + walldeflectRMS*walldeflectRMS); - pfracRMS = sqrt(gaspfracRMS*gaspfracRMS + wallpfracRMS*wallpfracRMS); - pfrac = gaspfrac + wallpfrac; - } - - // compute the pathlength through half the gas , given the drift distance and straw geometry - double DetStrawElem::gasPath(double pdist,Hep3Vector const& tdir) const { - double hlen = _straw->halfLength(); -// if the POCA distance is outside or too close the outside of the straw, force it inside - pdist = std::min(fabs(pdist),_stype->maxRadiusFraction()*_rstraw); - double gaspath = sqrt( (_rstraw+pdist)*(_rstraw-pdist) ); -// scale for the other dimension. Maximum path is a fraction of the straw length - double cost = tdir.dot(_straw->getDirection()); -// avoid degenerate case - if(fabs(cost)<0.999) - gaspath /= sqrt( (1.0-cost)*(1.0+cost) ); - else - gaspath = hlen; -// restrict to sensible physical distance - gaspath = std::min(gaspath,hlen); - return gaspath; - } - - double - DetStrawElem::radiationFraction(const DetIntersection& dinter) const { -// compute the path through the straw wall and gas (and eventually test for wire intersections!) - CLHEP::Hep3Vector tdir = dinter.trajet->direction(dinter.pathlen); - double gaspath = gasPath(dinter.dist,tdir); - double wallpath = wallPath(dinter.dist,tdir); - double retval = _stype->gasMaterial()->radiationFraction(2*gaspath); - retval += _stype->wallMaterial()->radiationFraction(2*wallpath); - return retval; - } - -// compute the pathlength through one wall of the straw, given the drift distance and straw geometry - double DetStrawElem::wallPath(double pdist,Hep3Vector const& tdir) const { - double inRadius = _rstraw - _wthick; -// if the POCA distance is outside or too close the outside of the straw, force it inside - pdist = std::min(fabs(pdist),_stype->maxRadiusFraction()*inRadius); - double wallpath = (sqrt( (_rstraw+pdist)*(_rstraw-pdist) ) - - sqrt( (inRadius+pdist)*(inRadius-pdist) )); - // scale for the other dimension - double cost = tdir.dot(_straw->getDirection()); -// avoid degenerate case - if(fabs(cost)<0.999) - wallpath /= sqrt( (1.0-cost)*(1.0+cost) ); - else - wallpath = _rstraw; - // restrict to a sensible maximu distance - wallpath = std::min(wallpath,_rstraw); - return wallpath; - } -} diff --git a/Mu2eBTrk/src/ParticleInfo.cc b/Mu2eBTrk/src/ParticleInfo.cc deleted file mode 100644 index b956e9d446..0000000000 --- a/Mu2eBTrk/src/ParticleInfo.cc +++ /dev/null @@ -1,83 +0,0 @@ -#include "Offline/Mu2eBTrk/inc/ParticleInfo.hh" -#include "Offline/DataProducts/inc/PDGCode.hh" - -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" - -mu2e::ParticleInfo::ParticleInfo():pdt_(*GlobalConstantsHandle()){ -} - -mu2e::ParticleData const* -mu2e::ParticleInfo::getParticle( TrkParticle::type id ) const{ - - // First, check the local cache. - auto q = table_.find(id); - if ( q != table_.end() ) return q->second; - - // If not present in local cache, translate from TrkParticle::type - // to PDGCode::type and fill the local cache. - ParticleData const* p(nullptr); - switch (id) { - case TrkParticle::e_minus: { - p = &pdt_.particle(PDGCode::e_minus); - break; - } - - case TrkParticle::e_plus: { - p = &pdt_.particle(PDGCode::e_plus); - break; - } - - case TrkParticle::mu_minus: { - p = &pdt_.particle(PDGCode::mu_minus); - break; - } - - case TrkParticle::mu_plus: { - p = &pdt_.particle(PDGCode::mu_plus); - break; - } - - case TrkParticle::pi_minus: { - p = &pdt_.particle(PDGCode::pi_minus); - break; - } - - case TrkParticle::pi_plus: { - p = &pdt_.particle(PDGCode::pi_plus); - break; - } - - case TrkParticle::K_minus: { - p = &pdt_.particle(PDGCode::K_minus); - break; - } - - case TrkParticle::K_plus: { - p = &pdt_.particle(PDGCode::K_plus); - break; - } - - case TrkParticle::anti_p_minus: { - p = &pdt_.particle(PDGCode::anti_proton); - break; - } - - case TrkParticle::p_plus: { - p = &pdt_.particle(PDGCode::proton); - break; - } - - default: { - throw cet::exception("RANGE") - << "ParticleInfo::getParticle unrecognized TrkParticle type: " - << id; - } - - } - - table_[id] = p; - - return p; - -} diff --git a/Mu2eBTrk/src/SConscript b/Mu2eBTrk/src/SConscript deleted file mode 100644 index 01cf3907a7..0000000000 --- a/Mu2eBTrk/src/SConscript +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -# Original author Rob Kutschke. -# - -import os, re -Import('env') - -Import('mu2e_helper') - -helper=mu2e_helper(env) - -rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] - -mainlib = helper.make_mainlib ( [ - 'mu2e_GeometryService', - 'mu2e_BFieldGeom', - 'mu2e_TrackerGeom', - 'mu2e_GlobalConstantsService', - 'mu2e_DataProducts', - 'mu2e_GeneralUtilities', - babarlibs, - 'art_Framework_Core', - 'art_Framework_Principal', - 'art_Framework_Services_Registry', - 'art_root_io_TFileService', - 'art_root_io_tfile_support', - 'art_Persistency_Provenance', - 'art_Persistency_Common', - 'art_Utilities', - 'canvas', - 'fhiclcpp', - 'fhiclcpp_types', - 'tbb', - 'cetlib', - 'cetlib_except', - rootlibs, - 'CLHEP', - 'xerces-c' - ] ) - -# Fixme: split into link lists for each module. -helper.make_plugins( [ - mainlib, - 'mu2e_GeometryService', - 'mu2e_BFieldGeom', - 'mu2e_TrackerGeom', - 'mu2e_GlobalConstantsService', - 'mu2e_DataProducts', - 'mu2e_GeneralUtilities', - babarlibs, - 'art_Framework_Core', - 'art_Framework_Principal', - 'art_Framework_Services_Registry', - 'art_root_io_tfile_support', - 'art_root_io_TFileService', - 'art_Framework_Services_Optional_RandomNumberGenerator', - 'art_Persistency_Common', - 'art_Persistency_Provenance', - 'art_Utilities', - 'canvas', - 'MF_MessageLogger', - 'fhiclcpp', - 'cetlib', - 'cetlib_except', - 'CLHEP', - rootlibs, - 'xerces-c', - 'boost_filesystem', - ] ) - - -# This tells emacs to view this file in python mode. -# Local Variables: -# mode:python -# End: diff --git a/Mu2eKinKal/inc/KKFileFinder.hh b/Mu2eKinKal/inc/KKFileFinder.hh index 1fe1d3d2c4..67ab289602 100644 --- a/Mu2eKinKal/inc/KKFileFinder.hh +++ b/Mu2eKinKal/inc/KKFileFinder.hh @@ -35,8 +35,6 @@ namespace mu2e { private: - // mutable because BTrk want to hold this with - // a const pointer, but this needs to alter its internal state mutable ConfigFileLookupPolicy policy_; std::string elementsBaseName_; diff --git a/Mu2eUtilities/CMakeLists.txt b/Mu2eUtilities/CMakeLists.txt index 8655564248..0a9c12ff82 100644 --- a/Mu2eUtilities/CMakeLists.txt +++ b/Mu2eUtilities/CMakeLists.txt @@ -16,7 +16,6 @@ cet_make_library( src/GeneratorSummaryHistograms.cc src/HelixTool.cc src/HistTrackSum.cc - src/KalRepInstanceNameDecoder.cc src/LsqSums2.cc src/LsqSums4.cc src/McUtilsToolBase.cc @@ -51,7 +50,6 @@ cet_make_library( src/TrackPatRecType.cc src/TrackTool.cc src/TriggerResultsNavigator.cc - src/TrkSpecies.cc src/TwoLinePCA.cc src/TwoLinePCA_XYZ.cc src/VectorVolume.cc diff --git a/Mu2eUtilities/inc/KalRepInstanceNameDecoder.hh b/Mu2eUtilities/inc/KalRepInstanceNameDecoder.hh deleted file mode 100644 index 36a6f33aec..0000000000 --- a/Mu2eUtilities/inc/KalRepInstanceNameDecoder.hh +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef Mu2eUtilities_KalRepInstanceNameDecoder_hh -#define Mu2eUtilities_KalRepInstanceNameDecoder_hh -// -// Decode the instance name of a KalRepCollection -// or a KalRepPtrCollection. -// -// Contact person, Rob Kutschke -// -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/Mu2eUtilities/inc/TrkSpecies.hh" - -#include - -namespace mu2e { - - class KalRepInstanceNameDecoder { - public: - KalRepInstanceNameDecoder( std::string const& instanceName ); - - TrkFitDirection direction() const { return direction_; } - TrkSpecies particleType() const { return particleType_; } - int charge() const { return charge_; } - std::string const& instanceName() const { return instanceName_; } - - private: - std::string instanceName_; - TrkFitDirection direction_; - TrkSpecies particleType_; - int charge_ = 0; - - }; - -} - -#endif diff --git a/Mu2eUtilities/inc/TrkSpecies.hh b/Mu2eUtilities/inc/TrkSpecies.hh deleted file mode 100644 index f990130cd1..0000000000 --- a/Mu2eUtilities/inc/TrkSpecies.hh +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef Mu2eUtilities_TrkSpecies_hh -#define Mu2eUtilities_TrkSpecies_hh -// -// Enum-matched-to-String class to identify the species -// of a reconstructable track. Here a species is both -// a particle type (e/mu/pi/K/p) and a charge. -// -// This is the same information provided by the class -// $BTRK_INC/BTrk/TrkBase/TrkParticle.hh -// Someday we should integrate the two. -// -// I could have called this mu2e::TrkParticle to emphasize -// the connection to ::TrkParticle but that seemd too dangerous: -// because the BTRK name is in the global namespace, there is some -// code might compile against the wrong include file. -// -// Contact person, Rob Kutschke -// - -#include -#include - -#include "Offline/GeneralUtilities/inc/EnumToStringSparse.hh" - -namespace mu2e { - - class TrkSpeciesDetail{ - public: - - enum enum_type { - unknown = 0, - e_minus = 11, - e_plus = -11, - mu_minus = 13, - mu_plus = -13, - pi_plus = 211, - pi_minus = -211, - K_plus = 321, - K_minus = -321, - p_plus = 2212, - anti_p_minus = -2212, - deuterium = 1000010020, - tritium = 1000010030, - He3 = 1000020030, - He4 = 1000020040 - }; - - static std::string const& typeName(); - - static std::map const& names(); - - }; - - typedef EnumToStringSparse TrkSpecies; -} - -#endif diff --git a/Mu2eUtilities/inc/polyAtan2.hh b/Mu2eUtilities/inc/polyAtan2.hh index de8473bb93..cab3e23305 100644 --- a/Mu2eUtilities/inc/polyAtan2.hh +++ b/Mu2eUtilities/inc/polyAtan2.hh @@ -9,8 +9,6 @@ // Modern CLHEP #include "CLHEP/Vector/ThreeVector.h" -// Ancient CLHEP, copied from BaBar -#include "BTrk/BbrGeom/HepPoint.h" namespace mu2e { diff --git a/Mu2eUtilities/src/KalRepInstanceNameDecoder.cc b/Mu2eUtilities/src/KalRepInstanceNameDecoder.cc deleted file mode 100644 index f87cbe191e..0000000000 --- a/Mu2eUtilities/src/KalRepInstanceNameDecoder.cc +++ /dev/null @@ -1,47 +0,0 @@ -// -// Decode the instance name of a KalRepCollection -// or a KalRepPtrCollection. -// -// Contact person, Rob Kutschke -// - -#include "Offline/GeneralUtilities/inc/EnumToStringSparse.hh" -#include "cetlib_except/exception.h" - -#include "Offline/Mu2eUtilities/inc/KalRepInstanceNameDecoder.hh" - -mu2e::KalRepInstanceNameDecoder::KalRepInstanceNameDecoder( std::string const& instanceName ): - instanceName_(instanceName), - direction_(), - particleType_(){ - - // Particle species field of the instance name; includes the particle name and charge. - std::string species; - - // Identify direction; extract species field. - if ( instanceName_.substr(0,8) == "Upstream" ){ - direction_ = TrkFitDirection::upstream; - species = instanceName_.substr(8); - } else if ( instanceName_.substr(0,10) == "Downstream" ){ - direction_ = TrkFitDirection::downstream; - species = instanceName_.substr(10); - } else{ - throw cet::exception("TRACKERINSTANCE") - <<"Cannot parse direction from track data product instance name = " << instanceName <<"\n"; - } - - particleType_ = TrkSpecies(species); - if ( particleType_ == TrkSpecies::unknown ){ - throw cet::exception("TRACKERINSTANCE") - <<"Cannot parse species from track data product instance name = " << instanceName <<"\n"; - } - if ( species.find("Plus") != std::string::npos ) { - charge_ = +1; - } else if ( species.find("Minus") != std::string::npos ){ - charge_ = -1; - } else{ - throw cet::exception("TRACKERINSTANCE") - <<"Cannot parse charge from track data product instance name = " << instanceName <<"\n"; - } - -} // end c'tor mu2e::KalRepInstanceNameDecoder diff --git a/Mu2eUtilities/src/TrkSpecies.cc b/Mu2eUtilities/src/TrkSpecies.cc deleted file mode 100644 index 572597e006..0000000000 --- a/Mu2eUtilities/src/TrkSpecies.cc +++ /dev/null @@ -1,44 +0,0 @@ -// -// Enum-matched-to-String class to identify the species -// of a reconstructable track. Here a species is both -// a particle type (e/mu/pi/K/p) and a charge. -// -// See header file for more details. -// -// Contact person, Rob Kutschke -// - -#include -#include - -#include "Offline/Mu2eUtilities/inc/TrkSpecies.hh" - -namespace mu2e { - - std::string const& TrkSpeciesDetail::typeName() { - static const std::string type("TrkSpecies"); - return type; - } - - std::map const& TrkSpeciesDetail::names(){ - static const std::map nam{ - std::make_pair(TrkSpecies::unknown, "unknown" ), - std::make_pair(TrkSpecies::e_minus, "eMinus" ), - std::make_pair(TrkSpecies::e_plus, "ePlus" ), - std::make_pair(TrkSpecies::mu_minus, "muMinus" ), - std::make_pair(TrkSpecies::mu_plus, "muPlus" ), - std::make_pair(TrkSpecies::pi_plus, "piPlus" ), - std::make_pair(TrkSpecies::pi_minus, "piMinus" ), - std::make_pair(TrkSpecies::K_plus, "KPlus" ), - std::make_pair(TrkSpecies::K_minus, "KMinus" ), - std::make_pair(TrkSpecies::p_plus, "pPlus" ), - std::make_pair(TrkSpecies::anti_p_minus, "pMinus" ), - std::make_pair(TrkSpecies::deuterium, "deuterium" ), - std::make_pair(TrkSpecies::tritium, "tritium" ), - std::make_pair(TrkSpecies::He3, "He3" ), - std::make_pair(TrkSpecies::He4, "He4" ) - }; - return nam; - } - -} diff --git a/ParticleID/src/ParticleIDRead_module.cc b/ParticleID/src/ParticleIDRead_module.cc index e0287eb7d8..34834897ca 100644 --- a/ParticleID/src/ParticleIDRead_module.cc +++ b/ParticleID/src/ParticleIDRead_module.cc @@ -21,10 +21,6 @@ #include "Offline/RecoDataProducts/inc/PIDProduct.hh" -#include "Offline/BTrkLegacy/inc/TrkParticle.hh" -// mu2e tracking -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - //ROOT #include "TTree.h" @@ -45,8 +41,6 @@ namespace mu2e { // Module label of the module that performed the fits. std::string _fitterModuleLabel; - TrkParticle _tpart; - TrkFitDirection _fdir; // Control level of printout. int _verbosity; diff --git a/ParticleID/src/SConscript b/ParticleID/src/SConscript index fb6c228a16..08773c1616 100644 --- a/ParticleID/src/SConscript +++ b/ParticleID/src/SConscript @@ -15,10 +15,8 @@ rootlibs = env['ROOTLIBS'] helper=mu2e_helper(env); libs = [ - 'mu2e_Mu2eBTrk', 'mu2e_TrkReco', 'mu2e_TrackerConditions', - 'mu2e_BTrkData', 'mu2e_RecoDataProducts', 'mu2e_DataProducts', 'mu2e_ConfigTools', diff --git a/ParticleID/test/test.fcl b/ParticleID/test/test.fcl index 86c5e1ff21..76c1ec45ce 100644 --- a/ParticleID/test/test.fcl +++ b/ParticleID/test/test.fcl @@ -23,7 +23,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault } diff --git a/Print/CMakeLists.txt b/Print/CMakeLists.txt index e657180475..93c4fff74d 100644 --- a/Print/CMakeLists.txt +++ b/Print/CMakeLists.txt @@ -44,7 +44,6 @@ cet_make_library( src/TrackSummaryPrinter.cc src/TriggerInfoPrinter.cc src/TriggerResultsPrinter.cc - src/TrkCaloIntersectPrinter.cc LIBRARIES PUBLIC KinKal::General Offline::ConditionsService @@ -86,21 +85,21 @@ cet_build_plugin(DataProductDump art::module REG_SOURCE src/DataProductDump_module.cc LIBRARIES REG Offline::Print - + ) cet_build_plugin(PrintModule art::module REG_SOURCE src/PrintModule_module.cc LIBRARIES REG Offline::Print - + ) cet_build_plugin(RunSubrunEvent art::module REG_SOURCE src/RunSubrunEvent_module.cc LIBRARIES REG Offline::Print - + ) diff --git a/Print/fcl/printLong.fcl b/Print/fcl/printLong.fcl index f56ffd993f..ec5f74f6bf 100644 --- a/Print/fcl/printLong.fcl +++ b/Print/fcl/printLong.fcl @@ -143,11 +143,6 @@ physics :{ #inputTags : [ "TrackSummaryMaker" ] # select instances } - kalRepPrinter : { - verbose: 0 # 0 - 5 (5 is KalRep printAll) - #inputTags : [ "TRFDeM" ] # select instances - } - kalSeedPrinter : { verbose: 4 # 0,1,2,3,4 #inputTags : [ "KFFDeM" ] # select instances diff --git a/Print/src/PrintModule_module.cc b/Print/src/PrintModule_module.cc index 10426bf5b4..9d23064e3e 100644 --- a/Print/src/PrintModule_module.cc +++ b/Print/src/PrintModule_module.cc @@ -25,7 +25,6 @@ #include "Offline/Print/inc/CrvStepPrinter.hh" #include "Offline/Print/inc/EventWindowMarkerPrinter.hh" #include "Offline/Print/inc/GenParticlePrinter.hh" -//#include "Offline/Print/inc/KalRepPrinter.hh" #include "Offline/Print/inc/KalSeedPrinter.hh" #include "Offline/Print/inc/MCTrajectoryPrinter.hh" #include "Offline/Print/inc/PhysicalVolumePrinter.hh" @@ -53,7 +52,6 @@ #include "Offline/Print/inc/TrackSummaryPrinter.hh" #include "Offline/Print/inc/TriggerInfoPrinter.hh" #include "Offline/Print/inc/TriggerResultsPrinter.hh" -#include "Offline/Print/inc/TrkCaloIntersectPrinter.hh" #include "art/Framework/Core/EDAnalyzer.h" using namespace std; @@ -237,11 +235,8 @@ mu2e::PrintModule::PrintModule(const Parameters& conf) : art::EDAnalyzer(conf), _printers.push_back(make_unique(conf().bkgQualPrinter())); _printers.push_back( make_unique(conf().trackClusterMatchPrinter())); - _printers.push_back( - make_unique(conf().trkCaloIntersectPrinter())); _printers.push_back( make_unique(conf().trackSummaryPrinter())); - //_printers.push_back(make_unique(conf().kalRepPrinter())); TODO: Check if OK _printers.push_back(make_unique(conf().comboHitPrinter())); _printers.push_back(make_unique(conf().timeClusterPrinter())); _printers.push_back(make_unique(conf().helixSeedPrinter())); diff --git a/Print/src/TrkCaloIntersectPrinter.cc b/Print/src/TrkCaloIntersectPrinter.cc deleted file mode 100644 index 87c4b6c710..0000000000 --- a/Print/src/TrkCaloIntersectPrinter.cc +++ /dev/null @@ -1,88 +0,0 @@ - -#include "Offline/Print/inc/TrkCaloIntersectPrinter.hh" -#include "art/Framework/Principal/Provenance.h" -#include -#include - -void mu2e::TrkCaloIntersectPrinter::Print(art::Event const& event, - std::ostream& os) { - if (verbose() < 1) return; - if (tags().empty()) { - // if a list of instances not specified, print all instances - std::vector > vah = - event.getMany(); - for (auto const& ah : vah) Print(ah); - } else { - // print requested instances - for (const auto& tag : tags()) { - auto ih = event.getValidHandle(tag); - Print(ih); - } - } -} - -void mu2e::TrkCaloIntersectPrinter::Print( - const art::Handle& handle, std::ostream& os) { - if (verbose() < 1) return; - // the product tags with all four fields, with underscores - std::string tag = handle.provenance()->productDescription().branchName(); - tag.pop_back(); // remove trailing dot - PrintHeader(tag, os); - Print(*handle); -} - -void mu2e::TrkCaloIntersectPrinter::Print( - const art::ValidHandle& handle, - std::ostream& os) { - if (verbose() < 1) return; - // the product tags with all four fields, with underscores - std::string tag = handle.provenance()->productDescription().branchName(); - tag.pop_back(); // remove trailing dot - PrintHeader(tag, os); - Print(*handle); -} - -void mu2e::TrkCaloIntersectPrinter::Print( - const TrkCaloIntersectCollection& coll, std::ostream& os) { - if (verbose() < 1) return; - os << "TrkCaloIntersectCollection has " << coll.size() << " intersections\n"; - if (verbose() == 1) PrintListHeader(); - int i = 0; - for (const auto& obj : coll) Print(obj, i++); -} - -void mu2e::TrkCaloIntersectPrinter::Print(const art::Ptr& obj, - int ind, std::ostream& os) { - if (verbose() < 1) return; - Print(*obj, ind); -} - -void mu2e::TrkCaloIntersectPrinter::Print(const mu2e::TrkCaloIntersect& obj, - int ind, std::ostream& os) { - if (verbose() < 1) return; - - os << std::setiosflags(std::ios::fixed | std::ios::right); - if (ind >= 0) os << std::setw(4) << ind; - - KalRepPtr const& tptr = obj.trk(); - KalRepPtr::key_type tkey = 0; - if (tptr) tkey = tptr.key(); - - os << " " << std::setw(5) << obj.diskId() << " " << std::setw(6) << tkey - << " " << std::setw(7) << obj.trkId() << " " - << " " << std::setw(8) << std::setprecision(1) << obj.pathLengthEntrance() - << " " << std::setw(8) << std::setprecision(1) - << obj.pathLenghtEntranceErr() << " " << std::setw(8) - << std::setprecision(1) << obj.pathLengthExit() << std::endl; -} - -void mu2e::TrkCaloIntersectPrinter::PrintHeader(const std::string& tag, - std::ostream& os) { - if (verbose() < 1) return; - os << "\nProductPrint " << tag << "\n"; -} - -void mu2e::TrkCaloIntersectPrinter::PrintListHeader(std::ostream& os) { - if (verbose() < 1) return; - os << "ind secId trkKey trkId path_ent path_ent_err path_exit\n"; -} diff --git a/ProditionsService/CMakeLists.txt b/ProditionsService/CMakeLists.txt index 6d789567ac..c65253c9c3 100644 --- a/ProditionsService/CMakeLists.txt +++ b/ProditionsService/CMakeLists.txt @@ -3,15 +3,12 @@ cet_make_library(INTERFACE INSTALLED_PATH_BASE Offline inc/ProditionsHandle.hh inc/ProditionsService.hh LIBRARIES INTERFACE - BTrk_MatEnv - BTrk_difAlgebra Offline::AnalysisConfig Offline::CaloConfig Offline::CRVConfig Offline::DAQConfig Offline::DbTables - Offline::Mu2eBTrk Offline::Mu2eInterfaces Offline::SimulationConfig Offline::STMConfig @@ -23,7 +20,7 @@ cet_build_plugin(ProditionsService art::service REG_SOURCE src/ProditionsService_service.cc LIBRARIES PUBLIC Offline::ProditionsService - + Offline::AnalysisConditions Offline::CaloConditions Offline::CRVConditions @@ -39,7 +36,7 @@ cet_build_plugin(ProditionsTest art::module REG_SOURCE src/ProditionsTest_module.cc LIBRARIES REG Offline::ProditionsService - + Offline::CRVConditions ) diff --git a/ProditionsService/inc/ProditionsService.hh b/ProditionsService/inc/ProditionsService.hh index 9af2343618..3d03f206a5 100644 --- a/ProditionsService/inc/ProditionsService.hh +++ b/ProditionsService/inc/ProditionsService.hh @@ -87,10 +87,6 @@ class ProditionsService { Name("alignedTracker"), Comment("Tracker alignment in reco code")}; fhicl::Table alignedTrackerSim{ Name("alignedTrackerSim"), Comment("Tracker alignment in sim code")}; - fhicl::Table mu2eMaterial{ - Name("mu2eMaterial"), Comment("Mu2e material for BTrk")}; - fhicl::Table mu2eDetector{ - Name("mu2eDetector"), Comment("Mu2e detector model for BTrk")}; fhicl::Table caloDAQConditions{ Name("caloDAQConditions"), Comment("DAQ channel maps for calorimeter")}; fhicl::Table trkQualCatalog{ @@ -100,7 +96,7 @@ class ProditionsService { fhicl::Table calCalib{ Name("calCalib"), Comment("calorimeter energy calib") }; - + }; // this line is required by art to allow the command line help print diff --git a/ProditionsService/src/SConscript b/ProditionsService/src/SConscript index 1c7548b243..132bd5b621 100644 --- a/ProditionsService/src/SConscript +++ b/ProditionsService/src/SConscript @@ -18,7 +18,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConfigTools', 'mu2e_SimulationConditions', 'mu2e_STMConditions', 'mu2e_CRVConditions', - 'mu2e_Mu2eBTrk', 'mu2e_GeometryService', 'mu2e_GeomPrimitives', 'mu2e_DbService', @@ -50,7 +49,6 @@ helper.make_plugins( [ mainlib, 'mu2e_SimulationConditions', 'mu2e_STMConditions', 'mu2e_CRVConditions', - 'mu2e_Mu2eBTrk', 'mu2e_GeometryService', 'mu2e_GeomPrimitives', 'mu2e_DbService', @@ -58,9 +56,6 @@ helper.make_plugins( [ mainlib, 'mu2e_RecoDataProducts', 'mu2e_GeneralUtilities', 'mu2e_Mu2eUtilities', - # 'mu2e_TrkDiag', # P.Murat: comment it out - 'BTrk_DetectorModel', - 'BTrk_MatEnv', 'CLHEP', 'art_Framework_Core', 'art_Framework_Principal', diff --git a/RecoDataProducts/CMakeLists.txt b/RecoDataProducts/CMakeLists.txt index dc5d0defb8..433cf0de7b 100644 --- a/RecoDataProducts/CMakeLists.txt +++ b/RecoDataProducts/CMakeLists.txt @@ -34,11 +34,7 @@ cet_make_library( src/TrkFitDirection.cc src/TrkFitFlag.cc src/TrkQual.cc - src/TrkToCaloExtrapol.cc LIBRARIES PUBLIC - BTrk_BbrGeom - BTrk_KalmanTrack - BTrk_ProbTools KinKal::Trajectory Offline::DataProducts diff --git a/RecoDataProducts/inc/KalRepCollection.hh b/RecoDataProducts/inc/KalRepCollection.hh deleted file mode 100644 index 3e81497461..0000000000 --- a/RecoDataProducts/inc/KalRepCollection.hh +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef TrkReco_KalRepCollection_hh -#define TrkReco_KalRepCollection_hh -// -// Define a type for a collection of KalRep objects. -// -// -// Original author Rob Kutschke -// -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/GeneralUtilities/inc/OwningPointerCollection.hh" - -namespace mu2e { - typedef mu2e::OwningPointerCollection KalRepCollection; -} - -#endif /* TrkReco_KalRepCollection_hh */ diff --git a/RecoDataProducts/inc/KalRepPtrCollection.hh b/RecoDataProducts/inc/KalRepPtrCollection.hh deleted file mode 100644 index 0b3bb1a26a..0000000000 --- a/RecoDataProducts/inc/KalRepPtrCollection.hh +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef RecoDataProducts_KalRepPtrCollection_hh -#define RecoDataProducts_KalRepPtrCollection_hh - -// -// Define a type for a collection of art::Ptr's to KalRep objects. -// -// -// Original author Rob Kutschke -// - - -// Any class that includes this header needs the following -// using declaration before including this header. This will -// be needed until the BaBar code is modified. -// using namespace CLHEP: - -#include "BTrk/KalmanTrack/KalRep.hh" -#include "canvas/Persistency/Common/Ptr.h" -#include - -namespace mu2e { - typedef art::Ptr KalRepPtr; - typedef std::vector KalRepPtrCollection; -} - -#endif /* RecoDataProducts_KalRepPtrCollection_hh */ diff --git a/RecoDataProducts/inc/TrackCaloAssns.hh b/RecoDataProducts/inc/TrackCaloAssns.hh deleted file mode 100644 index 22b5f4c8c1..0000000000 --- a/RecoDataProducts/inc/TrackCaloAssns.hh +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef RecoDataProducts_inc_TrackCaloAssns_hh -#define RecoDataProducts_inc_TrackCaloAssns_hh - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "canvas/Persistency/Common/Ptr.h" -#include "canvas/Persistency/Common/Assns.h" - -namespace mu2e { - class TrackCaloMatchInfo { - public: - TrackCaloMatchInfo() {}; - TrackCaloMatchInfo( - double chi2 - , double chi2Pos - , double chi2Time - , double kFrac - , double kinetic - , double eOverP) - { - _chi2 = chi2; - _chi2Pos = chi2Pos; - _chi2Time = chi2Time; - _kFrac = kFrac; - _kinetic = kinetic; - _eOverP = eOverP; - } - - - double getChi2() const {return _chi2;} - double getChi2Pos() const {return _chi2Pos;} - double getChi2Time() const {return _chi2Time;} - double getKineticFrac() const {return _kFrac;} - double getKinetic() const {return _kinetic;} - double getEOverP() const {return _eOverP;} - - - private: - double _chi2; - double _chi2Pos; - double _chi2Time; - double _kFrac; - double _kinetic; - double _eOverP; - - }; - - - // use as many-to-many Assns (want track, cluster, payload not Ptr's) - typedef art::Assns TrackCaloMatchAssns; - // typedef art::Assns TrackCaloMatchAssns; - typedef std::vector TrackCaloAssnsCollection; -} -#endif /*RecoDataProducts_inc_TrackCaloAssns_hh*/ - diff --git a/RecoDataProducts/inc/TrackSummaryRecoMap.hh b/RecoDataProducts/inc/TrackSummaryRecoMap.hh deleted file mode 100644 index e4698b933f..0000000000 --- a/RecoDataProducts/inc/TrackSummaryRecoMap.hh +++ /dev/null @@ -1,17 +0,0 @@ -// A transient class to associate TrackSummary with the KalRep it corresponds to. -// -// Andrei Gaponenko, 2014 - -#ifndef RecoDataProducts_inc_TrackSummaryRecoMap_hh -#define RecoDataProducts_inc_TrackSummaryRecoMap_hh - -#include "canvas/Persistency/Common/Assns.h" - -#include "Offline/RecoDataProducts/inc/TrackSummary.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -namespace mu2e { - typedef art::Assns TrackSummaryRecoMap; -} - -#endif /* RecoDataProducts_inc_TrackSummaryRecoMap_hh */ diff --git a/RecoDataProducts/inc/TrkCaloIntersect.hh b/RecoDataProducts/inc/TrkCaloIntersect.hh deleted file mode 100644 index 7a99328418..0000000000 --- a/RecoDataProducts/inc/TrkCaloIntersect.hh +++ /dev/null @@ -1,81 +0,0 @@ -// -// Container for the info of the iterception of a track with the calorimeter sections -// -// Original author B. Echenard -// - - -#ifndef RecoDataProducts_TrkCaloIntersect_hh -#define RecoDataProducts_TrkCaloIntersect_hh - - -#include -// Mu2e includes: -#include "canvas/Persistency/Common/Ptr.h" - - -//tracker includes -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - - - - -namespace mu2e { - - - class TrkCaloIntersect { - - public: - - TrkCaloIntersect():_diskId(-1),_trk(),_trkId(-1),_pathLengthEntrance(0.0),_pathLengthEntranceErr(0),_pathLengthExit(0.0) {} - - TrkCaloIntersect(int section, KalRepPtr& trk, int trkId, double entrance, double entranceErr, double exit): - _diskId(section), _trk(trk), _trkId(trkId), _pathLengthEntrance(entrance),_pathLengthEntranceErr(entranceErr), _pathLengthExit(exit) - {} - - ~TrkCaloIntersect(){} - - - int diskId() const {return _diskId;} - double pathLengthEntrance() const {return _pathLengthEntrance;} - double pathLengthExit() const {return _pathLengthExit;} - double pathLenghtEntranceErr() const {return _pathLengthEntranceErr;} - KalRepPtr const& trk() const {return _trk; } - int trkId() const {return _trkId; } - - - private: - - int _diskId; - KalRepPtr _trk; - int _trkId; - double _pathLengthEntrance; - double _pathLengthEntranceErr; - double _pathLengthExit; - - }; - typedef std::vector TrkCaloIntersectCollection; - - -} - -#endif - - -/* -Copied a few useful trk accessors - - double time() const {return _trk->arrivalTime(_pathLengthEntrance);} - double t0Err() const {return _trk->t0().t0Err();} - double t0() const {return _trk->t0().t0();} - double fitConsistency() const {return _trk->chisqConsistency().consistency();} - HepPoint entrancePosition() const {return _trk->position(_pathLengthEntrance);} - BbrPointErr entrancePositionErr() const {return _trk->positionErr(_pathLengthEntrance);} - HepPoint exitPosition() const {return _trk->position(_pathLengthExit);} - BbrPointErr exitPositionErr() const {return _trk->positionErr(_pathLengthExit);} - Hep3Vector momentum() const {return _trk->momentum(_pathLengthEntrance);} - BbrVectorErr momentumErr() const {return _trk->momentumErr(_pathLengthEntrance);} - Hep3Vector t0Momentum() const {return _trk->momentum(_trk->firstHit()->kalHit()->hitOnTrack()->fltLen());} - BbrVectorErr t0MomentumErr() const {return _trk->momentumErr(_trk->firstHit()->kalHit()->hitOnTrack()->fltLen());} -*/ - diff --git a/RecoDataProducts/inc/TrkCaloMatch.hh b/RecoDataProducts/inc/TrkCaloMatch.hh deleted file mode 100644 index 1cd7102bce..0000000000 --- a/RecoDataProducts/inc/TrkCaloMatch.hh +++ /dev/null @@ -1,71 +0,0 @@ -// -// Container for the info of the extrapolated trajectory on the calorimeter -// -// -// Original author G. Pezzullo / amended by B. Echenard -// - - -#ifndef RecoDataProducts_TrkCaloMatch_hh -#define RecoDataProducts_TrkCaloMatch_hh - - -#include -// Mu2e includes: -#include "canvas/Persistency/Common/Ptr.h" - - -//tracker includes -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" - - - - -namespace mu2e { - - - class TrkCaloMatch { - - - public: - - TrkCaloMatch() {} - - TrkCaloMatch(art::Ptr const& intersect, art::Ptr const& cluster, int cluId, double chi2, double chi2Pos, double chi2Time) : - _intersect(intersect), _cluster(cluster), _cluId(cluId), _chi2(chi2), _chi2Pos(chi2Pos), _chi2Time(chi2Time) - {} - - ~TrkCaloMatch(){} - - art::Ptr const& intersect() const {return _intersect;} - KalRepPtr const& trk() const {return _intersect->trk();} - int trkId() const {return _intersect->trkId();} - - art::Ptr const& cluster() const {return _cluster;} - int cluId() const {return _cluId;} - - double chi2() const {return _chi2;} - double chi2Pos() const {return _chi2Pos;} - double chi2Time() const {return _chi2Time;} - - - - private: - - art::Ptr _intersect; - art::Ptr _cluster; - int _cluId; - double _chi2; - double _chi2Pos; - double _chi2Time; - - }; - - typedef std::vector TrkCaloMatchCollection; - -} - -#endif - diff --git a/RecoDataProducts/inc/TrkExtTraj.hh b/RecoDataProducts/inc/TrkExtTraj.hh deleted file mode 100644 index 1b5651fdfc..0000000000 --- a/RecoDataProducts/inc/TrkExtTraj.hh +++ /dev/null @@ -1,129 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// *Note on point information* -// TrkExtTrajPoint have the point information AFTER the extrapolation step. -// When the extrapolation crosses a volume change, the "after" step of -// extrapolation locates nearest to the boundary across the bounday. -// (The "before" step certainly locates before the boundary.) Therefore, -// the TrkExtTrajPoint information for volume crossing is the information -// after the bounday, but as nearest as possible to the boundary -// (i.e. the changed volume) -// -// The _pa/sthitidx vectors records the trajPointID of -// these bounday-changing points. -// Therefore, the "first" TrkExtTrajPoint locates inside the PA/ST volume, -// where the "second" TrkExtTrajPoint locates outside of the PA/ST. -// -// By calling addPA/STHit() in the extrapolation module, the vector of -// _pa/sthitidx are filled with the "first" and "second" trajPointIDs of -// PA/ST hits. -// These are converted to the index of _pt and stored in the vector of -// _ptidx_pa/st, by calling makePASTHitTable() from the extrapolation module. -// -// Note that the index of _pt and trajPointID are not same. The trajPointID -// increase by one at each extrapolation steps. The index of _pt increases -// when they are recorded. The recording step is not the same with the -// extrapolation step, and can be adjusted from the configuration. The _pt -// is filled and recorded when the flight length reaches to recording step, -// or at the start and stop of extrapolation, or at the volume change, -// or inside the PA/ST. -// These are properly implemented in the extrapolation module. - - -#ifndef TrkExtTraj_HH -#define TrkExtTraj_HH - -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "Offline/RecoDataProducts/inc/TrkExtTrajPoint.hh" -#include -#include - -namespace mu2e { - - - - class TrkExtTraj { - - public: - TrkExtTraj(); - TrkExtTraj(const TrkExtTrajPoint & trajPoint); - TrkExtTraj (const TrkExtTraj & dt) ; - ~TrkExtTraj() {;} - TrkExtTraj & operator = (const TrkExtTraj & dt) ; - - // vector-like modifier - void push_back (const TrkExtTrajPoint & trajPoint) ; - void clear() ; - - // vector-like accessor - unsigned int size () const { return _pt.size(); } - TrkExtTrajPoint & operator [] (int i) ; - TrkExtTrajPoint operator [] (int i) const; - TrkExtTrajPoint & front () { return _pt.front(); } - TrkExtTrajPoint front () const { return _pt.front(); } - TrkExtTrajPoint & back () { return _pt.back(); } - TrkExtTrajPoint back () const { return _pt.back(); } - - // other modifier - void setExitCode(int ret) {_ret = ret;} - void addPAHit (unsigned int idx1, unsigned int idx2) { _pahitidx.push_back(std::make_pair(idx1,idx2)); } - void addSTHit (unsigned int idx1, unsigned int idx2) { _sthitidx.push_back(std::make_pair(idx1,idx2)); } - void makePASTHitTable (void); - void setHepid (int hepid) { _hepid = hepid; } - - // other accessor - int hepid() const {return _hepid; } - int exitCode() const { return _ret; } - double flightLength() const { return back().flightLength(); } - double flightTime() const { return back().flightTime(); } -// std::vector > & paHitIndex () { return _pahitidx; } -// std::vector > & stHitIndex () { return _sthitidx; } - int id() const { return 0; } //TODO. used in EventDisplay/DataInterface.cc. - //Note on id() : Better to replace to correponding trkId. - //It's not possilbe since there is no connection to KalRep. - unsigned int getNPAHits () const { return _pahitidx.size(); } - unsigned int getNSTHits () const { return _sthitidx.size(); } - const TrkExtTrajPoint & getFirstPAHit (unsigned int i) const ; - const TrkExtTrajPoint & getFirstSTHit (unsigned int i) const ; - TrkExtTrajPoint getMeanPAHit (unsigned int i) const ; - TrkExtTrajPoint getMeanSTHit (unsigned int i) const ; - double getDeltapPA (unsigned int i) const { return _deltap_pa[i]; } - double getDeltapST (unsigned int i) const { return _deltap_st[i]; } - double getDeltapPA (void) const ; - double getDeltapST (void) const ; - - std::vector getPointsAtZ (double z, unsigned int idx1 = 0, unsigned int idx2 = 0) const; - //CLHEP::TrkExtTrajPoint getPointAtFl (double fl) const; //TODO - - private: - unsigned int findPASTHit (unsigned int idx, unsigned int start); - unsigned int findNeighborsZ (double z, std::vector & idx, unsigned int idx1 =0, unsigned int idx2=0) const; - //int findNeighborsFl (double z, unsigned int idx) const; -// double interpolate2 (double z, double x1, double x2, double y1, double y2) const; - double interpolate3 (double z, double x1, double x2, double x3, double y1, double y2, double y3) const; - TrkExtTrajPoint interpolatePoint(unsigned int first, unsigned int second) const; - - private: - std::vector _pt; // ext point info - int _hepid; - int _ret; // exit code - std::vector > _pahitidx; // trajPointIdx pair for entering and exiting PA/ST - std::vector > _sthitidx; - - std::vector > _ptidx_pa; // index in _pt corresponding to _pa/sthitidx - std::vector > _ptidx_st; - std::vector _deltap_pa; - std::vector _deltap_st; - - }; - - typedef std::vector TrkExtTrajCollection; - - -} // end namespace mu2e - - -#endif diff --git a/RecoDataProducts/src/SConscript b/RecoDataProducts/src/SConscript index 69ff72c1f2..2c65258159 100644 --- a/RecoDataProducts/src/SConscript +++ b/RecoDataProducts/src/SConscript @@ -16,14 +16,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_DataProducts', 'mu2e_GeomPrimitives', 'mu2e_GeometryService', 'mu2e_GeneralUtilities', - 'BTrk_KalmanTrack', - 'BTrk_TrkBase', - 'BTrk_BbrGeom', - 'BTrk_ProbTools', - 'BTrk_difAlgebra', - 'BTrk_BField', - 'BTrk_BaBar', - 'BTrk_DetectorModel', 'art_Framework_Core', 'art_Framework_Principal', 'art_Persistency_Common', @@ -48,10 +40,6 @@ helper.make_dict_and_map( [ mainlib, 'mu2e_GeomPrimitives', 'mu2e_GeneralUtilities', 'mu2e_TrackerGeom', - 'BTrk_KalmanTrack', - 'BTrk_TrkBase', - 'BTrk_ProbTools', - 'BTrk_BaBar', 'art_Persistency_Common', 'art_Persistency_Provenance', 'art_Utilities', diff --git a/RecoDataProducts/src/classes.h b/RecoDataProducts/src/classes.h index e1c8d7204f..9bbaf3c409 100644 --- a/RecoDataProducts/src/classes.h +++ b/RecoDataProducts/src/classes.h @@ -46,8 +46,6 @@ #include "Offline/RecoDataProducts/inc/KKLine.hh" #include "Offline/RecoDataProducts/inc/TrkFitFlag.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" #include "Offline/RecoDataProducts/inc/KKLoopHelix.hh" #include "Offline/RecoDataProducts/inc/KKCentralHelix.hh" #include "Offline/RecoDataProducts/inc/TrackSummaryRecoMap.hh" @@ -64,8 +62,6 @@ #include "Offline/RecoDataProducts/inc/MVAResult.hh" // extrapolation and PID -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloMatch.hh" #include "Offline/RecoDataProducts/inc/PIDProduct.hh" #include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" diff --git a/RecoDataProducts/src/classes_def.xml b/RecoDataProducts/src/classes_def.xml index 6ffd658f57..59fc1d2c43 100644 --- a/RecoDataProducts/src/classes_def.xml +++ b/RecoDataProducts/src/classes_def.xml @@ -191,15 +191,6 @@ - - - - - - - - - @@ -208,10 +199,6 @@ - - - - @@ -309,34 +296,11 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -346,16 +310,6 @@ - - - - - - - - - - diff --git a/SimulationConditions/src/SConscript b/SimulationConditions/src/SConscript index ff59538c45..ef811d5056 100644 --- a/SimulationConditions/src/SConscript +++ b/SimulationConditions/src/SConscript @@ -16,7 +16,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', - 'mu2e_Mu2eBTrk', 'mu2e_TrackerGeom', 'mu2e_MCDataProducts', @@ -27,10 +26,7 @@ mainlib = helper.make_mainlib ( [ 'mu2e_GeneralUtilities', 'mu2e_DbService', 'mu2e_DbTables', - 'BTrk_BaBar', - 'BTrk_MatEnv', - 'BTrk_DetectorModel', - 'art_Framework_Services_Registry', + 'art_Framework_Services_Registry', 'art_root_io_tfile_support', 'art_Utilities', 'canvas', diff --git a/TEveEventDisplay/CMakeLists.txt b/TEveEventDisplay/CMakeLists.txt index 22622b9872..e2f7c8936f 100644 --- a/TEveEventDisplay/CMakeLists.txt +++ b/TEveEventDisplay/CMakeLists.txt @@ -6,7 +6,6 @@ cet_make_library( src/TEveMu2eCluster.cc src/TEveMu2eCRV.cc src/TEveMu2eCRVEvent.cc - src/TEveMu2eCustomHelix.cc src/TEveMu2eDataInterface.cc src/TEveMu2eHit.cc src/TEveMu2eMainWindow.cc @@ -16,7 +15,6 @@ cet_make_library( src/TEveMu2eStraightTrack.cc src/TEveMu2eTracker.cc LIBRARIES PUBLIC - BTrk_difAlgebra Offline::ConfigTools Offline::GeometryService Offline::GlobalConstantsService @@ -31,7 +29,7 @@ cet_build_plugin(TEveEventDisplay art::module art_root_io::TFileService_service Offline::TEveEventDisplay Offline::TEveEventDisplay_dict - + ) cet_build_plugin(TEveGDMLTest art::module @@ -40,7 +38,7 @@ cet_build_plugin(TEveGDMLTest art::module art_root_io::TFileService_service Offline::TEveEventDisplay Offline::TEveEventDisplay_dict - + ) cet_build_plugin(TEveNonGDMLTest art::module @@ -49,7 +47,7 @@ cet_build_plugin(TEveNonGDMLTest art::module art_root_io::TFileService_service Offline::TEveEventDisplay Offline::TEveEventDisplay_dict - + ) art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults diff --git a/TEveEventDisplay/src/SConscript b/TEveEventDisplay/src/SConscript index e1f17e9f2d..e6f6d72655 100644 --- a/TEveEventDisplay/src/SConscript +++ b/TEveEventDisplay/src/SConscript @@ -21,9 +21,7 @@ userlibs = [ rootlibs, extrarootlibs, babarlibs, 'mu2e_DataProducts', - 'mu2e_Mu2eBTrk', 'mu2e_TrkReco', - 'mu2e_BTrkData', 'mu2e_Mu2eUtilities', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', diff --git a/TEveEventDisplay/src/TEveMu2eCustomHelix.cc b/TEveEventDisplay/src/TEveMu2eCustomHelix.cc deleted file mode 100644 index 2c0dc45ba3..0000000000 --- a/TEveEventDisplay/src/TEveMu2eCustomHelix.cc +++ /dev/null @@ -1,50 +0,0 @@ -#include "Offline/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eCustomHelix.h" -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" - -using namespace mu2e; -namespace mu2e{ - - TEveMu2eCustomHelix::TEveMu2eCustomHelix(){} - - /*------------Function to build Infor after contruction:-------------*/ - void TEveMu2eCustomHelix::SetSeedInfo(KalSeed seed) { - fKalSeed_ = seed; - auto const& fseg = fKalSeed_.segments().front(); - this->Momentum_ = fseg.mom(); - this->PDGcode_ = fKalSeed_.particle(); - auto const& ptable = mu2e::GlobalConstantsHandle(); - this->Charge_ = ptable->particle(fKalSeed_.particle()).charge(); - this->Mass_ = ptable->particle(fKalSeed_.particle()).mass(); - this->Radius_ = fabs(1.0/fseg.helix().omega()); - this->Time_ = fKalSeed_.t0().t0(); - } - - /*------------Function tobuild position and direction based on Kal output:-------------*/ - void TEveMu2eCustomHelix::SetPostionAndDirectionFromKalRep(double zpos){ - auto const& fseg = fKalSeed_.segments().front(); // find the segment nearest zpos. This should be iterative FIXME - auto pos = fseg.position3(); - auto vel = fseg.velocity(); - double tz = fseg.tref() + (zpos-pos.Z())/vel.Z(); - auto zseg = fKalSeed_.nearestSegment(tz); - pos = zseg->position3(); - vel = zseg->velocity(); - tz = zseg->tref() + (zpos-pos.Z())/vel.Z(); - this->Momentum_ = zseg->mom(); - // these next assume a helix FIXME - auto hel = zseg->centralHelix(); - Position_ = hel.position3(tz); - Direction_ = hel.direction(tz); - - } - - /*void TEveMu2eCustomHelix::SetMomentumExt(){ - this->Momentum_ = fTrkExtTraj.front().momentum().mag(); // Not sure what this is supposed to do FIXME - } - - void TEveMu2eCustomHelix::SetParticleExt(){ - this->PDGcode_ = 11; - - }*/ - -} diff --git a/TEveEventDisplay/src/TEveMu2eDataInterface.cc b/TEveEventDisplay/src/TEveMu2eDataInterface.cc index 78c67281d5..05ce2ebd3c 100644 --- a/TEveEventDisplay/src/TEveMu2eDataInterface.cc +++ b/TEveEventDisplay/src/TEveMu2eDataInterface.cc @@ -666,7 +666,7 @@ void TEveMu2eDataInterface::FillKinKalTrajectory(bool firstloop, std::tupletoMu2e(p); - line->SetPostionAndDirectionFromKalRep((InMu2e.z())); +// line->SetPostionAndDirectionFromKalRep((InMu2e.z())); line->SetNextPoint(pointmmTocm(InMu2e.x()), pointmmTocm(InMu2e.y()), pointmmTocm(InMu2e.z())); line_twoDXY->SetNextPoint(pointmmTocm(p.x()), pointmmTocm(p.y()), pointmmTocm(p.z())); line_twoDXZ->SetNextPoint(pointmmTocm(p.x()), pointmmTocm(p.y()), pointmmTocm(p.z())); diff --git a/TrackCaloMatching/CMakeLists.txt b/TrackCaloMatching/CMakeLists.txt deleted file mode 100644 index f32f60fdd0..0000000000 --- a/TrackCaloMatching/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -cet_build_plugin(TrackCaloIntersection art::module - REG_SOURCE src/TrackCaloIntersection_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrackCaloIntersectionMVA art::module - REG_SOURCE src/TrackCaloIntersectionMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrackCaloMatchingExtend art::module - REG_SOURCE src/TrackCaloMatchingExtend_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrackCaloMatching art::module - REG_SOURCE src/TrackCaloMatching_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::ConditionsService - Offline::GeometryService - Offline::RecoDataProducts - ROOT::Physics -) - -cet_build_plugin(TrackCaloMatchingMVA art::module - REG_SOURCE src/TrackCaloMatchingMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrkExtrapol art::module - REG_SOURCE src/TrkExtrapol_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::ConditionsService - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::TrackerGeom -) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcl/prolog.fcl ${CURRENT_BINARY_DIR} fcl/prolog.fcl COPYONLY) - -install_source(SUBDIRS src) -install_fhicl(SUBDIRS fcl SUBDIRNAME Offline/TrackCaloMatching/fcl) diff --git a/TrackCaloMatching/fcl/prolog.fcl b/TrackCaloMatching/fcl/prolog.fcl deleted file mode 100644 index 679203546c..0000000000 --- a/TrackCaloMatching/fcl/prolog.fcl +++ /dev/null @@ -1,477 +0,0 @@ -# -*- mode: tcl -*- -#------------------------------------------------------------------------------ -# this file is included by fcl/standardProducers.fcl inside the PROLOG section -# track extrapolation to the calorimeter -# TrackCaloMatching.DtOffset is defined in fcl/TrkCaloDt.fcl -#------------------------------------------------------------------------------ -#include "Offline/fcl/TrkCaloDt.fcl" -BEGIN_PROLOG - -TrackCaloMatching : { @table::TrackCaloMatching # general namespace for everything defined in this file - producers : { -#------------------------------------------------------------------------------ -# module prototypes -#------------------------------------------------------------------------------ - TrackCaloIntersection : { module_type:TrackCaloIntersection - diagLevel : 0 - fitterModuleLabel : MergePatRec - downstream : true - pathStep : 20. # mm - tolerance : 1. # mm - checkExit : true - outputNtup : false - } - } -} - -TrackCaloMatching : { @table::TrackCaloMatching - - producers : { @table::TrackCaloMatching.producers - - TrackCaloMatching : { module_type:TrackCaloMatching - debugLevel : 0 - minClusterEnergy : 10. # MeV - maxDeltaT : 10. # ns - - fitterModuleLabel: @local::TrackCaloMatching.producers.TrackCaloIntersection.fitterModuleLabel - - sigmaE : 10. # MeV - sigmaT : 1. # ns - sigmaU : 20. # mm - sigmaV : 10. # mm -#------------------------------------------------------------------------------ -# not a guess any more, but the number by Alex -# 2017-01-05: change to 53 mm for CsI (electrons), the corresponding muon number is 19 mm -#------------------------------------------------------------------------------ - meanInteractionDepth : 53. # mm (electrons, see mu2e-8439 -#------------------------------------------------------------------------------ -# 2015-02-07: TrackCaloMatching.DtOffset set in fcl/standardProducers.fcl -#------------------------------------------------------------------------------ - dtOffset : @local::TrackCaloMatching.DtOffset # ns - - trkToCaloExtrapolModuleLabel : TrackCaloIntersection - caloClusterModuleLabel : CaloClusterMaker -#------------------------------------------------------------------------------ -# track fitter has to be the same as used by TrackCaloIntersection -#------------------------------------------------------------------------------ - outPutNtup : 0 - caloClusterAlgorithm : closest - caloClusterSeeding : energy - } - } -} -#------------------------------------------------------------------------------ -# extrapolation module species -#------------------------------------------------------------------------------ -TrackCaloMatching : { @table::TrackCaloMatching - - producers : { @table::TrackCaloMatching.producers - - TrackCaloIntersectionDem : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecDem - } - - TrackCaloIntersectionDmm : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecDmm - } - - TrackCaloIntersectionDep : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecDep - } - - TrackCaloIntersectionDpp : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecDpp - } - - TrackCaloIntersectionDmp : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecDmp - } - - TrackCaloIntersectionUem : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecUem - } - - TrackCaloIntersectionUmm : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecUmm - } - - TrackCaloIntersectionUep : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecUep - } - - TrackCaloIntersectionUmp : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : MergePatRecUmp - } - - TrackCaloIntersectionCpr : { @table::TrackCaloMatching.producers.TrackCaloIntersection # CalPatRec only - fitterModuleLabel : MergePatRecCpr - } - - TrackCaloIntersectionCprDem : { @table::TrackCaloMatching.producers.TrackCaloIntersection # CalPatRec only - fitterModuleLabel : MergePatRecCprDem - } - - TrackCaloIntersectionCprDep : { @table::TrackCaloMatching.producers.TrackCaloIntersection # CalPatRec only - fitterModuleLabel : MergePatRecCprDep - } - - TrackCaloIntersectionTpr : { @table::TrackCaloMatching.producers.TrackCaloIntersection # CalPatRec only - fitterModuleLabel : MergePatRecTpr - } - - TrackCaloIntersectionTprDem : { @table::TrackCaloMatching.producers.TrackCaloIntersection # CalPatRec only - fitterModuleLabel : MergePatRecTprDem - } - - TrackCaloIntersectionTprDep : { @table::TrackCaloMatching.producers.TrackCaloIntersection # CalPatRec only - fitterModuleLabel : MergePatRecTprDep - } -#------------------------------------------------------------------------------ -# define modules for cases where the helices were merged by MergeHelixFinder -#------------------------------------------------------------------------------ - TciDeMHPar : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : KFFDeMHPar - } - - TciDeMHDar : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : KFFDeMHDar - } - - TciDmuMHPar : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : KFFDmuMHPar - } - - TciDmuMHDar : { @table::TrackCaloMatching.producers.TrackCaloIntersection - fitterModuleLabel : KFFDmuMHDar - } - } -} -#------------------------------------------------------------------------------ -# track-cluster matching module species -#------------------------------------------------------------------------------ -TrackCaloMatching : { @table::TrackCaloMatching - - producers : { @table::TrackCaloMatching.producers - - TrackCaloMatchingDem : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionDem - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionDem.fitterModuleLabel # MergePatRecDem - } - - TrackCaloMatchingDmm : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionDmm - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionDmm.fitterModuleLabel # MergePatRecDmm - } - - TrackCaloMatchingDep : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionDep - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionDep.fitterModuleLabel # MergePatRecDep - } - - TrackCaloMatchingDpp : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionDpp - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionDpp.fitterModuleLabel # MergePatRecDpp - } - - TrackCaloMatchingDmp : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionDmp - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionDmp.fitterModuleLabel # MergePatRecDmp - } - - TrackCaloMatchingUem : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionUem - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionUem.fitterModuleLabel - } - - TrackCaloMatchingUmm : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionUmm - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionUmm.fitterModuleLabel - } - - TrackCaloMatchingUep : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionUep - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionUep.fitterModuleLabel - } - - TrackCaloMatchingUmp : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionUmp - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionUmp.fitterModuleLabel - } - - TrackCaloMatchingCpr : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionCpr - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionCpr.fitterModuleLabel - } - - TrackCaloMatchingTpr : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionTpr - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionTpr.fitterModuleLabel - } - - TrackCaloMatchingCprDem : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionCprDem - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionCprDem.fitterModuleLabel - } - - TrackCaloMatchingCprDep : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionCprDep - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionCprDep.fitterModuleLabel - } - - TrackCaloMatchingTprDem : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionTprDem - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionTprDem.fitterModuleLabel - } - - TrackCaloMatchingTprDep : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TrackCaloIntersectionTprDep - fitterModuleLabel : @local::TrackCaloMatching.producers.TrackCaloIntersectionTprDep.fitterModuleLabel - } - -#------------------------------------------------------------------------------ -# define modules for the case were is MergeHelixFinder sequence is used - both signs -#------------------------------------------------------------------------------ - TcmDeMHPar : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TciDeMHPar - fitterModuleLabel : @local::TrackCaloMatching.producers.TciDeMHPar.fitterModuleLabel - } - - TcmDeMHDar : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TciDeMHDar - fitterModuleLabel : @local::TrackCaloMatching.producers.TciDeMHDar.fitterModuleLabel - } - - TcmDmuMHPar : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TciDmuMHPar - fitterModuleLabel : @local::TrackCaloMatching.producers.TciDmuMHPar.fitterModuleLabel - } - - TcmDmuMHDar : { @table::TrackCaloMatching.producers.TrackCaloMatching - trkToCaloExtrapolModuleLabel: TciDmuMHDar - fitterModuleLabel : @local::TrackCaloMatching.producers.TciDmuMHDar.fitterModuleLabel - } - } -} -#------------------------------------------------------------------------------ -# sequences -#------------------------------------------------------------------------------ -TrackCaloMatching.matching : [ TrackCaloIntersection , TrackCaloMatching ] # this is the default - -TrackCaloMatching.matching_cpr : [ TrackCaloIntersectionCpr, TrackCaloMatchingCpr ] -TrackCaloMatching.matching_tpr : [ TrackCaloIntersectionTpr, TrackCaloMatchingTpr ] - -TrackCaloMatching.matching_cpr_dem : [ TrackCaloIntersectionCprDem, TrackCaloMatchingCprDem ] -TrackCaloMatching.matching_tpr_dem : [ TrackCaloIntersectionTprDem, TrackCaloMatchingTprDem ] - -TrackCaloMatching.matching_cpr_dep : [ TrackCaloIntersectionCprDep, TrackCaloMatchingCprDep ] -TrackCaloMatching.matching_tpr_dep : [ TrackCaloIntersectionTprDep, TrackCaloMatchingTprDep ] - -TrackCaloMatching.matching_dem : [ TrackCaloIntersectionDem, TrackCaloMatchingDem ] -TrackCaloMatching.matching_dmm : [ TrackCaloIntersectionDmm, TrackCaloMatchingDmm ] -TrackCaloMatching.matching_dep : [ TrackCaloIntersectionDep, TrackCaloMatchingDep ] -TrackCaloMatching.matching_dpp : [ TrackCaloIntersectionDpp, TrackCaloMatchingDpp ] -TrackCaloMatching.matching_dmp : [ TrackCaloIntersectionDmp, TrackCaloMatchingDmp ] -TrackCaloMatching.matching_uem : [ TrackCaloIntersectionUem, TrackCaloMatchingUem ] -TrackCaloMatching.matching_umm : [ TrackCaloIntersectionUmm, TrackCaloMatchingUmm ] -TrackCaloMatching.matching_uep : [ TrackCaloIntersectionUep, TrackCaloMatchingUep ] -TrackCaloMatching.matching_ump : [ TrackCaloIntersectionUmp, TrackCaloMatchingUmp ] - -TrackCaloMatching.matching_DeMHPar : [ TciDeMHPar , TcmDeMHPar ] -TrackCaloMatching.matching_DeMHDar : [ TciDeMHDar , TcmDeMHDar ] - -TrackCaloMatching.matching_DmuMHPar : [ TciDmuMHPar, TcmDmuMHPar ] -TrackCaloMatching.matching_DmuMHDar : [ TciDmuMHDar, TcmDmuMHDar ] -#------------------------------------------------------------------------------ -# preserve backward compatibility -#------------------------------------------------------------------------------ -# TrackCaloIntersectionOld : { @table::TrackCaloMatching.producers.TrackCaloIntersection } -# TrackCaloMatchingOld : { @table::TrackCaloMatching.producers.TrackCaloMatching } - -#------------------------------------------------------------------------------ -# TrkExtrapol is deprecated -#------------------------------------------------------------------------------ -TrkExtrapol : { - module_type : TrkExtrapol - fitterModuleLabel : KFFDeM - fitparticle : @local::Particle.eminus - fitdirection : @local::FitDir.downstream - diagLevel : 0 -} -#------------------------------------------------------------------------------ -# other old-style stuff -#------------------------------------------------------------------------------ -TrkExtrapolDeM : @local::TrkExtrapol -TrkExtrapolDeM.fitparticle : @local::Particle.eminus -TrkExtrapolDeM.fitdirection : @local::FitDir.downstream - -TrkExtrapolUeM : @local::TrkExtrapol -TrkExtrapolUeM.fitparticle : @local::Particle.eminus -TrkExtrapolUeM.fitdirection : @local::FitDir.upstream - -TrkExtrapolDeP : @local::TrkExtrapol -TrkExtrapolDeP.fitparticle : @local::Particle.eplus -TrkExtrapolDeP.fitdirection : @local::FitDir.downstream - -TrkExtrapolUeP : @local::TrkExtrapol -TrkExtrapolUeP.fitparticle : @local::Particle.eplus -TrkExtrapolUeP.fitdirection : @local::FitDir.upstream - -TrkExtrapolDmuM : @local::TrkExtrapol -TrkExtrapolDmuM.fitparticle : @local::Particle.muminus -TrkExtrapolDmuM.fitdirection : @local::FitDir.downstream - -TrkExtrapolUmuM : @local::TrkExtrapol -TrkExtrapolUmuM.fitparticle : @local::Particle.muminus -TrkExtrapolUmuM.fitdirection : @local::FitDir.upstream - -TrkExtrapolDmuP : @local::TrkExtrapol -TrkExtrapolDmuP.fitparticle : @local::Particle.muplus -TrkExtrapolDmuP.fitdirection : @local::FitDir.downstream - -TrkExtrapolUmuP : @local::TrkExtrapol -TrkExtrapolUmuP.fitparticle : @local::Particle.muplus -TrkExtrapolUmuP.fitdirection : @local::FitDir.upstream - -TrkExtrapolDpP : @local::TrkExtrapol -TrkExtrapolDpP.fitparticle : 2212 -TrkExtrapolDpP.fitdirection : @local::FitDir.downstream - - -TrkExtrapolUpiP : @local::TrkExtrapol -TrkExtrapolUpiP.fitparticle : 211 -TrkExtrapolUpiP.fitdirection : @local::FitDir.upstream - -TrkExtrapolDpiP : @local::TrkExtrapol -TrkExtrapolDpiP.fitparticle : 211 -TrkExtrapolDpiP.fitdirection : @local::FitDir.downstream - - -TrkExtrapolDpiM : @local::TrkExtrapol -TrkExtrapolDpiM.fitparticle : -211 -TrkExtrapolDpiM.fitdirection : @local::FitDir.downstream - -TrkExtrapolUpiM : @local::TrkExtrapol -TrkExtrapolUpiM.fitparticle : -211 -TrkExtrapolUpiM.fitdirection : @local::FitDir.upstream - -END_PROLOG - - - -BEGIN_PROLOG - - -TrackCaloIntersectionDeM : -{ - module_type : TrackCaloIntersectionMVA - fitterModuleLabel : KFFDeM - downstream : true - checkExit : true - pathStep : 2 - tolerance : 1 - outputNtup : true - diagLevel : 0 -} - -TrackCaloIntersectionDmuM : -{ - module_type : TrackCaloIntersectionMVA - fitterModuleLabel : KFFDmuM - downstream : true - checkExit : true - pathStep : 2 - tolerance : 1 - outputNtup : true - diagLevel : 0 -} - - - - -TrkCaloMatcherExtDeM : -{ - module_type : TrackCaloMatchingExtend - caloClusterModuleLabel : CaloClusterMaker - trkIntersectModuleLabel : TrackCaloIntersectionDeM - trackExtend : 41.7 - dtOffset : -2.072 - sigmaT : 0.8 - sigmaXY : 8.4 - chi2Cut : 50 - diagLevel : 0 -} - -TrkCaloMatcherMVADeM : -{ - module_type : TrackCaloMatchingMVA - caloClusterModuleLabel : CaloClusterMaker - trkIntersectModuleLabel : TrackCaloIntersectionDeM - BDTWeightsX : "Offline/TrackCaloMatching/test/TMVARegression_BDTGXEl.weights.xml" - BDTWeightsY : "Offline/TrackCaloMatching/test/TMVARegression_BDTGYEl.weights.xml" - diagLevel : 0 - dtOffset : -2.072 - sigmaT : 0.8 - sigmaXY : 7.1 - chi2Cut : 50 -} - - - -TrkCaloMatcherExtDmuM : -{ - module_type : TrackCaloMatchingExtend - caloClusterModuleLabel : CaloClusterMaker - trkIntersectModuleLabel : TrackCaloIntersectionDmuM - trackExtend : 22.3 - dtOffset : -2.072 - sigmaT : 0.8 - sigmaXY : 8.2 - chi2Cut : 50 - diagLevel : 0 -} - -TrkCaloMatcherMVADmuM : -{ - module_type : TrackCaloMatchingMVA - caloClusterModuleLabel : CaloClusterMaker - trkIntersectModuleLabel : TrackCaloIntersectionDmuM - BDTWeightsX : "Offline/TrackCaloMatching/test/TMVARegression_BDTGXMu.weights.xml" - BDTWeightsY : "Offline/TrackCaloMatching/test/TMVARegression_BDTGYMu.weights.xml" - diagLevel : 0 - dtOffset : -2.072 - sigmaT : 0.8 - sigmaXY : 6.1 - chi2Cut : 50 -} - - -TrackCaloMatchingMVA : -{ - - producers : { - TrackCaloIntersectionDeM : @local::TrackCaloIntersectionDeM - TrackCaloIntersectionDmuM : @local::TrackCaloIntersectionDmuM - TrkCaloMatcherMVADeM : @local::TrkCaloMatcherMVADeM - TrkCaloMatcherMVADmuM : @local::TrkCaloMatcherMVADmuM - } - - TrkCaloMatchMVA : [TrackCaloIntersectionDeM, TrackCaloIntersectionDmuM, - TrkCaloMatcherMVADeM, TrkCaloMatcherMVADmuM ] -} - -TrackCaloMatchingExt : -{ - - producers : { - TrackCaloIntersectionDeM : @local::TrackCaloIntersectionDeM - TrackCaloIntersectionDmuM : @local::TrackCaloIntersectionDmuM - TrkCaloMatcherExtDeM : @local::TrkCaloMatcherExtDeM - TrkCaloMatcherExtDmuM : @local::TrkCaloMatcherExtDmuM - - } - - TrkCaloMatchExt : [TrackCaloIntersectionDeM, TrackCaloIntersectionDmuM, - TrkCaloMatcherExtDeM, TrkCaloMatcherExtDmuM ] -} - -END_PROLOG diff --git a/TrackCaloMatching/src/SConscript b/TrackCaloMatching/src/SConscript deleted file mode 100644 index c52aa9961b..0000000000 --- a/TrackCaloMatching/src/SConscript +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# -# Original author Rob Kutschke. -# - -Import('env') - -Import('mu2e_helper') - -helper=mu2e_helper(env) - -extrarootlibs = ['TMVA'] -rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] - -mainlib = helper.make_mainlib ( [ - 'mu2e_TrkReco', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', - 'mu2e_GeometryService', - 'mu2e_CalorimeterGeom', - 'mu2e_RecoDataProducts', - 'mu2e_DataProducts', - babarlibs, - rootlibs, - 'art_Framework_Services_Registry', - 'art_Persistency_Provenance', - 'art_Persistency_Common', - 'art_Utilities', - 'canvas', - 'CLHEP', - 'cetlib', - 'cetlib_except', - ] ) - -helper.make_plugins( [ - mainlib, - 'mu2e_ConditionsService', - 'mu2e_GeometryService', - 'mu2e_MCDataProducts', - 'mu2e_RecoDataProducts', - 'mu2e_DataProducts', - 'mu2e_CalorimeterGeom', - 'mu2e_TrackerGeom', - 'mu2e_ConfigTools', - babarlibs, - 'art_Framework_Core', - 'art_Framework_Principal', - 'art_Framework_Services_Registry', - 'art_root_io_tfile_support', - 'art_root_io_TFileService', - 'art_Framework_Services_Optional_RandomNumberGenerator', - 'art_Persistency_Common', - 'art_Persistency_Provenance', - 'art_Utilities', - 'canvas', - 'MF_MessageLogger', - 'fhiclcpp', - 'fhiclcpp_types', - 'tbb', - 'cetlib', - 'cetlib_except', - 'CLHEP', - rootlibs, - extrarootlibs, - 'boost_filesystem', - ] ) - - -# This tells emacs to view this file in python mode. -# Local Variables: -# mode:python -# End: diff --git a/TrackCaloMatching/src/TrackCaloIntersectionMVA_module.cc b/TrackCaloMatching/src/TrackCaloIntersectionMVA_module.cc deleted file mode 100644 index 43cb07a031..0000000000 --- a/TrackCaloMatching/src/TrackCaloIntersectionMVA_module.cc +++ /dev/null @@ -1,541 +0,0 @@ -// -// -// Original author B. Echenard -// -// A generic algorithm would either scan the track along every section in sequence or check every section along the path -// First option is optimal when sections are separated in z (e.g disks), second is ideal when sections are ovelapping in z (e.g. vanes) -// Since it is very likely we have disks, the first choice has been selected (implementing the second should be straightforward) - -// a few notes - -// Currently, we must extend the tracks to the calorimeter, but D. Brown said he would do that by default, so remove the corresponding -// lines when this is ready - -// There are a bunch of methods only available for HelixTraj, but not for TrajDifTraj. D. Brown will add them later -// and this code should be updated when they are available - -// There are some optimizations for the disk that can be set by defaults when we get rid of the vanes - - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - - -//CLHEP includes -#include "CLHEP/Vector/TwoVector.h" -#include "BTrk/BbrGeom/HepPoint.h" - - -// calorimeter, tracker and data -#include "BTrk/BaBar/Constants.hh" -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - - -// Other includes. -#include "cetlib_except/exception.h" -#include -#include -#include -#include -#include - - -//root includes -#include "TFile.h" -#include "TDirectory.h" -#include "TNtuple.h" - -#include "CLHEP/Vector/ThreeVector.h" - -namespace { - - struct TrkCaloInter - { - int fSection; - double fSEntr; - double fSEntrErr; - double fSExit; - }; -} - - - -namespace mu2e { - - - class TrackCaloIntersectionMVA : public art::EDProducer { - - - public: - - explicit TrackCaloIntersectionMVA(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _trkModuleLabel(pset.get("fitterModuleLabel")), - _downstream(pset.get("downstream")), - _diagLevel(pset.get("diagLevel",0)), - _pathStep(pset.get("pathStep")), - _tolerance(pset.get("tolerance")), - _checkExit(pset.get("checkExit")), - _outputNtup(pset.get("outputNtup")), - _trkdiag(0) - { - produces(); - } - - - virtual ~TrackCaloIntersectionMVA() {} - - void beginJob(); - void endJob() {} - void produce(art::Event & e ); - - - - - - private: - - void fillTrkNtup(int itrk, KalRepPtr const &kalrep, TrkDifTraj const& traj, std::vector const& intersec); - void doExtrapolation(TrkCaloIntersectCollection& extrapolatedTracks, KalRepPtrCollection const& trksPtrColl); - void findIntersectSection(Calorimeter const& cal, TrkDifTraj const& traj, - HelixTraj const& trkHel, unsigned int iSection, std::vector& intersect); - - double scanIn( Calorimeter const& cal, TrkDifTraj const& traj, HelixTraj const& trkHel, int iSection, double rangeStart, double rangeEnd); - double scanOut( Calorimeter const& cal, TrkDifTraj const& traj, HelixTraj const& trkHel, int iSection, double rangeStart, double rangeEnd); - double scanBinary( Calorimeter const& cal, TrkDifTraj const& traj, int iSection, double rangeIn, double rangeOut); - - double fastForwardDisk(Calorimeter const& cal, TrkDifTraj const& traj, HelixTraj const& trkHel, double rangeInit, CLHEP::Hep3Vector& trjVec); - double extendToRadius(HelixTraj const& trkHel, TrkDifTraj const& traj, double range, double cylinderRad); - void updateTrjVec(Calorimeter const& cal, TrkDifTraj const& traj, double range, CLHEP::Hep3Vector& trjVec); - double radiusAtRange(TrkDifTraj const& traj, double range); - - - std::string _trkModuleLabel; - bool _downstream; - int _diagLevel; - double _pathStep; - double _tolerance; - bool _checkExit; - bool _outputNtup; - - - - TTree* _trkdiag; - int _trkid,_trkint; - float _trksection[128],_trkpath[128],_trktof[128],_trkx[128],_trky[128],_trkz[128]; - float _trkmomx[128],_trkmomy[128],_trkmomz[128],_trkmom[128]; - - - - }; - - - - - - - void TrackCaloIntersectionMVA::beginJob() - { - - if (_outputNtup) - { - art::ServiceHandle tfs; - _trkdiag = tfs->make("trk", "trk extrapolated info"); - _trkdiag->Branch("trkid", &_trkid ,"trkid/I"); - _trkdiag->Branch("trkint", &_trkint ,"trkint/I"); - _trkdiag->Branch("trksection[trkint]", _trksection, "trksection[trkint]/F"); - _trkdiag->Branch("trkpath[trkint]", _trkpath, "trkpath[trkint]/F"); - _trkdiag->Branch("trktof[trkint]", _trktof, "trktof[trkint]/F"); - _trkdiag->Branch("trkx[trkint]", _trkx, "trkx[trkint]/F"); - _trkdiag->Branch("trky[trkint]", _trky, "trky[trkint]/F"); - _trkdiag->Branch("trkz[trkint]", _trkz, "trkz[trkint]/F"); - _trkdiag->Branch("trkmomx[trkint]", _trkmomx, "trkmomx[trkint]/F"); - _trkdiag->Branch("trkmomy[trkint]", _trkmomy, "trkmomy[trkint]/F"); - _trkdiag->Branch("trkmomz[trkint]", _trkmomz, "trkmomz[trkint]/F"); - _trkdiag->Branch("trkmom[trkint]", _trkmom, "trkmom[trkint]/F"); - } - } - - //----------------------------------------------------------------------------- - void TrackCaloIntersectionMVA::fillTrkNtup(int itrk, KalRepPtr const &kalrep, TrkDifTraj const& traj, std::vector const& intersec) - { - _trkid = itrk; - _trkint = intersec.size(); - - for(unsigned int i=0; iarrivalTime(length); - _trkx[i] = traj.position(length).x(); - _trky[i] = traj.position(length).y(); - _trkz[i] = traj.position(length).z(); - _trkmomx[i] = kalrep->momentum(length).x(); - _trkmomy[i] = kalrep->momentum(length).y(); - _trkmomz[i] = kalrep->momentum(length).z(); - _trkmom[i] = kalrep->momentum(length).mag(); - } - _trkdiag->Fill(); - } - - - - - - - //----------------------------------------------------------------------------- - void TrackCaloIntersectionMVA::produce(art::Event & evt ) - { - - //get tracks - art::Handle trksHandle; - evt.getByLabel(_trkModuleLabel, trksHandle); - KalRepPtrCollection const& trksPtrColl = *trksHandle.product(); - - //output of Extrapolated tracks - std::unique_ptr extrapolatedTracks(new TrkCaloIntersectCollection); - - if (_diagLevel) std::cout<<"Event Number : "<< evt.event()<<"\nStart TrackCaloIntersectionMVA with ntrk = "<()); - CLHEP::Hep3Vector endCalTracker = cal.geomUtil().mu2eToTracker( CLHEP::Hep3Vector(cal.geomUtil().origin().x(),cal.geomUtil().origin().y(),cal.caloInfo().getDouble("envelopeZ1")) ); - - - for (unsigned int itrk=0; itrk< trksPtrColl.size(); ++itrk ) - { - std::vector intersectVec; - - KalRepPtr krep = trksPtrColl.at(itrk); - HelixTraj trkHel(krep->helix(krep->endFoundRange()).params(),krep->helix(krep->endFoundRange()).covariance()); - - if (_diagLevel>2) - { - double angle = Constants::pi*0.5 + trkHel.phi0(); - double circleRadius = 1.0/trkHel.omega(); - double centerCircleX = (trkHel.d0() + circleRadius)*cos(angle); - double centerCircleY = (trkHel.d0() + circleRadius)*sin(angle); - printf("Helix traj circle: R = %10.3f X0 = %10.3f Y0 = %10.3f phi0 = %10.3f d0 = %10.3f\n",circleRadius,centerCircleX,centerCircleY,angle,trkHel.d0()); - } - - TrkDifTraj const& traj = krep->traj(); - - for(unsigned int iSec=0; iSec b.fSEntr;}); - - - - for (auto inter : intersectVec ) extrapolatedTracks.push_back( TrkCaloIntersect(inter.fSection, krep, itrk, inter.fSEntr,inter.fSEntrErr, inter.fSExit) ); - - if (_diagLevel) std::cout<<"Found "<& intersect) - { - - CLHEP::Hep3Vector frontFaceInTracker = cal.geomUtil().mu2eToTracker(cal.disk(iSection).geomInfo().frontFaceCenter()); - CLHEP::Hep3Vector backFaceInTracker = cal.geomUtil().mu2eToTracker(cal.disk(iSection).geomInfo().backFaceCenter()); - - double zStart = (_downstream) ? frontFaceInTracker.z() : backFaceInTracker.z(); - double zEnd = (_downstream) ? backFaceInTracker.z() : frontFaceInTracker.z() ; - double rangeStart = trkHel.zFlight(zStart); - double rangeEnd = trkHel.zFlight(zEnd); - - - //apply first order correction to the helix model to match the trajDif model, add buffer to endRange to be on the safe side - //D. Brown will add a zFlight() method for TrajDifTraj in the future, rewrite code when available - double sinDip = sqrt(1.0-trkHel.cosDip()*trkHel.cosDip()); - double rangeStartCorr = (zStart-traj.position(rangeStart).z())/sinDip; - double rangeEndCorr = (zEnd-traj.position(rangeEnd).z())/sinDip +2; - - if (_downstream) {rangeStart += rangeStartCorr;rangeEnd += rangeEndCorr;} - else {rangeStart -= rangeStartCorr;rangeEnd -= rangeEndCorr;} - - - if (_diagLevel>1) std::cout<<"TrackCaloIntersectionMVA inter rangeStart = "< rangeEnd) - { - if (_diagLevel>1) std::cout<<"TrackCaloIntersectionMVA end search behind Section "< cal.disk(iSection).geomInfo().outerEnvelopeR()) rangeStart += extendToRadius(trkHel, traj, rangeStart, cal.disk(iSection).geomInfo().outerEnvelopeR()); - - if (rangeStart > rangeEnd) return rangeEnd+1e-4; - - - //now find two starting points, one inside the boundary, the other outside - CLHEP::Hep3Vector trjVec; - updateTrjVec(cal,traj,rangeStart,trjVec); - - double rangeIn(rangeStart),rangeOut(rangeStart); - if ( cal.geomUtil().isInsideSection(iSection,trjVec)) - { - while (cal.geomUtil().isInsideSection(iSection,trjVec)) - { - rangeIn = rangeOut; - rangeOut -= _pathStep; - updateTrjVec(cal,traj,rangeOut,trjVec); - if (_diagLevel>2) std::cout<<"TrackExtrpol position scan In down "< -#include -#include -#include -#include - - -//root includes -#include "TFile.h" -#include "TDirectory.h" -#include "TNtuple.h" - -#include "CLHEP/Vector/ThreeVector.h" - -namespace { - - struct TrkCaloInter - { - int fSection; - double fSEntr; - double fSEntrErr; - double fSExit; - }; -} - - - -namespace mu2e { - - - class TrackCaloIntersection : public art::EDProducer { - public: - - explicit TrackCaloIntersection(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _trkterToken{consumes(pset.get("fitterModuleLabel"))}, - _downstream(pset.get("downstream")), - _diagLevel(pset.get("diagLevel")), - _pathStep(pset.get("pathStep")), - _tolerance(pset.get("tolerance")), - _checkExit(pset.get("checkExit")), - _outputNtup(pset.get("outputNtup")), - _trkdiag(0) - { - produces(); - } - - void beginJob() override; - void produce(art::Event& e) override; - - private: - - void fillTrkNtup(int itrk, KalRepPtr const &kalrep, TrkDifTraj const& traj, std::vector const& intersec); - void doExtrapolation(TrkCaloIntersectCollection& extrapolatedTracks, KalRepPtrCollection const& trksPtrColl); - void findIntersectSection(Calorimeter const& cal, TrkDifTraj const& traj, - HelixTraj const& trkHel, unsigned int iSection, std::vector& intersect); - - double scanIn( Calorimeter const& cal, TrkDifTraj const& traj, HelixTraj const& trkHel, int iSection, double rangeStart, double rangeEnd); - double scanOut( Calorimeter const& cal, TrkDifTraj const& traj, HelixTraj const& trkHel, int iSection, double rangeStart, double rangeEnd); - double scanBinary( Calorimeter const& cal, TrkDifTraj const& traj, int iSection, double rangeIn, double rangeOut); - - double fastForwardDisk(Calorimeter const& cal, TrkDifTraj const& traj, HelixTraj const& trkHel, double rangeInit, CLHEP::Hep3Vector& trjVec); - double extendToRadius(HelixTraj const& trkHel, TrkDifTraj const& traj, double range, double cylinderRad); - void updateTrjVec(Calorimeter const& cal, TrkDifTraj const& traj, double range, CLHEP::Hep3Vector& trjVec); - double radiusAtRange(TrkDifTraj const& traj, double range); - - art::ProductToken const _trkterToken; - bool _downstream; - int _diagLevel; - double _pathStep; - double _tolerance; - bool _checkExit; - bool _outputNtup; - - TTree* _trkdiag; - int _trkid,_trkint; - float _trksection[128],_trkpath[128],_trktof[128],_trkx[128],_trky[128],_trkz[128]; - float _trkmomx[128],_trkmomy[128],_trkmomz[128],_trkmom[128]; - }; - - - void TrackCaloIntersection::beginJob() - { - if (_outputNtup) - { - art::ServiceHandle tfs; - _trkdiag = tfs->make("trk", "trk extrapolated info"); - _trkdiag->Branch("trkid", &_trkid ,"trkid/I"); - _trkdiag->Branch("trkint", &_trkint ,"trkint/I"); - _trkdiag->Branch("trksection[trkint]", _trksection, "trksection[trkint]/F"); - _trkdiag->Branch("trkpath[trkint]", _trkpath, "trkpath[trkint]/F"); - _trkdiag->Branch("trktof[trkint]", _trktof, "trktof[trkint]/F"); - _trkdiag->Branch("trkx[trkint]", _trkx, "trkx[trkint]/F"); - _trkdiag->Branch("trky[trkint]", _trky, "trky[trkint]/F"); - _trkdiag->Branch("trkz[trkint]", _trkz, "trkz[trkint]/F"); - _trkdiag->Branch("trkmomx[trkint]", _trkmomx, "trkmomx[trkint]/F"); - _trkdiag->Branch("trkmomy[trkint]", _trkmomy, "trkmomy[trkint]/F"); - _trkdiag->Branch("trkmomz[trkint]", _trkmomz, "trkmomz[trkint]/F"); - _trkdiag->Branch("trkmom[trkint]", _trkmom, "trkmom[trkint]/F"); - } - } - - //----------------------------------------------------------------------------- - void TrackCaloIntersection::fillTrkNtup(int itrk, KalRepPtr const &kalrep, TrkDifTraj const& traj, std::vector const& intersec) - { - _trkid = itrk; - _trkint = intersec.size(); - - for(unsigned int i=0; iarrivalTime(length); - _trkx[i] = traj.position(length).x(); - _trky[i] = traj.position(length).y(); - _trkz[i] = traj.position(length).z(); - _trkmomx[i] = kalrep->momentum(length).x(); - _trkmomy[i] = kalrep->momentum(length).y(); - _trkmomz[i] = kalrep->momentum(length).z(); - _trkmom[i] = kalrep->momentum(length).mag(); - } - _trkdiag->Fill(); - } - - - //----------------------------------------------------------------------------- - void TrackCaloIntersection::produce(art::Event& evt) - { - //get tracks - auto const& trksPtrColl = *evt.getValidHandle(_trkterToken); - - //output of Extrapolated tracks - auto extrapolatedTracks = std::make_unique(); - - if (_diagLevel) std::cout<<"Event Number : "<< evt.event()<<"\nStart TrackCaloIntersection with ntrk = "<()); - CLHEP::Hep3Vector endCalTracker = cal.geomUtil().mu2eToTracker( CLHEP::Hep3Vector(cal.geomUtil().origin().x(),cal.geomUtil().origin().y(),cal.caloInfo().getDouble("envelopeZ1")) ); - - - for (unsigned int itrk=0; itrk< trksPtrColl.size(); ++itrk ) - { - std::vector intersectVec; - - KalRepPtr krep = trksPtrColl.at(itrk); - HelixTraj trkHel(krep->helix(krep->endFoundRange()).params(),krep->helix(krep->endFoundRange()).covariance()); - - if (_diagLevel>2) - { - double angle = Constants::pi*0.5 + trkHel.phi0(); - double circleRadius = 1.0/trkHel.omega(); - double centerCircleX = (trkHel.d0() + circleRadius)*cos(angle); - double centerCircleY = (trkHel.d0() + circleRadius)*sin(angle); - printf("Helix traj circle: R = %10.3f X0 = %10.3f Y0 = %10.3f phi0 = %10.3f d0 = %10.3f\n",circleRadius,centerCircleX,centerCircleY,angle,trkHel.d0()); - } - - TrkDifTraj const& traj = krep->traj(); - - for(unsigned int iSec=0; iSec b.fSEntr;}); - - - - for (auto inter : intersectVec ) extrapolatedTracks.push_back( TrkCaloIntersect(inter.fSection, krep, itrk, inter.fSEntr,inter.fSEntrErr, inter.fSExit) ); - - if (_diagLevel) std::cout<<"Found "<& intersect) - { - - CLHEP::Hep3Vector frontFaceInTracker = cal.geomUtil().mu2eToTracker(cal.disk(iSection).geomInfo().frontFaceCenter()); - CLHEP::Hep3Vector backFaceInTracker = cal.geomUtil().mu2eToTracker(cal.disk(iSection).geomInfo().backFaceCenter()); - - double zStart = (_downstream) ? frontFaceInTracker.z() : backFaceInTracker.z(); - double zEnd = (_downstream) ? backFaceInTracker.z() : frontFaceInTracker.z() ; - double rangeStart = trkHel.zFlight(zStart); - double rangeEnd = trkHel.zFlight(zEnd); - - //apply first order correction to the helix model to match the trajDif model, add buffer to endRange to be on the safe side - //D. Brown will add a zFlight() method for TrajDifTraj in the future, rewrite code when available - double sinDip = sqrt(1.0-trkHel.cosDip()*trkHel.cosDip()); - double rangeStartCorr = (zStart-traj.position(rangeStart).z())/sinDip; - double rangeEndCorr = (zEnd-traj.position(rangeEnd).z())/sinDip +2; - - if (_downstream) {rangeStart += rangeStartCorr;rangeEnd += rangeEndCorr;} - else {rangeStart -= rangeStartCorr;rangeEnd -= rangeEndCorr;} - - - if (_diagLevel>1) std::cout<<"TrackCaloIntersection inter rangeStart = "< rangeEnd) - { - if (_diagLevel>1) std::cout<<"TrackCaloIntersection end search behind Section "< cal.disk(iSection).geomInfo().outerEnvelopeR()) rangeStart += extendToRadius(trkHel, traj, rangeStart, cal.disk(iSection).geomInfo().outerEnvelopeR()); - - if (rangeStart > rangeEnd) return rangeEnd+1e-4; - - - //now find two starting points, one inside the boundary, the other outside - CLHEP::Hep3Vector trjVec; - updateTrjVec(cal,traj,rangeStart,trjVec); - - double rangeIn(rangeStart),rangeOut(rangeStart); - if ( cal.geomUtil().isInsideSection(iSection,trjVec)) - { - while (cal.geomUtil().isInsideSection(iSection,trjVec)) - { - rangeIn = rangeOut; - rangeOut -= _pathStep; - updateTrjVec(cal,traj,rangeOut,trjVec); - if (_diagLevel>2) std::cout<<"TrackExtrpol position scan In down "< -#include -#include -#include -#include -#include -#include - -#include "TH1D.h" -#include "TMVA/Reader.h" - - - - - -namespace mu2e { - - class TrackCaloMatchingExtend : public art::EDProducer { - - public: - - explicit TrackCaloMatchingExtend(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - caloClusterModuleLabel_ (pset.get("caloClusterModuleLabel")), - trkIntersectModuleLabel_ (pset.get("trkIntersectModuleLabel")), - trackExtend_ (pset.get("trackExtend")), - dtOffset_ (pset.get("dtOffset")), - sigmaT_ (pset.get("sigmaT")), - sigmaXY_ (pset.get("sigmaXY")), - chi2Cut_ (pset.get("chi2Cut")), - diagLevel_ (pset.get ("diagLevel",0)) - { - produces(); - } - - virtual ~TrackCaloMatchingExtend() {} - - void beginJob(); - void endJob () {} - void produce (art::Event& e); - - - - private: - - void matchMe(TrkCaloMatchCollection& trackClusterMatch, art::Handle trjIntersectHandle, - art::Handle caloClustersHandle); - - double calcChi2Pos(const Calorimeter& cal, const CaloCluster& cluster, - const CLHEP::Hep3Vector& trkPos, double trkTime, double cellsize); - - CLHEP::Hep3Vector recalculateCog(const Calorimeter& cal, const CaloCluster& cluster); - - - std::string caloClusterModuleLabel_; - std::string trkIntersectModuleLabel_; - double trackExtend_; - double dtOffset_; - double sigmaT_; - double sigmaXY_; - double chi2Cut_; - - int diagLevel_; - - TH1F *_hXY,*_hT,*_hChi2,*_hChi2Time,*_hChi2Pos; - - - }; - - - void TrackCaloMatchingExtend::beginJob() - { - - art::ServiceHandle tfs; - _hXY = tfs->make("XY_diff","Clu - TRK X-Y dist",100,-100,100.); - _hT = tfs->make("T_diff","Clu - TRK Time dist",100,-10,10.); - _hChi2 = tfs->make("Chi2", "Chi2",200,0,400.); - _hChi2Time = tfs->make("Chi2Pos", "Chi2",200,0,400.); - _hChi2Pos = tfs->make("Chi2Time","Chi2",200,0,400.); - - } - - - - //----------------------------------------------------------------------------- - void TrackCaloMatchingExtend::produce(art::Event& event) - { - - art::Handle caloClustersHandle; - event.getByLabel(caloClusterModuleLabel_, caloClustersHandle); - const CaloClusterCollection& caloClusters(*caloClustersHandle); - - art::Handle trjIntersectHandle; - event.getByLabel(trkIntersectModuleLabel_, trjIntersectHandle); - const TrkCaloIntersectCollection& trkIntersects(*trjIntersectHandle); - - //output of TrackCaloMatchingExtend - std::unique_ptr trackClusterMatch(new TrkCaloMatchCollection); - - - if (diagLevel_) std::cout<<"Event Number: "<< event.event()<<"\nStart TrkCaloMatching with nExtrapol = " - < 1) - for (const auto& cluster: caloClusters) std::cout<<"In TrackClusterMatching, cluster energy=" - < -#include -#include -#include -#include -#include -#include - -#include "TH1D.h" -#include "TMVA/Reader.h" - - - - -namespace { - - struct BDTinput - { - float e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18,e19,e20; - float t0,t1,r0,z0; - }; -} - - - -namespace mu2e { - - class TrackCaloMatchingMVA : public art::EDProducer { - - public: - - explicit TrackCaloMatchingMVA(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - caloClusterModuleLabel_ (pset.get("caloClusterModuleLabel")), - trkIntersectModuleLabel_ (pset.get("trkIntersectModuleLabel")), - BDTWeightsX_ (pset.get("BDTWeightsX")), - BDTWeightsY_ (pset.get("BDTWeightsY")), - dtOffset_ (pset.get("dtOffset")), - sigmaT_ (pset.get("sigmaT")), - sigmaXY_ (pset.get("sigmaXY")), - chi2Cut_ (pset.get("chi2Cut")), - diagLevel_ (pset.get ("diagLevel",0)), - readerX_("!Color:!Silent"), - readerY_("!Color:!Silent"), - input_() - { - produces(); - } - - virtual ~TrackCaloMatchingMVA() {} - - void beginJob(); - void endJob () {} - void produce (art::Event& e); - - - - private: - - void setReader(TMVA::Reader& reader, std::string filename); - - void matchMe(TrkCaloMatchCollection& trackClusterMatch, art::Handle trjIntersectHandle, - art::Handle caloClustersHandle); - - double calcChi2Pos(const Calorimeter& cal, const CaloCluster& cluster, const CLHEP::Hep3Vector& trkMomentum, - const CLHEP::Hep3Vector& posTrkMatch, double trkTime, double cellsize); - - - std::string caloClusterModuleLabel_; - std::string trkIntersectModuleLabel_; - std::string BDTWeightsX_; - std::string BDTWeightsY_; - double dtOffset_; - double sigmaT_; - double sigmaXY_; - double chi2Cut_; - - int diagLevel_; - - TMVA::Reader readerX_; - TMVA::Reader readerY_; - BDTinput input_; - - TH1F *_hXY,*_hT,*_hChi2,*_hChi2Time,*_hChi2Pos; - - - }; - - - //------------------------------------ - void TrackCaloMatchingMVA::beginJob() - { - - art::ServiceHandle tfs; - _hXY = tfs->make("XY_diff","Clu - TRK X-Y dist",100,-100,100.); - _hT = tfs->make("T_diff","Clu - TRK Time dist",100,-10,10.); - _hChi2 = tfs->make("Chi2", "Chi2",200,0,400.); - _hChi2Time = tfs->make("Chi2Pos", "Chi2",200,0,400.); - _hChi2Pos = tfs->make("Chi2Time","Chi2",200,0,400.); - - setReader(readerX_,BDTWeightsX_); - setReader(readerY_,BDTWeightsY_); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatchingMVA::produce(art::Event& event) - { - - art::Handle caloClustersHandle; - event.getByLabel(caloClusterModuleLabel_, caloClustersHandle); - const CaloClusterCollection& caloClusters(*caloClustersHandle); - - art::Handle trjIntersectHandle; - event.getByLabel(trkIntersectModuleLabel_, trjIntersectHandle); - const TrkCaloIntersectCollection& trkIntersects(*trjIntersectHandle); - - //output of TrackCaloMatchingMVA - std::unique_ptr trackClusterMatch(new TrkCaloMatchCollection); - - - if (diagLevel_) std::cout<<"Event Number: "<< event.event()<<"\nStart TrkCaloMatching with nExtrapol = " - < 1) - for (const auto& cluster: caloClusters) std::cout<<"In TrackClusterMatching, cluster energy=" - <3) - { - std::cout<<"[TrackCaloMatchingMVA::calcChi2Pos] center"< 2) _hXY->Fill(valX-posTrkMatch.x()); - if (diagLevel_ > 2) _hXY->Fill(valY-posTrkMatch.y()); - - return chi2; - - } - - - - //--------------------------------------------------------------------------- - void TrackCaloMatchingMVA::setReader(TMVA::Reader& reader, std::string filename) - { - reader.AddVariable( "e0", &input_.e0); - reader.AddVariable( "e1", &input_.e1); - reader.AddVariable( "e2", &input_.e2); - reader.AddVariable( "e3", &input_.e3); - reader.AddVariable( "e4", &input_.e4); - reader.AddVariable( "e5", &input_.e5); - reader.AddVariable( "e6", &input_.e6); - reader.AddVariable( "e7", &input_.e7); - reader.AddVariable( "e8", &input_.e8); - reader.AddVariable( "e9", &input_.e9); - reader.AddVariable( "e10", &input_.e10); - reader.AddVariable( "e11", &input_.e11); - reader.AddVariable( "e12", &input_.e12); - reader.AddVariable( "e13", &input_.e13); - reader.AddVariable( "e14", &input_.e14); - reader.AddVariable( "e15", &input_.e15); - reader.AddVariable( "e16", &input_.e16); - reader.AddVariable( "e17", &input_.e17); - reader.AddVariable( "e18", &input_.e18); - reader.AddVariable( "e19", &input_.e19); - reader.AddVariable( "t0", &input_.t0); - reader.AddVariable( "t1", &input_.t1); - reader.AddVariable( "r0", &input_.r0); - reader.AddVariable( "z0", &input_.z0); - reader.BookMVA("BDTG method", filename ); - } - - - - /* - - std::vector matrixX,matrixY,matrixE; - for (const auto& hit : cluster.caloHitsPtrVector() ) - { - CLHEP::Hep3Vector crystalPos = cal.geomUtil().mu2eToDiskFF(cal.crystal(hit->crystalID()).diskID(), cal.crystal(hit->crystalID()).position()); - - matrixX.push_back( (crystalPos.x()-center.x())/cellsize ); - matrixY.push_back( (crystalPos.y()-center.y())/cellsize ); - matrixE.push_back( hit->energyDep()/105.0 ); - } - - if (matrixX.size()<9) for (unsigned int i=0;i<9-matrixX.size();++i){matrixX.push_back(0);matrixY.push_back(0);matrixE.push_back(0);} - - input_.e2 = matrixE[0];input_.e5 = matrixE[1];input_.e8 = matrixE[2];input_.e11 = matrixE[3]; - input_.e14 = matrixE[4];input_.e17 = matrixE[5];input_.e20 = matrixE[6];input_.e23 = matrixE[7]; - input_.e3 = matrixX[1];input_.e6 = matrixX[2];input_.e9 = matrixX[3];input_.e12 = matrixX[4]; - input_.e15 = matrixX[5];input_.e18 = matrixX[6];input_.e21 = matrixX[7]; - input_.e4 = matrixY[1];input_.e7 = matrixY[2];input_.e10 = matrixY[3];input_.e13 = matrixY[4]; - input_.e16 = matrixY[5];input_.e19 = matrixY[6];input_.e2 = matrixY[7]; - input_.t0 = trkMomentum.phi(); - input_.t1 = trkMomentum.theta(); - input_.r0 = sqrt(center.x()*center.x()+center.y()*center.y())/1000; - - */ - - -} - - - - - -using mu2e::TrackCaloMatchingMVA; -DEFINE_ART_MODULE(TrackCaloMatchingMVA) diff --git a/TrackCaloMatching/test/AnalysisBaseMatch.C b/TrackCaloMatching/test/AnalysisBaseMatch.C deleted file mode 100644 index 070839d695..0000000000 --- a/TrackCaloMatching/test/AnalysisBaseMatch.C +++ /dev/null @@ -1,724 +0,0 @@ -// Analysis match dumps the data to train the regression to predict the cluster position -// There are three modes available (uncomment the one you want below) -// - the position of the 6 most energetic crystals (w.r.t. most energetic one) in XY coordinates -// - the position of the 6 most energetic crystals (w.r.t. most energetic one) in UV coordinates -// - the energy of the neighboring crystals (2 layers), using -1 to indicate if there is no crystal -// -// Note: the XY and UV distributions are also attainable by performing the coordinate transform in the TMVAReadRegress.C matrix -// - -#define AnalysisBaseMatch_cxx -#include "AnalysisBaseMatch.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Src/Disk.hh" - -#include -#include -#include -#include -#include -#include - - -int Nplot=0; - -TH1F *_sener,*_distOut,*_dpos,*_phi,*_theta,*_output,*_cryDist,*_dClu,*_dphi,*_dtheta,*_dtrk,*_hx,*_hy,*_ha,*_div; -TH2F *_targ,*_duv,*_view[10]; - - -TTree* dTuple; -TBranch *b_e0,*b_e1,*b_e2,*b_e3,*b_e4,*b_e5,*b_e6,*b_e7,*b_e8,*b_e9; -TBranch *b_e10,*b_e11,*b_e12,*b_e13,*b_e14,*b_e15,*b_e16,*b_e17,*b_e18,*b_e19; -TBranch *b_e20,*b_e21,*b_e22,*b_e23,*b_e24; -TBranch *b_t0,*b_t1,*b_r0,*b_z0,*b_ip0,*b_ip1,*b_c0,*b_c1,*b_c2,*b_c3,*b_c4,*b_c5,*b_ffx,*b_ffy,*b_ffz,*b_vdx,*b_vdy,*b_vdz; -TBranch *b_targetX,*b_targetY,*b_targetA; - -Float_t e0_,e1_,e2_,e3_,e4_,e5_,e6_,e7_,e8_,e9_; -Float_t e10_,e11_,e12_,e13_,e14_,e15_,e16_,e17_,e18_,e19_; -Float_t e20_,e21_,e22_,e23_,e24_; -Float_t t0_,t1_,r0_,z0_,ip0_,ip1_,c0_,c1_,c2_,c3_,c4_,c5_,ffx_,ffy_,ffz_,vdx_,vdy_,vdz_; -Float_t targetX_,targetY_,targetA_; - - - - -double _cellSize = 34.3; -bool is_train = false; -int mode = 3; - - - - - -void AnalysisBaseMatch::Begin(TTree * /*tree*/) -{ - - TString option = GetOption(); - if (option.Sizeof()>=2) histname=option; - fHistFile = new TFile(histname,"RECREATE"); - cout<Branch("e0", &e0_, "e0/F"); - b_e1 = dTuple->Branch("e1", &e1_, "e1/F"); - b_e2 = dTuple->Branch("e2", &e2_, "e2/F"); - b_e3 = dTuple->Branch("e3", &e3_, "e3/F"); - b_e4 = dTuple->Branch("e4", &e4_, "e4/F"); - b_e5 = dTuple->Branch("e5", &e5_, "e5/F"); - b_e6 = dTuple->Branch("e6", &e6_, "e6/F"); - b_e7 = dTuple->Branch("e7", &e7_, "e7/F"); - b_e8 = dTuple->Branch("e8", &e8_, "e8/F"); - b_e9 = dTuple->Branch("e9", &e9_, "e9/F"); - - b_e10 = dTuple->Branch("e10", &e10_, "e10/F"); - b_e11 = dTuple->Branch("e11", &e11_, "e11/F"); - b_e12 = dTuple->Branch("e12", &e12_, "e12/F"); - b_e13 = dTuple->Branch("e13", &e13_, "e13/F"); - b_e14 = dTuple->Branch("e14", &e14_, "e14/F"); - b_e15 = dTuple->Branch("e15", &e15_, "e15/F"); - b_e16 = dTuple->Branch("e16", &e16_, "e16/F"); - b_e17 = dTuple->Branch("e17", &e17_, "e17/F"); - b_e18 = dTuple->Branch("e18", &e18_, "e18/F"); - b_e19 = dTuple->Branch("e19", &e19_, "e19/F"); - - b_e20 = dTuple->Branch("e20", &e20_, "e20/F"); - b_e21 = dTuple->Branch("e21", &e21_, "e21/F"); - b_e22 = dTuple->Branch("e22", &e22_, "e22/F"); - b_e23 = dTuple->Branch("e23", &e23_, "e23/F"); - b_e24 = dTuple->Branch("e24", &e24_, "e24/F"); - - - b_t0 = dTuple->Branch("t0", &t0_, "t0/F"); - b_t1 = dTuple->Branch("t1", &t1_, "t1/F"); - - b_r0 = dTuple->Branch("r0", &r0_, "r0/F"); - b_z0 = dTuple->Branch("z0", &z0_, "z0/F"); - b_ip0 = dTuple->Branch("ip0", &ip0_, "ip0/F"); - b_ip1 = dTuple->Branch("ip1", &ip1_, "ip1/F"); - - b_c0 = dTuple->Branch("c0", &c0_, "c0/F"); - b_c1 = dTuple->Branch("c1", &c1_, "c1/F"); - b_c2 = dTuple->Branch("c2", &c2_, "c2/F"); - b_c3 = dTuple->Branch("c3", &c3_, "c3/F"); - b_c4 = dTuple->Branch("c4", &c4_, "c4/F"); - b_c5 = dTuple->Branch("c5", &c5_, "c5/F"); - - b_ffx = dTuple->Branch("ffx", &ffx_, "ffx/F"); - b_ffy = dTuple->Branch("ffy", &ffy_, "ffy/F"); - b_ffz = dTuple->Branch("ffz", &ffz_, "ffz/F"); - b_vdx = dTuple->Branch("vdx", &vdx_, "vdx/F"); - b_vdy = dTuple->Branch("vdy", &vdy_, "vdy/F"); - b_vdz = dTuple->Branch("vdz", &vdz_, "vdz/F"); - - b_targetX = dTuple->Branch("targetX", &targetX_, "targetX/F"); - b_targetY = dTuple->Branch("targetY", &targetY_, "targetY/F"); - b_targetA = dTuple->Branch("targetA", &targetA_, "targetA/F"); - - is_train=false; - if (histname.Contains("Train")) is_train = true; - - Nplot = 0; - -} - - - - - - - - -Bool_t AnalysisBaseMatch::Process(Long64_t entry) -{ - - fChain->GetTree()->GetEntry(entry); - - double vdPhi(0),vdTheta(0),vdmom(-1); - - int VDTrk = vdFinder(); - if (VDTrk > -1) - { - vdmom = sqrt(vdMomX[VDTrk]*vdMomX[VDTrk]+vdMomY[VDTrk]*vdMomY[VDTrk]+vdMomZ[VDTrk]*vdMomZ[VDTrk]); - vdPhi = (atan2(vdMomY[VDTrk],vdMomX[VDTrk])); - vdTheta = acos(vdMomZ[VDTrk]/vdmom); - _phi->Fill(vdPhi); - _theta->Fill(vdTheta); - } - - - //find a track that is matched to a conversion cluster - int itrkMatch(-1); - for (int im=0;im -1) _dphi->Fill(vdPhi-trkPhi); - if (VDTrk > -1) _dtheta->Fill(vdTheta-trkTheta); - - - - - - for (int ic=0;ic200) continue; - - - std::vector crystalL = (*cluList)[ic]; - int seedId = cryId[crystalL[0]]; - double centerX = cryPosX[crystalL[0]]; - double centerY = cryPosY[crystalL[0]]; - if (seedId >= disk->nCrystal()) seedId -= disk->nCrystal(); - - - int ivm(-1); - for (int iv=0;iv 80 && (vdPdgId[iv]==11 ||vdPdgId[iv]==13) ) ivm=iv; - - int ism(-1); - for (int is=cluSimIdx[ic];is90) ism = is; - - - //if (sqrt(centerX*centerX+centerY*centerY)>450) continue; - //if (trkFFZ[itrkMatch]>1) continue; - //std::cout<Fill(etot25b/cluEnergy[ic]); - - - TVector3 cogNew = calcCog(ic); - - - double targetX =(trkFFX[itrkMatch]-centerX)/_cellSize; - double targetY =(trkFFY[itrkMatch]-centerY)/_cellSize; - - TVector2 dxy(targetX,targetY); - TVector2 du(cos(trkPhi),sin(trkPhi)); - TVector2 dv(-sin(trkPhi),cos(trkPhi)); - TVector2 deltaUV0(dxy*du,dxy*dv); - - - _targ->Fill(targetX,targetY); - _duv->Fill(deltaUV0.X(),deltaUV0.Y()); - _dtrk->Fill(trkFFX[itrkMatch]-clusimPosX[ic]); - _dtrk->Fill(trkFFY[itrkMatch]-clusimPosY[ic]); - - int miv(-1); - for (int iv=0;iv 90 && (vdPdgId[iv]==11 || vdPdgId[iv]==13 )) miv=iv; - if (ivm==-1) return kTRUE; - if (miv > -1) - { - double divx = vdPosX[miv]-trkFFX[itrkMatch]; - double divy = vdPosY[miv]-trkFFY[itrkMatch]; - double div = sqrt(divx*divx+divy*divy); - - - _div->Fill(div); - if (div > 50) return kTRUE; - } - - - - //this fills the position of the 7 most energetic crystals (w.r.t. most energetic one) in XY coordinates - if (mode==1) - { - e0_ = matrixX[0]; - e1_ = matrixY[0]; - e2_ = matrixE[0]; - e3_ = matrixX[1]; - e4_ = matrixY[1]; - e5_ = matrixE[1]; - e6_ = matrixX[2]; - e7_ = matrixY[2]; - e8_ = matrixE[2]; - e9_ = matrixX[3]; - e10_ = matrixY[3]; - e11_ = matrixE[3]; - e12_ = matrixX[4]; - e13_ = matrixY[4]; - e14_ = matrixE[4]; - e15_ = matrixX[5]; - e16_ = matrixY[5]; - e17_ = matrixE[5]; - e18_ = matrixX[6]; - e19_ = matrixY[6]; - e20_ = matrixE[6]; - - targetX_ = targetX; - targetY_ = targetY; - targetA_ = targetExtend(ic,itrkMatch); - - t0_ = trkPhi; - t1_ = trkTheta; - r0_ = sqrt(centerX*centerX+centerY*centerY)/1000; - z0_ = trkFFZ[itrkMatch]/200; - ip0_ = trkCposX[itrkMatch]/10; - ip1_ = trkCposY[itrkMatch]/10; - - c0_ = cluCogX[ic]; - c1_ = cluCogY[ic]; - c2_ = cogNew.X(); - c3_ = cogNew.Y(); - c4_ = clusimPosX[ic]; - c5_ = clusimPosY[ic]; - ffx_ = trkFFX[itrkMatch]; - ffy_ = trkFFY[itrkMatch]; - ffz_ = trkFFZ[itrkMatch]; - vdx_ = (ivm>-1) ? vdPosX[ivm] : -999; - vdy_ = (ivm>-1) ? vdPosY[ivm] : -999; - vdz_ = (ivm>-1) ? vdPosZ[ivm] : -999; - - } - - - //this fills the position of the 7 most energetic crystals (w.r.t. most energetic one) in UV coordinates - if (mode==2) - { - e0_ = matrixX[0]; - e1_ = matrixY[0]; - e2_ = matrixE[0]; - e3_ = cos(trkPhi)*matrixX[1]+sin(trkPhi)*matrixY[1]; - e4_ = -sin(trkPhi)*matrixX[1]+cos(trkPhi)*matrixY[1]; - e5_ = matrixE[1]; - e6_ = cos(trkPhi)*matrixX[2]+sin(trkPhi)*matrixY[2]; - e7_ = -sin(trkPhi)*matrixX[2]+cos(trkPhi)*matrixY[2]; - e8_ = matrixE[2]; - e9_ = cos(trkPhi)*matrixX[3]+sin(trkPhi)*matrixY[3]; - e10_ = -sin(trkPhi)*matrixX[3]+cos(trkPhi)*matrixY[3]; - e11_ = matrixE[3]; - e12_ = cos(trkPhi)*matrixX[4]+sin(trkPhi)*matrixY[4]; - e13_ = -sin(trkPhi)*matrixX[4]+cos(trkPhi)*matrixY[4]; - e14_ = matrixE[4]; - e15_ = cos(trkPhi)*matrixX[5]+sin(trkPhi)*matrixY[5]; - e16_ = -sin(trkPhi)*matrixX[5]+cos(trkPhi)*matrixY[5]; - e17_ = matrixE[5]; - e18_ = cos(trkPhi)*matrixX[6]+sin(trkPhi)*matrixY[6]; - e19_ = -sin(trkPhi)*matrixX[6]+cos(trkPhi)*matrixY[6]; - e20_ = matrixE[6]; - - targetX_ = deltaUV0.X(); - targetY_ = deltaUV0.Y(); - targetA_ = targetExtend(ic,itrkMatch); - - t0_ = trkPhi; - t1_ = trkTheta; - r0_ = sqrt(centerX*centerX+centerY*centerY)/1000; - z0_ = trkFFZ[itrkMatch]/200; - ip0_ = trkCposX[itrkMatch]/10; - ip1_ = trkCposY[itrkMatch]/10; - - c0_ = cos(trkPhi)*cluCogX[ic] + sin(trkPhi)*cluCogY[ic]; - c1_ = -sin(trkPhi)*cluCogX[ic] + cos(trkPhi)*cluCogY[ic]; - c2_ = cos(trkPhi)*cogNew.X() + sin(trkPhi)*cogNew.Y(); - c3_ = -sin(trkPhi)*cogNew.X() + cos(trkPhi)*cogNew.Y(); - c4_ = cos(trkPhi)*clusimPosX[ic] + sin(trkPhi)*clusimPosY[ic]; - c5_ = -sin(trkPhi)*clusimPosX[ic] + cos(trkPhi)*clusimPosY[ic]; - - ffx_ = trkFFX[itrkMatch]; - ffy_ = trkFFY[itrkMatch]; - ffz_ = trkFFZ[itrkMatch]; - vdx_ = (ivm>-1) ? vdPosX[ivm] : -999; - vdy_ = (ivm>-1) ? vdPosY[ivm] : -999; - vdz_ = (ivm>-1) ? vdPosZ[ivm] : -999; - } - - - //here we take the two rings around the most energetic - if (mode==3) - { - int offset(0); - if (cryId[crystalL[0]]>=disk->nCrystal()) offset=disk->nCrystal(); - - std::vector neighbors1 = disk->findLocalNeighbors(cryId[crystalL[0]]-offset,1); - std::vector neighbors2 = disk->findLocalNeighbors(cryId[crystalL[0]]-offset,2); - neighbors1.insert(neighbors1.end(), neighbors2.begin(), neighbors2.end()); - - double etot19(cryEdep[crystalL[0]]); - std::vector evec; - evec.push_back(cryEdep[crystalL[0]]); - - for (auto in : neighbors1) - { - if (in == -1){evec.push_back(-1);continue;} - - double et(0); - for (auto icr : crystalL) if (in==cryId[icr]-offset) et=cryEdep[icr]; - evec.push_back(et); - etot19+=et; - } - - //this fills the energy of the central / first layer / second layer of crystals - e0_ = evec[0]/100; - e1_ = evec[1]/50; - e2_ = evec[2]/50; - e3_ = evec[3]/50; - e4_ = evec[4]/50; - e5_ = evec[5]/50; - e6_ = evec[6]/50; - e7_ = evec[7]; - e8_ = evec[8]; - e9_ = evec[9]; - e10_ = evec[10]; - e11_ = evec[11]; - e12_ = evec[12]; - e13_ = evec[13]; - e14_ = evec[14]; - e15_ = evec[15]; - e16_ = evec[16]; - e17_ = evec[17]; - e18_ = evec[18]; - e19_ = (cluEnergy[ic]-etot19)/100; - e20_ = 0; - - targetX_ = targetX; - targetY_ = targetY; - //targetX_ = deltaUV0.X(); - //targetY_ = deltaUV0.Y(); - targetA_ = targetExtend(ic,itrkMatch)/100; - - t0_ = trkPhi; - t1_ = trkTheta; - r0_ = sqrt(centerX*centerX+centerY*centerY)/1000; - z0_ = trkFFZ[itrkMatch]/200; - ip0_ = trkCposX[itrkMatch]/10; - ip1_ = trkCposY[itrkMatch]/10; - //ip0_ = sqrt(trkCposX[itrkMatch]*trkCposX[itrkMatch]+trkCposY[itrkMatch]*trkCposY[itrkMatch])/10; - //ip0_ = std::max(abs(trkCposX[itrkMatch]),abs(trkCposY[itrkMatch]))/10; - //ip0_ = std::max(abs(trkCposX[itrkMatch]),abs(trkCposY[itrkMatch]))> 10 ? 1 : 0; - - - c0_ = cluCogX[ic]; - c1_ = cluCogY[ic]; - c2_ = cogNew.X(); - c3_ = cogNew.Y(); - c4_ = clusimPosX[ic]; - c5_ = clusimPosY[ic]; - ffx_ = trkFFX[itrkMatch]; - ffy_ = trkFFY[itrkMatch]; - ffz_ = trkFFZ[itrkMatch]; - vdx_ = (ivm>-1) ? vdPosX[ivm] : -999; - vdy_ = (ivm>-1) ? vdPosY[ivm] : -999; - vdz_ = (ivm>-1) ? vdPosZ[ivm] : -999; - } - - - if (is_train) - {if (abs(targetX_)<2 && abs(targetY_)<2) dTuple->Fill();} - else - {dTuple->Fill();} - - - if ( (mode==1 || mode==2) && Nplot<10) - { - _view[Nplot]->Fill(e0_,e1_,e2_); - _view[Nplot]->Fill(e3_,e4_,e5_); - _view[Nplot]->Fill(e6_,e7_,e8_); - _view[Nplot]->Fill(e9_,e10_,e11_); - _view[Nplot]->Fill(e12_,e13_,e14_); - _view[Nplot]->Fill(e15_,e16_,e17_); - _view[Nplot]->Fill(e18_,e19_,e20_); - _view[Nplot]->Fill(e21_,e22_,e23_); - ++Nplot; - } - - - - } - - - - return kTRUE; -} - - - - -double AnalysisBaseMatch::targetExtend(int ic, int it) -{ - double trkp = sqrt(trkpX[it]*trkpX[it] + trkpY[it]*trkpY[it]+ trkpZ[it]*trkpZ[it]); - double trkpt = sqrt(trkpX[it]*trkpX[it]+trkpY[it]*trkpY[it]); - - TVector3 trkPos0(trkFFX[it],trkFFY[it],trkFFZ[it]); - TVector3 trkDir(trkpX[it]/trkp,trkpY[it]/trkp,trkpZ[it]/trkp); - - TVector3 cog = calcCog(ic); - - double dlenT(0); - TVector3 diff = trkPos0-cog ; - double distMin = sqrt(diff.X()*diff.X()+diff.Y()*diff.Y()); - for (double dlent=0;dlent<400;dlent+=1) - { - //TVector3 trkPos = trkPos0+dlent*trkDir; - TVector3 trkPos = getPosTrk(it,dlent); - - diff = trkPos-cog; - double dist = sqrt(diff.X()*diff.X()+diff.Y()*diff.Y()); - if (dist < distMin) {distMin=dist;dlenT=dlent;} - if (trkPos.Z() > 200) break; - } - - TVector3 TrkPosMin = trkPos0+dlenT*trkDir; - double dx = cog.X() - TrkPosMin.X(); - double dy = cog.Y() - TrkPosMin.Y(); - - _hx->Fill(dx); - _hy->Fill(dy); - _ha->Fill(dlenT); - - return dlenT; -} - - -TVector3 AnalysisBaseMatch::getPosTrk(int it, double dlen) -{ - double sinDip = sqrt(1-trkcdip[it]*trkcdip[it]); - double length = (trkZ[it] - trkz0[it])/sinDip + dlen; - double posXTrk = sin(trkphi0[it] + trkomega[it]*trkcdip[it]*length)/trkomega[it] - (trkd0[it] + 1.0/trkomega[it])*sin(trkphi0[it]); - double posYTrk = -cos(trkphi0[it] + trkomega[it]*trkcdip[it]*length)/trkomega[it] + (trkd0[it] + 1.0/trkomega[it])*cos(trkphi0[it]); - double posZtrk = dlen/sinDip+trkFFZ[it]; - - return TVector3(posXTrk,posYTrk,posZtrk); -} - - -TVector3 AnalysisBaseMatch::calcCog(int ic) -{ - - TVector3 aVector(0,0,0); - double sumWeights(0); - - std::vector crystalL = (*cluList)[ic]; - for (unsigned int il=0;il1e-3) { aVector[0] /= sumWeights; aVector[1] /= sumWeights;} - else { aVector[0] = aVector[1] = 0;} - - return aVector; -} - - - - -int AnalysisBaseMatch::vdFinder() -{ - int nv(0),vIdxMax(-1); - double dmax(0); - - for (int i=0;i dmax) {dmax = dist; vIdxMax=i;} - ++nv; - } - if (nv==1 || dmax > 370) return vIdxMax; - return -1; -} - -double AnalysisBaseMatch::cluDistance(int ic1, int ic2) -{ - std::vector crystalL1 = (*cluList)[ic1]; - std::vector crystalL2 = (*cluList)[ic2]; - - double dist(1e6); - for (unsigned int i1 = 0;i1 < crystalL1.size();++i1) - { - double x1 = cryPosX[crystalL1[i1]]; - double y1 = cryPosY[crystalL1[i1]]; - for (unsigned int i2 = 0;i2 < crystalL2.size();++i2) - { - double x2 = cryPosX[crystalL2[i2]]; - double y2 = cryPosY[crystalL2[i2]]; - double dd = sqrt( (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); - if (dd < dist) dist = dd; - } - } - return dist; -} - - - - - - - - - -void AnalysisBaseMatch::Terminate() -{ - fHistFile->cd(); - fHistFile->Write(); - fHistFile->Close(); -} - - -void AnalysisBaseMatch::SetStyleGr(TGraph *gr) -{ - gr->SetTitle(" "); - gr->GetXaxis()->SetTitle("Sig efficiency"); - gr->GetYaxis()->SetTitle("Event fraction"); - gr->GetXaxis()->SetTitleSize(0.04); - gr->GetXaxis()->SetLabelSize(0.04); - gr->GetYaxis()->SetTitleSize(0.04); - gr->GetYaxis()->SetLabelSize(0.04); - gr->GetYaxis()->SetTitleOffset(1.2); - gr->GetYaxis()->SetRangeUser(0,0.4); -} - - - - - - - - -TH1F* AnalysisBaseMatch::Book1DF(TString name, TString title, Int_t nbins, Double_t low, Double_t high, TString xaxis, TString units) -{ - - TH1F* histo = new TH1F(name,title,nbins,low,high); - SetStyle(histo,xaxis,units); - return histo; -} - -TH1I* AnalysisBaseMatch::Book1DI(TString name, TString title, Int_t nbins, Double_t low, Double_t high, TString xaxis, TString units) -{ - TH1I* histo = new TH1I(name,title,nbins,low,high); - SetStyle(histo,xaxis,units); - return histo; -} - -TH2F* AnalysisBaseMatch::Book2DF(TString name, TString title, Int_t nbinsx, Double_t xlow, Double_t xhigh, Int_t nbinsy, Double_t ylow, Double_t yhigh, TString xaxis, TString yaxis) -{ - TH2F* histo = new TH2F(name,title,nbinsx,xlow,xhigh,nbinsy,ylow,yhigh); - histo->GetYaxis()->SetTitleOffset(1.2); - histo->GetXaxis()->SetTitleSize(0.045); - histo->GetYaxis()->SetTitleSize(0.045); - histo->GetXaxis()->SetLabelSize(0.04); - histo->GetYaxis()->SetLabelSize(0.04); - histo->SetTitle(""); - histo->GetXaxis()->SetTitle(xaxis); - histo->GetYaxis()->SetTitle(yaxis); - - return histo; -} - -void AnalysisBaseMatch::SetStyle(TH1* histo,TString xaxis, TString units) -{ - - histo->SetMarkerStyle(20); - histo->SetMarkerSize(0.6); - histo->SetLineWidth(2); - histo->GetYaxis()->SetTitleOffset(1.2); - histo->GetXaxis()->SetTitleSize(0.045); - histo->GetYaxis()->SetTitleSize(0.045); - histo->GetXaxis()->SetLabelSize(0.04); - histo->GetYaxis()->SetLabelSize(0.04); - histo->SetTitle(""); - - Char_t ylabel[30]; - Double_t binsize = histo->GetBinWidth(1); - sprintf(ylabel,"Entries / %g ",binsize); - - histo->GetXaxis()->SetTitle(xaxis+" ("+units+")"); - if (units=="")histo->GetXaxis()->SetTitle(xaxis); - - histo->GetYaxis()->SetTitle(ylabel+units); - if (units=="") histo->GetYaxis()->SetTitle("Entries"); - - return; -} -/* - double output = (clusimPosY[ic]-centerY)/_cellSize; - //double output = ((cluCogX[ic]-clusimPosX[ic]-3904)*cos(vdPhi)+(cluCogY[ic]-clusimPosY[ic])*sin(vdPhi))/_cellSize; - _output->Fill(output); - - vector res; - - res.push_back(vdPhi); - res.push_back(vdTheta); - res.push_back(cluCogX[ic]); - res.push_back(cluCogY[ic]); - res.push_back(clusimPosX[ic]); - res.push_back(clusimPosY[ic]); - - res.push_back(matrixE[0]); - for (int i=1;i<10;++i) {res.push_back(matrixX[i]);res.push_back(matrixY[i]);res.push_back(matrixE[i]);} - - res.push_back(vdPhi); - res.push_back(vdTheta); - res.push_back(output); - _results.push_back(res); -*/ diff --git a/TrackCaloMatching/test/AnalysisBaseMatch.h b/TrackCaloMatching/test/AnalysisBaseMatch.h deleted file mode 100644 index b7772df4a3..0000000000 --- a/TrackCaloMatching/test/AnalysisBaseMatch.h +++ /dev/null @@ -1,317 +0,0 @@ -////////////////////////////////////////////////////////// -// This class has been automatically generated on -// Fri Feb 8 15:32:58 2013 by ROOT version 5.30/02 -// from TTree Calo/Calo -// found on file: test.root -////////////////////////////////////////////////////////// - -#ifndef AnalysisBaseMatch_h -#define AnalysisBaseMatch_h - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Src/Disk.hh" - - -class AnalysisBaseMatch : public TSelector { -public : - TTree *fChain; //!pointer to the analyzed TTree or TChain - - // Declaration of leaf types - Int_t evt; - Int_t nMatch; - Int_t mTrkId[1024]; //[nMatch] - Int_t mCluId[1024]; //[nMatch] - Float_t mChi2[1024]; //[nMatch] - Float_t mChi2Pos[1024]; //[nMatch] - Float_t mChi2Time[1024]; //[nMatch] - Int_t nTrk; - Float_t trkX[1024]; //[nTrk] - Float_t trkY[1024]; //[nTrk] - Float_t trkZ[1024]; //[nTrk] - Float_t trkFFX[1024]; //[nTrk] - Float_t trkFFY[1024]; //[nTrk] - Float_t trkFFZ[1024]; //[nTrk] - Float_t trkCposX[1024]; //[nTrk] - Float_t trkCposY[1024]; //[nTrk] - Float_t trkt[1024]; //[nTrk] - Float_t trke[1024]; //[nTrk] - Float_t trkpX[1024]; //[nTrk] - Float_t trkpY[1024]; //[nTrk] - Float_t trkpZ[1024]; //[nTrk] - Int_t trknHit[1024]; //[nTrk] - Int_t trkStat[1024]; //[nTrk] - Float_t trkprob[1024]; //[nTrk] - Float_t trkd0[1024]; //[nTrk] - Float_t trkz0[1024]; //[nTrk] - Float_t trkphi0[1024]; //[nTrk] - Float_t trkomega[1024]; //[nTrk] - Float_t trkcdip[1024]; //[nTrk] - Float_t trkdlen[1024]; //[nTrk] - Int_t trkCluIdx[1024]; //[nTrk] - Int_t nCluster; - Float_t cluEnergy[1024]; //[nCluster] - Float_t cluTime[1024]; //[nCluster] - Float_t cluCogX[1024]; //[nCluster] - Float_t cluCogY[1024]; //[nCluster] - Float_t cluCogZ[1024]; //[nCluster] - Float_t cluE1[1024]; //[nCluster] - Float_t cluE9[1024]; //[nCluster] - Float_t cluE25[1024]; //[nCluster] - Float_t clu2Mom[1024]; //[nCluster] - Float_t cluAngle[1024]; //[nCluster] - Int_t cluConv[1024]; //[nCluster] - Int_t cluSimIdx[1024]; //[nCluster] - Int_t cluSimLen[1024]; //[nCluster] - vector > *cluList; - Int_t nCluSim; - Int_t clusimId[1024]; //[nCluSim] - Int_t clusimPdgId[1024]; //[nCluSim] - Int_t clusimGenIdx[1024]; //[nCluSim] - Int_t clusimCrCode[1024]; //[nCluSim] - Float_t clusimMom[1024]; //[nCluSim] - Float_t clusimPosX[1024]; //[nCluSim] - Float_t clusimPosY[1024]; //[nCluSim] - Float_t clusimPosZ[1024]; //[nCluSim] - Float_t clusimTime[1024]; //[nCluSim] - Float_t clusimEdep[1024]; //[nCluSim] - Int_t nCry; - Int_t cryId[101]; //[nCry] - Int_t crySecId[101]; //[nCry] - Float_t cryPosX[101]; //[nCry] - Float_t cryPosY[101]; //[nCry] - Float_t cryPosZ[101]; //[nCry] - Float_t cryEdep[101]; //[nCry] - Float_t cryTime[101]; //[nCry] - Int_t nVd; - Int_t vdId[1024]; //[nVd] - Int_t vdPdgId[1024]; //[nVd] - Float_t vdMom[1024]; //[nVd] - Float_t vdMomX[1024]; //[nVd] - Float_t vdMomY[1024]; //[nVd] - Float_t vdMomZ[1024]; //[nVd] - Float_t vdPosX[1024]; //[nVd] - Float_t vdPosY[1024]; //[nVd] - Float_t vdPosZ[1024]; //[nVd] - Float_t vdTime[1024]; //[nVd] - Int_t vdGenIdx[1024]; //[nVd] - - // List of branches - TBranch *b_evt; //! - TBranch *b_nMatch; //! - TBranch *b_mTrkId; //! - TBranch *b_mCluId; //! - TBranch *b_mChi2; //! - TBranch *b_mChi2Pos; //! - TBranch *b_mChi2Time; //! - TBranch *b_nTrk; //! - TBranch *b_trkX; //! - TBranch *b_trkY; //! - TBranch *b_trkZ; //! - TBranch *b_trkFFX; //! - TBranch *b_trkFFY; //! - TBranch *b_trkFFZ; //! - TBranch *b_trkCposX; //! - TBranch *b_trkCposY; //! - TBranch *b_trkt; //! - TBranch *b_trke; //! - TBranch *b_trkpX; //! - TBranch *b_trkpY; //! - TBranch *b_trkpZ; //! - TBranch *b_trknHit; //! - TBranch *b_trkStat; //! - TBranch *b_trkprob; //! - TBranch *b_trkd0; //! - TBranch *b_trkz0; //! - TBranch *b_trkphi0; //! - TBranch *b_trkomega; //! - TBranch *b_trkcdip; //! - TBranch *b_trkdlen; //! - TBranch *b_trkCluIdx; //! - TBranch *b_nCluster; //! - TBranch *b_cluEnergy; //! - TBranch *b_cluTime; //! - TBranch *b_cluCogX; //! - TBranch *b_cluCogY; //! - TBranch *b_cluCogZ; //! - TBranch *b_cluE1; //! - TBranch *b_cluE9; //! - TBranch *b_cluE25; //! - TBranch *b_clu2Mom; //! - TBranch *b_cluAngle; //! - TBranch *b_cluConv; //! - TBranch *b_cluSimIdx; //! - TBranch *b_cluSimLen; //! - TBranch *b_cluList; //! - TBranch *b_nCluSim; //! - TBranch *b_clusimId; //! - TBranch *b_clusimPdgId; //! - TBranch *b_clusimGenIdx; //! - TBranch *b_clusimCrCode; //! - TBranch *b_clusimMom; //! - TBranch *b_clusimPosX; //! - TBranch *b_clusimPosY; //! - TBranch *b_clusimPosZ; //! - TBranch *b_clusimTime; //! - TBranch *b_clusimEdep; //! - TBranch *b_nCry; //! - TBranch *b_cryId; //! - TBranch *b_crySecId; //! - TBranch *b_cryPosX; //! - TBranch *b_cryPosY; //! - TBranch *b_cryPosZ; //! - TBranch *b_cryEdep; //! - TBranch *b_cryTime; //! - TBranch *b_nVd; //! - TBranch *b_vdId; //! - TBranch *b_vdPdgId; //! - TBranch *b_vdMom; //! - TBranch *b_vdMomX; //! - TBranch *b_vdMomY; //! - TBranch *b_vdMomZ; //! - TBranch *b_vdPosX; //! - TBranch *b_vdPosY; //! - TBranch *b_vdPosZ; //! - TBranch *b_vdTime; //! - TBranch *b_vdGenIdx; //! - - AnalysisBaseMatch(TTree * /*tree*/ =0) { } - virtual ~AnalysisBaseMatch() { } - virtual Int_t Version() const { return 2; } - virtual void Begin(TTree *tree); - virtual void SlaveBegin(TTree*) {}; - virtual void Init(TTree *tree); - virtual Bool_t Notify(); - virtual Bool_t Process(Long64_t entry); - virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; } - virtual void SetOption(const char *option) { fOption = option; } - virtual void SetObject(TObject *obj) { fObject = obj; } - virtual void SetInputList(TList *input) { fInput = input; } - virtual TList *GetOutputList() const { return fOutput; } - virtual void SlaveTerminate() {}; - virtual void Terminate(); - - - TH1F* Book1DF(TString name, TString title, Int_t nbins, Double_t low, Double_t high, TString xaxis="", TString units=""); - TH1I* Book1DI(TString name, TString title, Int_t nbins, Double_t low, Double_t high, TString xaxis="", TString units=""); - TH2F* Book2DF(TString name, TString title, Int_t nbinsx, Double_t xlow, Double_t xhigh, Int_t nbinsy, Double_t ylow, Double_t yhigh, TString xaxis="", TString yaxis=""); - void SetStyle(TH1 *histo,TString xaxis, TString units); - void SetStyleGr(TGraph *gr); - double cluDistance(int ic1, int ic2); - double targetExtend(int ic, int it); - TVector3 calcCog(int ic); - TVector3 getPosTrk(int it, double dlen); - - int vdFinder(); - - TFile *fHistFile; - TString histname; - - Disk* disk; - - ClassDef(AnalysisBaseMatch,0); -}; - -#endif - -#ifdef AnalysisBaseMatch_cxx -void AnalysisBaseMatch::Init(TTree *tree) -{ - - cluList = 0; - if (!tree) return; - fChain = tree; - fChain->SetMakeClass(1); - - fChain->SetBranchAddress("evt", &evt, &b_evt); - fChain->SetBranchAddress("nMatch", &nMatch, &b_nMatch); - fChain->SetBranchAddress("mTrkId", mTrkId, &b_mTrkId); - fChain->SetBranchAddress("mCluId", mCluId, &b_mCluId); - fChain->SetBranchAddress("mChi2", mChi2, &b_mChi2); - fChain->SetBranchAddress("mChi2Pos", mChi2Pos, &b_mChi2Pos); - fChain->SetBranchAddress("mChi2Time", mChi2Time, &b_mChi2Time); - fChain->SetBranchAddress("nTrk", &nTrk, &b_nTrk); - fChain->SetBranchAddress("trkX", trkX, &b_trkX); - fChain->SetBranchAddress("trkY", trkY, &b_trkY); - fChain->SetBranchAddress("trkZ", trkZ, &b_trkZ); - fChain->SetBranchAddress("trkFFX", trkFFX, &b_trkFFX); - fChain->SetBranchAddress("trkFFY", trkFFY, &b_trkFFY); - fChain->SetBranchAddress("trkFFZ", trkFFZ, &b_trkFFZ); - fChain->SetBranchAddress("tkrCposX", trkCposX, &b_trkCposX); - fChain->SetBranchAddress("tkrCposY", trkCposY, &b_trkCposY); - fChain->SetBranchAddress("trkt", trkt, &b_trkt); - fChain->SetBranchAddress("trke", trke, &b_trke); - fChain->SetBranchAddress("trkpX", trkpX, &b_trkpX); - fChain->SetBranchAddress("trkpY", trkpY, &b_trkpY); - fChain->SetBranchAddress("trkpZ", trkpZ, &b_trkpZ); - fChain->SetBranchAddress("trknHit", trknHit, &b_trknHit); - fChain->SetBranchAddress("trkStat", trkStat, &b_trkStat); - fChain->SetBranchAddress("trkprob", trkprob, &b_trkprob); - fChain->SetBranchAddress("trkd0", trkd0, &b_trkd0); - fChain->SetBranchAddress("trkz0", trkz0, &b_trkz0); - fChain->SetBranchAddress("trkphi0", trkphi0, &b_trkphi0); - fChain->SetBranchAddress("trkomega", trkomega, &b_trkomega); - fChain->SetBranchAddress("trkcdip", trkcdip, &b_trkcdip); - fChain->SetBranchAddress("trkdlen", trkdlen, &b_trkdlen); - fChain->SetBranchAddress("trkCluIdx", trkCluIdx, &b_trkCluIdx); - fChain->SetBranchAddress("nCluster", &nCluster, &b_nCluster); - fChain->SetBranchAddress("cluEnergy", cluEnergy, &b_cluEnergy); - fChain->SetBranchAddress("cluTime", cluTime, &b_cluTime); - fChain->SetBranchAddress("cluCogX", cluCogX, &b_cluCogX); - fChain->SetBranchAddress("cluCogY", cluCogY, &b_cluCogY); - fChain->SetBranchAddress("cluCogZ", cluCogZ, &b_cluCogZ); - fChain->SetBranchAddress("cluE1", cluE1, &b_cluE1); - fChain->SetBranchAddress("cluE9", cluE9, &b_cluE9); - fChain->SetBranchAddress("cluE25", cluE25, &b_cluE25); - fChain->SetBranchAddress("clu2Mom", clu2Mom, &b_clu2Mom); - fChain->SetBranchAddress("cluAngle", cluAngle, &b_cluAngle); - fChain->SetBranchAddress("cluConv", cluConv, &b_cluConv); - fChain->SetBranchAddress("cluSimIdx", cluSimIdx, &b_cluSimIdx); - fChain->SetBranchAddress("cluSimLen", cluSimLen, &b_cluSimLen); - fChain->SetBranchAddress("cluList", &cluList, &b_cluList); - fChain->SetBranchAddress("nCluSim", &nCluSim, &b_nCluSim); - fChain->SetBranchAddress("clusimId", clusimId, &b_clusimId); - fChain->SetBranchAddress("clusimPdgId", clusimPdgId, &b_clusimPdgId); - fChain->SetBranchAddress("clusimGenIdx", clusimGenIdx, &b_clusimGenIdx); - fChain->SetBranchAddress("clusimCrCode", clusimCrCode, &b_clusimCrCode); - fChain->SetBranchAddress("clusimMom", clusimMom, &b_clusimMom); - fChain->SetBranchAddress("clusimPosX", clusimPosX, &b_clusimPosX); - fChain->SetBranchAddress("clusimPosY", clusimPosY, &b_clusimPosY); - fChain->SetBranchAddress("clusimPosZ", clusimPosZ, &b_clusimPosZ); - fChain->SetBranchAddress("clusimTime", clusimTime, &b_clusimTime); - fChain->SetBranchAddress("clusimEdep", clusimEdep, &b_clusimEdep); - fChain->SetBranchAddress("nCry", &nCry, &b_nCry); - fChain->SetBranchAddress("cryId", cryId, &b_cryId); - fChain->SetBranchAddress("crySecId", crySecId, &b_crySecId); - fChain->SetBranchAddress("cryPosX", cryPosX, &b_cryPosX); - fChain->SetBranchAddress("cryPosY", cryPosY, &b_cryPosY); - fChain->SetBranchAddress("cryPosZ", cryPosZ, &b_cryPosZ); - fChain->SetBranchAddress("cryEdep", cryEdep, &b_cryEdep); - fChain->SetBranchAddress("cryTime", cryTime, &b_cryTime); - fChain->SetBranchAddress("nVd", &nVd, &b_nVd); - fChain->SetBranchAddress("vdId", vdId, &b_vdId); - fChain->SetBranchAddress("vdPdgId", vdPdgId, &b_vdPdgId); - fChain->SetBranchAddress("vdMom", vdMom, &b_vdMom); - fChain->SetBranchAddress("vdMomX", vdMomX, &b_vdMomX); - fChain->SetBranchAddress("vdMomY", vdMomY, &b_vdMomY); - fChain->SetBranchAddress("vdMomZ", vdMomZ, &b_vdMomZ); - fChain->SetBranchAddress("vdPosX", vdPosX, &b_vdPosX); - fChain->SetBranchAddress("vdPosY", vdPosY, &b_vdPosY); - fChain->SetBranchAddress("vdPosZ", vdPosZ, &b_vdPosZ); - fChain->SetBranchAddress("vdTime", vdTime, &b_vdTime); - fChain->SetBranchAddress("vdGenIdx", vdGenIdx, &b_vdGenIdx); -} - -Bool_t AnalysisBaseMatch::Notify() -{ - return kTRUE; -} - -#endif // #ifdef AnalysisBaseMatch_cxx diff --git a/TrackCaloMatching/test/FitCog.C b/TrackCaloMatching/test/FitCog.C deleted file mode 100644 index 210ceed851..0000000000 --- a/TrackCaloMatching/test/FitCog.C +++ /dev/null @@ -1,1041 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -void fillFinal(double* par); -void fitFinal(TString title, TH1F *h, int ichoice); - -void fcn(int& npar, double* deriv, double& f, double par[], int flag); -double getChi2(double* par); -TVector3 calcCog(int ic, double *par); -TVector3 getPosTrk(int it, double dlen); -bool checkVD(bool wantFace=false, bool want400=false, bool wantSide=false); -double calcLen(int ic); - -TH2Poly* buildDisk(TString hname,double _radiusIn, double _radiusOut, double _cellSize); -void getXYPosition_disk(int index, double&x, double& y) ; -bool isInsideDisk(double x, double y, double _cellSize, double _radiusIn, double _radiusOut) ; -double calcDistToSide(TVector2& a, TVector2& b) ; - -void setTree(); -void makeHist(); -void histHelper(TH1F* hist, TString title); -void visualize(); - -double Tail(double *x, double *par); -double PartGau(double *x, double *par); -double CBall(double *x, double *par); -double fitFun(double *x, double *par); -double FHWM(TF1 *func, double xmin, double xmax); - - -TTree *tree; - -Int_t evt; - -Int_t nMatch; -Int_t mTrkId[1024]; -Int_t mCluId[1024]; -Float_t mChi2[1024]; -Float_t mChi2Pos[1024]; -Float_t mChi2Time[1024]; - -Int_t nTrk; -Float_t trkX[1024]; -Float_t trkY[1024]; -Float_t trkZ[1024]; -Float_t trkFFX[1024]; -Float_t trkFFY[1024]; -Float_t trkFFZ[1024]; -Float_t trkt[1024]; -Float_t trke[1024]; -Float_t trkpX[1024]; -Float_t trkpY[1024]; -Float_t trkpZ[1024]; -Int_t trknHit[1024]; -Int_t trkStat[1024]; -Float_t trkprob[1024]; -Float_t trkd0[1024]; -Float_t trkz0[1024]; -Float_t trkphi0[1024]; -Float_t trkomega[1024]; -Float_t trkcdip[1024]; -Float_t trkdlen[1024]; - -Int_t nCluster; -Float_t cluEnergy[1024]; -Float_t cluTime[1024]; -Float_t cluCogX[1024]; -Float_t cluCogY[1024]; -Float_t cluCogZ[1024]; -Float_t clu2Mom[1024]; -Float_t cluE25[1024]; -vector > *cluList; - -Int_t nCry; -Int_t cryId[1024]; -Int_t crySecId[1024]; -Float_t cryPosX[1024]; -Float_t cryPosY[1024]; -Float_t cryPosZ[1024]; -Float_t cryEdep[1024]; -Float_t cryTime[1024]; -Int_t nVd; -Int_t vdId[1024]; -Int_t vdPdgId[1024]; -Float_t vdMom[1024]; -Float_t vdMomX[1024]; -Float_t vdMomY[1024]; -Float_t vdMomZ[1024]; -Float_t vdPosX[1024]; -Float_t vdPosY[1024]; -Float_t vdPosZ[1024]; -Float_t vdTime[1024]; -Int_t vdSimId[1024]; - - - - -TH2Poly *_dedep[30]; -int numPoly=0; -double visX[100],visY[100]; -double visPX[100],visPY[100]; -double visCX[100],visCY[100]; -int visN[100]; -double visLX[100][100]; -double visLY[100][100]; - -TH1F *_hx,*_hy,*_hxtrk,*_hytrk,*_hxy,*_hxytrk,*_hu,*_hutrk,*_hv,*_hvtrk,*_hr,*_huc,*_hvc,*_hu0,*_hv0,*_ha,*_hncr,*_prob1,*_prob2,*_chi2prob; -TH2F *_hxy2,*_hu2nd,*_hv2nd,*_huE25,*_huDist,*_huRad,*_hucDip,*_prob2d; -int _dispCount = 0; -TGraphErrors *gr; - - - -int WeightMode = 0; -double RatioEcut = 0.0; -int NevtFit = 10000; -bool checkFace = false; -bool checkSide = false; - -TString modelName[5]={"linear","sqrt","log"}; - - -double duOffset = 0; -double dvOffset = 0; - - - -void FitCog(int wmode = 0) -{ - WeightMode = wmode; - - TFile file("dataMu2e/ElecTrain/tt.root"); - tree = (TTree *)file.Get("ReadTrackCaloMatching/trkClu"); - tree->SetMakeClass(1); - tree->LoadBaskets(); - cluList = 0; - - setTree(); - makeHist(); - - - double param[10]; - int npar(5); - - TFitter minuit(99); - minuit.SetFCN(fcn); - - switch (WeightMode) { - - //linear - case 0: - minuit.SetParameter(0, "par0", 0., 1., 0.0, 0.0); - //minuit.SetParameter(1, "par1", 1., 1., 0.0, 0.0); - npar=1; - break; - - //sqrt(x) - case 1: - minuit.SetParameter(1, "par1", 1., 1., -20.0, 20.0); - npar=1; - break; - - //log(x) - case 2: - minuit.SetParameter(0, "par0", 0.1, 0.01, 0,0); - minuit.SetParameter(1, "par1", 1, 0.01, 0.001, 100.0); - npar=2; - break; - - default : - cout<<"No wieght "<< WeightMode<<" available"<Divide(2); - c1->cd(1); _hx->Draw("e"); - c1->cd(2); _hy->Draw("e"); - c1->SaveAs(Form("plots/FitCogNew%i1.eps",wmode)); - - TCanvas *c2 = new TCanvas("c2","c2",800,600); - _hxy2->Draw("colz"); - c2->SaveAs(Form("plots/FitCogNew%i2.eps",wmode)); - - - TCanvas *c4 = new TCanvas("c4","c4",800,600); - c4->Divide(2); - c4->cd(1); _hu->Draw("e"); - c4->cd(2); _hv->Draw("e"); - c4->SaveAs(Form("plots/FitCogNew%i4.eps",wmode)); - - - TCanvas *c5 = new TCanvas("c5","c5",800,600); - _hxy->Draw("e"); - c5->SaveAs(Form("plots/FitCogNew%i4a.eps",wmode)); - _hv->Draw("e"); - c5->SaveAs(Form("plots/FitCogNew%i4b.eps",wmode)); - - - -//visualize(); - - TFile fres("hres.root","RECREATE"); - fres.Add(_hx); - fres.Add(_hy); - fres.Add(_hxy); - fres.Add(_hxy2); - fres.Add(_hu0); - fres.Add(_hv0); - fres.Add(_hu); - fres.Add(_hr); - fres.Add(_hv); - fres.Add(_huc); - fres.Add(_hvc); - fres.Add(_hu2nd); - fres.Add(_hv2nd); - fres.Add(_huE25); - fres.Add(_huDist); - fres.Add(_hucDip); - fres.Add(_huRad); - fres.Add(_ha); - fres.Add(_hncr); - fres.Add(_prob1); - fres.Add(_prob2); - fres.Add(_prob2d); - fres.Add(_chi2prob); - for (int i=0;i<19;i++)fres.Add(_dedep[i]); - fres.Write(); - fres.Close(); - -} - - - - - - - - - - - - - - -void fillFinal(double* par) -{ - - int nevent = tree->GetEntries(); - - for (int i=0;iGetEntry(i); - for (int im=0;im100) continue; - int it = mTrkId[im]; - int ic = mCluId[im]; - - - if (cluEnergy[ic]<50) continue; - if (trkStat[it]!=1 || trkprob[it]<0.01 || trknHit[it] < 15) continue; - - //if (checkFace && trkFFZ[it] >1 ) continue; - //if (checkSide && trkFFZ[it] <1 ) continue; - - - - double distShowerMax = calcLen(ic); - - double trkp = sqrt(trkpX[it]*trkpX[it] + trkpY[it]*trkpY[it]+ trkpZ[it]*trkpZ[it]); - double trkpt = sqrt(trkpX[it]*trkpX[it]+trkpY[it]*trkpY[it]); - TVector2 du(trkpX[it]/trkpt,trkpY[it]/trkpt); - TVector2 dv(-trkpY[it]/trkpt,trkpX[it]/trkpt); - TVector2 dx_inuv(trkpX[it]/trkpt,-trkpY[it]/trkpt); - TVector2 dy_inuv(trkpY[it]/trkpt,trkpX[it]/trkpt); - - - - //TVector3 trkPos0 = getPosTrk(it,0); - TVector3 trkPos0(trkFFX[it],trkFFY[it],0); - TVector3 trkDir(trkpX[it]/trkp,trkpY[it]/trkp,trkpZ[it]/trkp); - - TVector3 cog = calcCog(ic, par); - TVector3 cluDir(0,0,1); - - TVector3 initDiff = cog-trkPos0; - if ( sqrt(initDiff.X()*initDiff.X()+initDiff.Y()*initDiff.Y()) > 200) continue; - - - - - //min distan0 ce in xy cordinate - double dlenT(0); - TVector3 diff = trkPos0-cog ; - double distMin = sqrt(diff.X()*diff.X()+diff.Y()*diff.Y()); - for (double dlent=0;dlent<200;dlent+=1.0) - { - //TVector3 trkPos = getPosTrk(it,dlent); - TVector3 trkPos = trkPos0+dlent*trkDir; - diff = trkPos-cog; - double dist = sqrt(diff.X()*diff.X()+diff.Y()*diff.Y()); - if (dist < distMin) {distMin=dist;dlenT=dlent;} - } - - - TVector3 TrkPosMin = trkPos0+dlenT*trkDir; - double dx = cog.X() - TrkPosMin.X(); - double dy = cog.Y() - TrkPosMin.Y(); - TVector2 xy(dx,dy); - - TVector2 deltaUV0(xy*du,xy*dv); - TVector2 deltaUV( xy*du-duOffset,xy*dv-dvOffset); - TVector2 deltaXY(dx,dy); - _ha->Fill(dlenT); - -/* - - double dlenC(0),dlenT(0); - double distMinGen = (trkPos0-cog).Mag(); - for (double dlent=0;dlent<100;dlent+=1.0) - { - TVector3 trkPos = getPosTrk(it,dlent); - //TVector3 trkPos = trkPos0+dlent*trkDir; - for (double dlenc=0;dlenc<100;dlenc+=1.0) - { - TVector3 cluPos = cog + (dlenc*cluDir); - double dist = (cluPos-trkPos).Mag(); - if (dist < distMinGen) {distMinGen=dist;;dlenT=dlent;;dlenC=dlenc;} - } - } - - TVector3 TrkPosMin = trkPos0+dlenT*trkDir; - double dx = cog.X() - TrkPosMin.X(); - double dy = cog.Y() - TrkPosMin.Y(); - TVector2 xy(dx,dy); - - TVector2 deltaUV0(xy*du,xy*dv); - TVector2 deltaUV( xy*du-duOffset,xy*dv-dvOffset); - TVector2 deltaXY(dx,dy); -*/ - - - - _hx->Fill(deltaXY.X()); - _hy->Fill(deltaXY.Y()); - _hxy->Fill(deltaXY.X()); - _hxy->Fill(deltaXY.Y()); - _hxy2->Fill(deltaXY.X(),deltaXY.Y()); - _hr->Fill(deltaXY.Mod2()); - _hu0->Fill(deltaUV0.X()); - _hv0->Fill(deltaUV0.Y()); - _hu->Fill(deltaUV.X()); - _hv->Fill(deltaUV.Y()); - - - - _hu2nd->Fill(clu2Mom[ic]/1000,deltaUV0.X()); - _hv2nd->Fill(clu2Mom[ic]/1000,deltaUV0.Y()); - _huE25->Fill(cluE25[ic]/cluEnergy[ic],deltaUV0.X()); - _huDist->Fill(distShowerMax,deltaUV0.X()); - _hucDip->Fill(trkcdip[it],deltaUV0.X()); - _huRad->Fill(sqrt(cog.X()*cog.X()+cog.Y()*cog.Y()),deltaUV0.X()); - - - - - int Ncr(0); - std::vector crystalL = (*cluList)[ic]; - for (unsigned int il=0;il 5) ++Ncr; - _hncr->Fill(Ncr); - - - - if (deltaUV.X() >25 && numPoly<30) - { - visX[numPoly]=TrkPosMin.X(); - visY[numPoly]=TrkPosMin.Y(); - visPX[numPoly]=trkpX[it]/trkpt; - visPY[numPoly]=trkpY[it]/trkpt; - visCX[numPoly]=cog.X(); - visCY[numPoly]=cog.Y(); - - for (int il=0;il 0.9) _dedep[numPoly]->Fill(cryPosX[il],cryPosY[il],cryEdep[il]); - - std::vector crystalList = (*cluList)[ic]; - visN[numPoly]=crystalList.size(); - for (unsigned int il=0;ilFit("gaus","q","",-20,20); - cout<<"Results "<GetFunction("gaus")->GetParameter(1)<<" +- "<GetFunction("gaus")->GetParError(1)<<" " - <GetFunction("gaus")->GetParameter(2)<<" +- "<GetFunction("gaus")->GetParError(2)<GetMaximum()/2.5,0,6.0,0.5*h->GetMaximum()/5.5,10,1); - h->Fit("f","q"); - double fwhm = FHWM(&func,-30,30); - - cout<<"Results "<GetRMS()<Fit("gaus","q"); - cout<<"Results "<GetFunction("gaus")->GetParameter(2)<<" +- "<GetFunction("gaus")->GetParError(2)<<" / " - <GetFunction("gaus")->GetParameter(1)<<" +- "<GetFunction("gaus")->GetParError(1)<GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),5); - func.SetParameters(h->GetSumOfWeights()/6/h->GetRMS(),h->GetBinCenter(h->GetMaximumBin()),h->GetRMS(),5,1); - func.SetParLimits(3,0,50); - h->Fit("fitFun","q"); - double fwhm = FHWM(&func,-30,30); - cout<<"Results "<GetRMS()<Fit("f","q"); - double fwhm = FHWM(&func,-30,30); - - cout<<"Results "<GetRMS()<Draw("colz"); - TEllipse *el = new TEllipse(visX[i],visY[i],10,10); - el->SetFillStyle(3000); - el->SetFillColor(1); - el->Draw(); - - TEllipse *el2 = new TEllipse(visCX[i],visCY[i],10,10); - el2->SetFillStyle(3000); - el2->SetFillColor(5); - el2->Draw(); - - for (int ic=0;icSetFillStyle(3000); - el3->SetFillColor(1); - el3->Draw(); - } - - TArrow *ar = new TArrow(visX[i],visY[i],visX[i]+50*visPX[i],visY[i]+50*visPY[i],0.01); - ar->Draw(); - - ce->SaveAs(Form("plots/vis%i.eps",i)); - } - -} - - -double FHWM(TF1 *func, double xmin, double xmax) -{ - - double step(0.01); - - double vmax(-1),xvmax(0); - for (double x=xmin;xEval(x); - if (val > vmax) {vmax = val ; xvmax=x;} - } - - double vlim1(0),vlim2(0); - for (double x=xmin;xEval(x); - if (val > (vmax/2.0)) {vlim1 = x ; break;} - } - - for (double x=xmax;x>xmin;x-=step) { - double val = func->Eval(x); - if (val > (vmax/2.0)) {vlim2 = x+step ; break;} - } - - return (vlim2-vlim1)/2.34; -} - - - - - - - -void fcn(int& npar, double* deriv, double& f, double par[], int flag) -{ - f=getChi2(par); - //cout<GetEntries(); - if (NevtFit > 0 && NevtFit < nevent) nevent = NevtFit; - - for (int i=0;iGetEntry(i); - for (int im=0;im100) continue; - int it = mTrkId[im]; - int ic = mCluId[im]; - - - if (cluEnergy[ic]<60) continue; - if (trkStat[it]!=1 || trkprob[it]<0.001) continue; - - if (checkFace && trkFFZ[it] >1 ) continue; - if (checkSide && trkFFZ[it] <1 ) continue; - - - double trkp = sqrt(trkpX[it]*trkpX[it] + trkpY[it]*trkpY[it]+ trkpZ[it]*trkpZ[it]); - TVector3 trkDir(trkpX[it]/trkp,trkpY[it]/trkp,trkpZ[it]/trkp); - TVector3 trkPos0 = getPosTrk(it,0); - - TVector3 cog = calcCog(ic, par); - TVector3 cluDir(0,0,1); - - - - //min distance in xy cordinate - TVector3 diff = trkPos0-cog ; - double distMin = sqrt(diff.X()*diff.X()+diff.Y()*diff.Y()); - for (double dlent=0;dlent<100;dlent+=1.0) - { - //TVector3 trkPos = getPosTrk(it,dlent); - TVector3 trkPos = trkPos0+dlent*trkDir; - diff = trkPos-cog; - double dist = sqrt(diff.X()*diff.X()+diff.Y()*diff.Y()); - if (dist < distMin) distMin=dist; - } - - - -/* - // min distance in 3d - double distMin = (trkPos0-cog).Mag(); - for (double dlent=0;dlent<100;dlent+=1.0) - { - TVector3 trkPos = getPosTrk(it,dlent); - //TVector3 trkPos = trkPos0+dlent*trkDir; - for (double dlenc=0;dlenc<100;dlenc+=1.0) - { - TVector3 cluPos = cog + (dlenc*cluDir); - double dist = (cluPos-trkPos).Mag(); - if (dist < distMin) distMin=dist; - } - } -*/ - - - chi2+=distMin/100; - - } - } - - return chi2; -} - -TVector3 getPosTrk(int it, double dlen) -{ - double sinDip = sqrt(1-trkcdip[it]*trkcdip[it]); - double length = (trkZ[it] - trkz0[it])/sinDip + dlen; - double posXTrk = sin(trkphi0[it] + trkomega[it]*trkcdip[it]*length)/trkomega[it] - (trkd0[it] + 1.0/trkomega[it])*sin(trkphi0[it]); - double posYTrk = -cos(trkphi0[it] + trkomega[it]*trkcdip[it]*length)/trkomega[it] + (trkd0[it] + 1.0/trkomega[it])*cos(trkphi0[it]); - double posZtrk = dlen/sinDip; - - return TVector3(posXTrk,posYTrk,posZtrk); -} - - -TVector3 calcCog(int ic, double *par) -{ - - TVector3 aVector(0,0,0); - double sumWeights(0); - - std::vector crystalList = (*cluList)[ic]; - - for (unsigned int il=0;il RatioEcut) weight = par[0]+energy; - break; - - case 1: - if ( eRatio > RatioEcut && (par[0]+energy)>1e-5) weight = sqrt(par[0]+energy); - break; - - case 2: - if ( eRatio > RatioEcut) weight = par[0]+par[1]*log(energy); - break; - - } - if (weight < 0) weight=0; - - - aVector[0] += cryPosX[icry]*weight; - aVector[1] += cryPosY[icry]*weight; - sumWeights += weight; - } - - if (sumWeights>1e-3) { aVector[0] /= sumWeights; aVector[1] /= sumWeights;} - else { aVector[0]=aVector[1]=0;} - - return aVector; -} - -double calcLen(int ic) -{ - - double distMax(0); - double Emin = 1; - - std::vector crystalList = (*cluList)[ic]; - - for (unsigned int i=1;i distMax) distMax = dist; - } - } - return distMax; -} - -bool checkVD(bool wantFace, bool want400, bool wantSide) -{ - int iVD(-1); - for (int iv=0;iv 90) {iVD = iv; break;} - if (iVD==-1) return true; - - bool isFace = vdId[iVD]==73 || vdId[iVD]==75; - bool isInside = vdId[iVD]==77 || vdId[iVD]==79; - bool isDisk0 = vdId[iVD]==73 || vdId[iVD]==77; - - if (wantFace && !isFace) return false; - if (want400 && sqrt(vdPosX[iVD]*vdPosX[iVD]+vdPosY[iVD]*vdPosY[iVD])<400) return false; - if (wantSide && !isInside) return false; - return true; -} - - - - -double fitFun(double *x, double *par) {return par[0]*CBall(x,par);} - - -double CBall(double *x, double *par) { - - double arg = (x[0]-par[1])/fabs(par[2]); - double lim = par[4]; - - if (arg < lim) return PartGau(x,par); - return Tail(x,par); - -} - -double PartGau(double *x, double *par) { - double arg = (x[0]-par[1])/par[2]; - double Gauss = TMath::Exp(-0.5*arg*arg); - return Gauss; -} - -double Tail(double *x, double *par) { - - double arg = (x[0]-par[1])/fabs(par[2]); - double power = 1.0-par[3]; - double abso = par[3]/fabs(par[4]); - double A = pow(abso,par[3])*TMath::Exp(-0.5*par[4]*par[4]); - double B = abso-fabs(par[4]); - double tail = B+arg; - double resu = A*pow(tail,-par[3]); - return resu; -} - - - - - - - - -void setTree() -{ - tree->SetBranchAddress("nMatch", &nMatch); - tree->SetBranchAddress("mTrkId", mTrkId); - tree->SetBranchAddress("mCluId", mCluId); - tree->SetBranchAddress("mChi2", mChi2); - tree->SetBranchAddress("mChi2Pos", mChi2Pos); - tree->SetBranchAddress("mChi2Time", mChi2Time); - - tree->SetBranchAddress("nTrk", &nTrk); - tree->SetBranchAddress("trkX", trkX); - tree->SetBranchAddress("trkY", trkY); - tree->SetBranchAddress("trkZ", trkZ); - tree->SetBranchAddress("trkFFX", trkFFX); - tree->SetBranchAddress("trkFFY", trkFFY); - tree->SetBranchAddress("trkFFZ", trkFFZ); - tree->SetBranchAddress("trkt", trkt); - tree->SetBranchAddress("trke", trke); - tree->SetBranchAddress("trkpX", trkpX); - tree->SetBranchAddress("trkpY", trkpY); - tree->SetBranchAddress("trkpZ", trkpZ); - tree->SetBranchAddress("trknHit", trknHit); - tree->SetBranchAddress("trkStat", trkStat); - tree->SetBranchAddress("trkprob", trkprob); - tree->SetBranchAddress("trkd0", trkd0); - tree->SetBranchAddress("trkz0", trkz0); - tree->SetBranchAddress("trkphi0", trkphi0); - tree->SetBranchAddress("trkomega",trkomega); - tree->SetBranchAddress("trkcdip", trkcdip); - tree->SetBranchAddress("trkdlen", trkdlen); - - tree->SetBranchAddress("nCluster", &nCluster); - tree->SetBranchAddress("cluEnergy", cluEnergy); - tree->SetBranchAddress("cluTime", cluTime); - tree->SetBranchAddress("cluCogX", cluCogX); - tree->SetBranchAddress("cluCogY", cluCogY); - tree->SetBranchAddress("cluCogZ", cluCogZ); - tree->SetBranchAddress("clu2Mom", clu2Mom); - tree->SetBranchAddress("cluE25", cluE25); - tree->SetBranchAddress("cluList", &cluList); - - tree->SetBranchAddress("nCry", &nCry); - tree->SetBranchAddress("cryId", cryId); - tree->SetBranchAddress("crySecId", crySecId); - tree->SetBranchAddress("cryPosX", cryPosX); - tree->SetBranchAddress("cryPosY", cryPosY); - tree->SetBranchAddress("cryPosZ", cryPosZ); - tree->SetBranchAddress("cryEdep", cryEdep); - tree->SetBranchAddress("cryTime", cryTime); - tree->SetBranchAddress("nVd", &nVd); - tree->SetBranchAddress("vdId", vdId); - tree->SetBranchAddress("vdPdgId", vdPdgId); - tree->SetBranchAddress("vdMom", vdMom); - tree->SetBranchAddress("vdMomX", vdMomX); - tree->SetBranchAddress("vdMomY", vdMomY); - tree->SetBranchAddress("vdMomZ", vdMomZ); - tree->SetBranchAddress("vdPosX", vdPosX); - tree->SetBranchAddress("vdPosY", vdPosY); - tree->SetBranchAddress("vdPosZ", vdPosZ); - tree->SetBranchAddress("vdTime", vdTime); -} - - - - - - - -void makeHist() -{ - - gStyle->SetFrameBorderMode(0); - gStyle->SetCanvasBorderMode(0); - gStyle->SetPadBorderMode(0); - gStyle->SetPadColor(0); - gStyle->SetCanvasColor(0); - gStyle->SetStatColor(0); - gStyle->SetTitleFillColor(0); - gStyle->SetOptStat(0); - gStyle->SetHistLineWidth(3); - gStyle->SetLineWidth(2); - gStyle->SetPadLeftMargin(0.12); - gStyle->SetPalette(1); - gStyle->SetFrameLineWidth(2); - gStyle->SetLegendBorderSize(0); - gStyle->SetLegendFillColor(0); - - - _hx = new TH1F("hx","X residual",50,-30,30); - _hy = new TH1F("hy","Y residual",50,-30,30); - _hr = new TH1F("hr","R residual",200,0,2000); - _hxy = new TH1F("hxy","hxy",100,-30,30); - _hxy2 = new TH2F("hxy2","",100,-50.,50.,100,-50.,50.); - _hu2nd = new TH2F("hu2nd","",100,0,200.,100,-50.,50.); - _hv2nd = new TH2F("hv2nd","",100,0,200.,100,-50.,50.); - _huE25 = new TH2F("huE25","",100,0,1.,100,-50.,50.); - _huDist = new TH2F("huDist","",100,0,500.,100,-50.,50.); - _hucDip = new TH2F("hucDip","",100,0,1.,100,-50.,50.); - _huRad = new TH2F("huRad","",100,300,700.,100,-50.,50.); - _prob2d = new TH2F("prob2d","",50,0,1.,50,0.,1.); - - _hu0 = new TH1F("hu0","U residual init",150,-50,50); - _hv0 = new TH1F("hv0","V residual init",150,-50,50); - _hu = new TH1F("hu","U residual",80,-30,50); - _hv = new TH1F("hv","V residual",100,-50,50); - _huc = new TH1F("huc","U residual",150,-50,50); - _hvc = new TH1F("hvc","V residual",150,-50,50); - _ha = new TH1F("ha","Depth",100,0,100); - _hncr = new TH1F("hncr","Ncr",20,0,20); - _prob1 = new TH1F("prob1","Prob",50,0,1); - _prob2 = new TH1F("prob2","Prob",50,0,1); - _chi2prob = new TH1F("chi2prob","Prob",50,0,1); - - - histHelper(_hx,"#DeltaX (mm)"); - histHelper(_hy,"#DeltaY (mm)"); - histHelper(_hr,"R (mm)"); - histHelper(_hu0,"#DeltaU (mm)"); - histHelper(_hv0,"#DeltaV (mm)"); - histHelper(_hu,"#DeltaU (mm)"); - histHelper(_hv,"#DeltaV (mm)"); - - - _hxy2->GetXaxis()->SetTitle("X residual (mm)"); - _hxy2->GetYaxis()->SetTitle("Y residual (mm)"); - _hxy2->GetXaxis()->SetTitleSize(0.045); - _hxy2->GetYaxis()->SetTitleSize(0.045); - - - for (int i=0;i<30;++i)_dedep[i] = buildDisk(Form("Edep%i_a",i),351,660,33.065); - -} - -void histHelper(TH1F* hist,TString title) -{ - hist->GetXaxis()->SetTitle(title); -// hist->GetYaxis()->SetTitle(Form("Entries / %f mm",hist->GetBinWidth(1))); -// hist->GetYaxis()->SetTitleOffset(2); - hist->GetYaxis()->SetLabelSize(0.045); - hist->GetXaxis()->SetLabelSize(0.045); - hist->GetXaxis()->SetTitleSize(0.055); - hist->SetLineWidth(2); - hist->SetLineColor(1); - -} - - -TH2Poly* buildDisk(TString hname, double _radiusIn, double _radiusOut, double _cellSize) -{ - - TH2Poly* _h2p = new TH2Poly(hname,"",-_radiusOut-_cellSize,_radiusOut+_cellSize,-_radiusOut-_cellSize,_radiusOut+_cellSize); - _h2p->SetContour(50); - - int nRings = int(1.5*_radiusOut/_cellSize)+1; - int nHexagons = 1 + 3*nRings*(nRings-1); - - for (int i=0;iAddBin(6, x, y); - } - - return _h2p; -} - -void getXYPosition_disk(int index, double&x, double& y) -{ - - if (index==0) {x=0;y=0;return;} - - int _step_l[6]={0,-1,-1,0,1,1}; - int _step_k[6]={1,1,0,-1,-1,0}; - - int nRing = int(0.5+sqrt(0.25+(float(index)-1.0)/3.0)); - int nSeg = (index -1 -3*nRing*(nRing-1))/nRing; - int nPos = (index -1 -3*nRing*(nRing-1))%nRing; - - int l = nRing+(nPos+1)*_step_l[nSeg]; - int k = -nRing+(nPos+1)*_step_k[nSeg]; - - for (int i=0;i _radiusOut) return false; - } - return true; -} - -double calcDistToSide(TVector2& a, TVector2& b) -{ - double t = -3.0*(b-a)*a; - if (t<0) return a.Mod(); - if (t>1) return b.Mod(); - return (a+t*(b-a)).Mod(); -} diff --git a/TrackCaloMatching/test/TMVAReadExtend.C b/TrackCaloMatching/test/TMVAReadExtend.C deleted file mode 100644 index 3b6cda6a7d..0000000000 --- a/TrackCaloMatching/test/TMVAReadExtend.C +++ /dev/null @@ -1,221 +0,0 @@ -#include -#include -#include -#include - -#include "TChain.h" -#include "TFile.h" -#include "TTree.h" -#include "TString.h" -#include "TObjString.h" -#include "TSystem.h" -#include "TROOT.h" -#include "TMVA/Tools.h" -#include "TMVA/Reader.h" -#include "TVector3.h" - - -using namespace TMVA; - -void TMVAReadExtend(TString testDS, int mode=1) -{ - - if (mode!=1 && mode !=2 && mode!=3 ) {cout<<"Mose must be 1 or 2 or 3"<SetFrameBorderMode(0); - gStyle->SetCanvasBorderMode(0); - gStyle->SetPadBorderMode(0); - gStyle->SetPadColor(0); - gStyle->SetCanvasColor(0); - gStyle->SetStatColor(0); - gStyle->SetTitleFillColor(0); - gStyle->SetOptStat(0); - gStyle->SetHistLineWidth(2); - gStyle->SetLineWidth(2); - gStyle->SetPadLeftMargin(0.12); - gStyle->SetPadBottomMargin(0.12); - gStyle->SetPalette(1); - gStyle->SetFrameLineWidth(2); - - Float_t e0,e1,e2,e3,e4,e5,e6,e7,e8,e9; - Float_t e10,e11,e12,e13,e14,e15,e16,e17,e18,e19; - Float_t e20,e21,e22,e23,e24; - Float_t r0,z0,t0,t1,c0,c1,c2,c3,c4,c5,FFX,FFY,FFZ; - Float_t targetX,targetY,targetA; - - - TMVA::Reader *reader = new TMVA::Reader( "!Color:!Silent" ); - if (mode==3)reader->AddVariable( "e0", &e0); - if (mode==3)reader->AddVariable( "e1", &e1); - reader->AddVariable( "e2", &e2); - reader->AddVariable( "e3", &e3); - reader->AddVariable( "e4", &e4); - reader->AddVariable( "e5", &e5); - reader->AddVariable( "e6", &e6); - reader->AddVariable( "e7", &e7); - reader->AddVariable( "e8", &e8); - reader->AddVariable( "e9", &e9); - reader->AddVariable( "e10", &e10); - reader->AddVariable( "e11", &e11); - reader->AddVariable( "e12", &e12); - reader->AddVariable( "e13", &e13); - reader->AddVariable( "e14", &e14); - reader->AddVariable( "e15", &e15); - reader->AddVariable( "e16", &e16); - reader->AddVariable( "e17", &e17); - reader->AddVariable( "e18", &e18); - reader->AddVariable( "e19", &e19); - reader->AddVariable( "e20", &e20); - reader->AddVariable( "t0", &t0); - reader->AddVariable( "t1", &t1); - reader->AddVariable( "r0", &r0); - reader->AddVariable( "z0", &z0); - reader->AddSpectator( "c0", &c0); - reader->AddSpectator( "c1", &c1); - reader->AddSpectator( "c2", &c2); - reader->AddSpectator( "c3", &c3); - reader->AddSpectator( "c4", &c4); - reader->AddSpectator( "c5", &c5); - reader->AddSpectator( "ffx", &FFX); - reader->AddSpectator( "ffy", &FFY); - reader->AddSpectator( "ffz", &FFZ); - reader->BookMVA("BDTG method", "weightsA/weights/TMVARegression_BDTG.weights.xml" ); - - - - TFile input(testDS); - TTree *regTree = (TTree*)input.Get("TreeReg"); - - regTree->SetBranchAddress( "e0", &e0 ); - regTree->SetBranchAddress( "e1", &e1 ); - regTree->SetBranchAddress( "e2", &e2 ); - regTree->SetBranchAddress( "e3", &e3 ); - regTree->SetBranchAddress( "e4", &e4 ); - regTree->SetBranchAddress( "e5", &e5 ); - regTree->SetBranchAddress( "e6", &e6 ); - regTree->SetBranchAddress( "e7", &e7 ); - regTree->SetBranchAddress( "e8", &e8 ); - regTree->SetBranchAddress( "e9", &e9 ); - regTree->SetBranchAddress( "e10", &e10 ); - regTree->SetBranchAddress( "e11", &e11 ); - regTree->SetBranchAddress( "e12", &e12 ); - regTree->SetBranchAddress( "e13", &e13 ); - regTree->SetBranchAddress( "e14", &e14 ); - regTree->SetBranchAddress( "e15", &e15 ); - regTree->SetBranchAddress( "e16", &e16 ); - regTree->SetBranchAddress( "e17", &e17 ); - regTree->SetBranchAddress( "e18", &e18 ); - regTree->SetBranchAddress( "e19", &e19 ); - regTree->SetBranchAddress( "e20", &e20 ); - regTree->SetBranchAddress( "t0", &t0 ); - regTree->SetBranchAddress( "t1", &t1 ); - regTree->SetBranchAddress( "r0", &r0 ); - regTree->SetBranchAddress( "z0", &z0 ); - regTree->SetBranchAddress( "c0", &c0 ); - regTree->SetBranchAddress( "c1", &c1 ); - regTree->SetBranchAddress( "c2", &c2 ); - regTree->SetBranchAddress( "c3", &c3 ); - regTree->SetBranchAddress( "c4", &c4 ); - regTree->SetBranchAddress( "c5", &c5 ); - regTree->SetBranchAddress( "ffx", &FFX ); - regTree->SetBranchAddress( "ffy", &FFY ); - regTree->SetBranchAddress( "ffz", &FFZ ); - regTree->SetBranchAddress( "targetX", &targetX ); - regTree->SetBranchAddress( "targetY", &targetY ); - regTree->SetBranchAddress( "targetA", &targetA ); - - - TH1F hh1("hh1", "",100,-50,50); - TH1F hh2("hh2", "",100,-50,50); - TH1F hh3("hh3", "",100,-50,50); - - - for (Long64_t ievt=0; ievtGetEntries();ievt++) - { - regTree->GetEntry(ievt); - - Float_t val1 = 100*((reader->EvaluateRegression("BDTG method"))[0]); - - - TVector3 trkDir(sin(t1)*cos(t0),sin(t1)*sin(t0),cos(t1)); - TVector3 pos0(FFX,FFY,FFZ); - - TVector3 pos = pos0+val1*trkDir; - double dx = c2-pos.X(); - double dy = c3-pos.Y(); - - hh1.Fill(dx); - hh2.Fill(dy); - hh3.Fill(val1-targetA); - - //need to add stuff to calculate X ad Y position - - } - - - TLatex text; - text.SetTextSize(0.045); - - - hh1.SetLineWidth(2); - hh1.GetYaxis()->SetTitleOffset(1.2); - hh1.GetXaxis()->SetTitleSize(0.045); - hh1.GetYaxis()->SetTitleSize(0.045); - hh1.GetXaxis()->SetLabelSize(0.04); - hh1.GetYaxis()->SetLabelSize(0.04); - - hh2.SetLineWidth(2); - hh2.GetYaxis()->SetTitleOffset(1.2); - hh2.GetXaxis()->SetTitleSize(0.045); - hh2.GetYaxis()->SetTitleSize(0.045); - hh2.GetXaxis()->SetLabelSize(0.04); - hh2.GetYaxis()->SetLabelSize(0.04); - - TF1 *myfit = new TF1("myfit","gaus(0)+gaus(3)", -40,40); - myfit->SetParameter(0,1000); - myfit->SetParameter(1,0); - myfit->SetParameter(2,8); - myfit->SetParameter(3,100); - myfit->SetParameter(4,0); - myfit->SetParameter(5,20); - - TCanvas *ca1 = new TCanvas("ca1","ca1"); - hh1.Draw(); - hh1.SetLineWidth(2); - hh1.Fit("myfit","","",-40,40); - hh1.GetXaxis()->SetTitle("X_{rec}-X_{gen} (mm)"); - hh1.GetYaxis()->SetTitle("Entries / 2 mm"); - text.DrawLatexNDC(0.17,0.82,Form("#sigma_{core} =%4.2g #pm %2.1g mm",myfit->GetParameter(2),myfit->GetParError(2))); - text.DrawLatexNDC(0.17,0.75,Form("#sigma_{tail} =%4.2g #pm %2.1g mm",myfit->GetParameter(5),myfit->GetParError(5))); - ca1->SaveAs("cluAX.pdf"); - cout<GetParameter(5)<SetTitle("Y_{rec}-Y_{gen} (mm)"); - hh2.GetYaxis()->SetTitle("Entries / 2 mm"); - text.DrawLatexNDC(0.17,0.82,Form("#sigma_{core} =%4.2g #pm %2.1g mm",myfit->GetParameter(2),myfit->GetParError(2))); - text.DrawLatexNDC(0.17,0.75,Form("#sigma_{tail} =%4.2g #pm %2.1g mm",myfit->GetParameter(5),myfit->GetParError(5))); - ca1->SaveAs("cluAY.pdf"); - cout<GetParameter(5)< -#include -#include -#include - -#include "TChain.h" -#include "TFile.h" -#include "TTree.h" -#include "TString.h" -#include "TObjString.h" -#include "TSystem.h" -#include "TROOT.h" -#include "TMVA/Tools.h" -#include "TMVA/Reader.h" - - -using namespace TMVA; - -void TMVAReadRegress(TString testDS, int mode=1) -{ - - if (mode!=1 && mode !=2 && mode!=3 ) {cout<<"Mose must be 1 or 2 or 3"<SetFrameBorderMode(0); - gStyle->SetCanvasBorderMode(0); - gStyle->SetPadBorderMode(0); - gStyle->SetPadColor(0); - gStyle->SetCanvasColor(0); - gStyle->SetStatColor(0); - gStyle->SetTitleFillColor(0); - gStyle->SetOptStat(0); - gStyle->SetHistLineWidth(2); - gStyle->SetLineWidth(2); - gStyle->SetPadLeftMargin(0.12); - gStyle->SetPadBottomMargin(0.12); - gStyle->SetPalette(1); - gStyle->SetFrameLineWidth(2); - - Float_t e0,e1,e2,e3,e4,e5,e6,e7,e8,e9; - Float_t e10,e11,e12,e13,e14,e15,e16,e17,e18,e19; - Float_t e20,e21,e22,e23,e24; - Float_t r0,z0,t0,t1,ip0,ip1,c0,c1,c2,c3,c4,c5,FFX,FFY,FFZ,vdx,vdy,vdz; - Float_t targetX,targetY; - - - TMVA::Reader *reader = new TMVA::Reader( "!Color:!Silent" ); - if (mode==3)reader->AddVariable( "e0", &e0); - if (mode==3)reader->AddVariable( "e1", &e1); - reader->AddVariable( "e2", &e2); - reader->AddVariable( "e3", &e3); - reader->AddVariable( "e4", &e4); - reader->AddVariable( "e5", &e5); - reader->AddVariable( "e6", &e6); - reader->AddVariable( "e7", &e7); - reader->AddVariable( "e8", &e8); - reader->AddVariable( "e9", &e9); - reader->AddVariable( "e10", &e10); - reader->AddVariable( "e11", &e11); - reader->AddVariable( "e12", &e12); - reader->AddVariable( "e13", &e13); - reader->AddVariable( "e14", &e14); - reader->AddVariable( "e15", &e15); - reader->AddVariable( "e16", &e16); - reader->AddVariable( "e17", &e17); - reader->AddVariable( "e18", &e18); - reader->AddVariable( "e19", &e19); - if (mode!=3) reader->AddVariable( "e20", &e20); - reader->AddVariable( "t0", &t0); - reader->AddVariable( "t1", &t1); - reader->AddVariable( "r0", &r0); - reader->AddVariable( "z0", &z0); - //reader->AddVariable( "ip0", &ip0); - //reader->AddVariable( "ip1", &ip1); - reader->AddSpectator( "c0", &c0); - reader->AddSpectator( "c1", &c1); - reader->AddSpectator( "c2", &c2); - reader->AddSpectator( "c3", &c3); - reader->AddSpectator( "c4", &c4); - reader->AddSpectator( "c5", &c5); - reader->AddSpectator( "ffx", &FFX); - reader->AddSpectator( "ffy", &FFY); - reader->AddSpectator( "ffz", &FFZ); - reader->AddSpectator( "vdx", &vdx); - reader->AddSpectator( "vdy", &vdy); - reader->AddSpectator( "vdz", &vdz); - reader->BookMVA("BDTG method", "weightsX/weights/TMVARegression_BDTG.weights.xml" ); - - TMVA::Reader *reader2 = new TMVA::Reader( "!Color:!Silent" ); - if (mode==3) reader2->AddVariable( "e0", &e0); - if (mode==3) reader2->AddVariable( "e1", &e1); - reader2->AddVariable( "e2", &e2); - reader2->AddVariable( "e3", &e3); - reader2->AddVariable( "e4", &e4); - reader2->AddVariable( "e5", &e5); - reader2->AddVariable( "e6", &e6); - reader2->AddVariable( "e7", &e7); - reader2->AddVariable( "e8", &e8); - reader2->AddVariable( "e9", &e9); - reader2->AddVariable( "e10", &e10); - reader2->AddVariable( "e11", &e11); - reader2->AddVariable( "e12", &e12); - reader2->AddVariable( "e13", &e13); - reader2->AddVariable( "e14", &e14); - reader2->AddVariable( "e15", &e15); - reader2->AddVariable( "e16", &e16); - reader2->AddVariable( "e17", &e17); - reader2->AddVariable( "e18", &e18); - reader2->AddVariable( "e19", &e19); - if (mode!=3) reader2->AddVariable( "e20", &e20); - reader2->AddVariable( "t0", &t0); - reader2->AddVariable( "t1", &t1); - reader2->AddVariable( "r0", &r0); - reader2->AddVariable( "z0", &z0); - //reader2->AddVariable( "ip0", &ip0); - //reader2->AddVariable( "ip1", &ip1); - reader2->AddSpectator( "c0", &c0); - reader2->AddSpectator( "c1", &c1); - reader2->AddSpectator( "c2", &c2); - reader2->AddSpectator( "c3", &c3); - reader2->AddSpectator( "c4", &c4); - reader2->AddSpectator( "c5", &c5); - reader2->AddSpectator( "ffx", &FFX); - reader2->AddSpectator( "ffy", &FFY); - reader2->AddSpectator( "ffz", &FFZ); - reader2->AddSpectator( "vdx", &vdx); - reader2->AddSpectator( "vdy", &vdy); - reader2->AddSpectator( "vdz", &vdz); - reader2->BookMVA("BDTG method", "weightsY/weights/TMVARegression_BDTG.weights.xml" ); - - - - TFile input(testDS); - TTree *regTree = (TTree*)input.Get("TreeReg"); - - regTree->SetBranchAddress( "e0", &e0 ); - regTree->SetBranchAddress( "e1", &e1 ); - - regTree->SetBranchAddress( "e2", &e2 ); - regTree->SetBranchAddress( "e3", &e3 ); - regTree->SetBranchAddress( "e4", &e4 ); - regTree->SetBranchAddress( "e5", &e5 ); - regTree->SetBranchAddress( "e6", &e6 ); - regTree->SetBranchAddress( "e7", &e7 ); - regTree->SetBranchAddress( "e8", &e8 ); - regTree->SetBranchAddress( "e9", &e9 ); - regTree->SetBranchAddress( "e10", &e10 ); - regTree->SetBranchAddress( "e11", &e11 ); - regTree->SetBranchAddress( "e12", &e12 ); - regTree->SetBranchAddress( "e13", &e13 ); - regTree->SetBranchAddress( "e14", &e14 ); - regTree->SetBranchAddress( "e15", &e15 ); - regTree->SetBranchAddress( "e16", &e16 ); - regTree->SetBranchAddress( "e17", &e17 ); - regTree->SetBranchAddress( "e18", &e18 ); - regTree->SetBranchAddress( "e19", &e19 ); - regTree->SetBranchAddress( "e20", &e20 ); - regTree->SetBranchAddress( "t0", &t0 ); - regTree->SetBranchAddress( "t1", &t1 ); - regTree->SetBranchAddress( "r0", &r0 ); - regTree->SetBranchAddress( "z0", &z0 ); - regTree->SetBranchAddress( "ip0", &ip0 ); - regTree->SetBranchAddress( "ip1", &ip1 ); - regTree->SetBranchAddress( "c0", &c0 ); - regTree->SetBranchAddress( "c1", &c1 ); - regTree->SetBranchAddress( "c2", &c2 ); - regTree->SetBranchAddress( "c3", &c3 ); - regTree->SetBranchAddress( "c4", &c4 ); - regTree->SetBranchAddress( "c5", &c5 ); - regTree->SetBranchAddress( "ffx", &FFX ); - regTree->SetBranchAddress( "ffy", &FFY ); - regTree->SetBranchAddress( "ffz", &FFZ ); - regTree->SetBranchAddress( "vdx", &vdx ); - regTree->SetBranchAddress( "vdy", &vdy ); - regTree->SetBranchAddress( "vdz", &vdz ); - regTree->SetBranchAddress( "targetX", &targetX ); - regTree->SetBranchAddress( "targetY", &targetY ); - - - TH1F hh1("hh1", "",100,-50,50); - TH1F hh2("hh2","",100,-50,50); - TH2F hh3("hh3","hh4",200,-50,50,200,-50,50); - - TH1F hh4("hh4", "",100,-50,50); - TH1F hh5("hh5","",100,-50,50); - TH2F hh6("hh6","hh8",200,-50,50,200,-50,50); - - - - - for (Long64_t ievt=0; ievtGetEntries();ievt++){ - regTree->GetEntry(ievt); - - Float_t val1 = (reader->EvaluateRegression("BDTG method"))[0]; - Float_t val2 = (reader2->EvaluateRegression("BDTG method"))[0]; - - //cout<SetTitleOffset(1.2); - hh1.GetXaxis()->SetTitleSize(0.045); - hh1.GetYaxis()->SetTitleSize(0.045); - hh1.GetXaxis()->SetLabelSize(0.04); - hh1.GetYaxis()->SetLabelSize(0.04); - - hh2.SetLineWidth(2); - hh2.GetYaxis()->SetTitleOffset(1.2); - hh2.GetXaxis()->SetTitleSize(0.045); - hh2.GetYaxis()->SetTitleSize(0.045); - hh2.GetXaxis()->SetLabelSize(0.04); - hh2.GetYaxis()->SetLabelSize(0.04); - - TF1 *myfit = new TF1("myfit","gaus(0)+gaus(3)", -40,40); - myfit->SetParameter(0,1000); - myfit->SetParameter(1,0); - myfit->SetParameter(2,8); - myfit->SetParameter(3,100); - myfit->SetParameter(4,0); - myfit->SetParameter(5,30); - - TCanvas *ca1 = new TCanvas("ca1","ca1"); - hh1.Draw(); - hh1.SetLineWidth(2); - hh1.Fit("myfit","","",-40,40); - hh1.GetXaxis()->SetTitle("X_{rec}-X_{gen} (mm)"); - hh1.GetYaxis()->SetTitle("Entries / 1 mm"); - text.DrawLatexNDC(0.17,0.82,Form("#sigma_{core} =%4.2g #pm %2.1g mm",myfit->GetParameter(2),myfit->GetParError(2))); - text.DrawLatexNDC(0.17,0.75,Form("#sigma_{tail} =%4.2g #pm %2.1g mm",myfit->GetParameter(5),myfit->GetParError(5))); - text.DrawLatexNDC(0.17,0.68,Form("frac = %4.3g ",myfit->GetParameter(3)/myfit->GetParameter(0))); - ca1->SaveAs("plots/cluX.pdf"); - cout<GetParameter(5)<SetTitle("Y_{rec}-Y_{gen} (mm)"); - hh2.GetYaxis()->SetTitle("Entries / 1 mm"); - text.DrawLatexNDC(0.17,0.82,Form("#sigma_{core} =%4.2g #pm %2.1g mm",myfit->GetParameter(2),myfit->GetParError(2))); - text.DrawLatexNDC(0.17,0.75,Form("#sigma_{tail} =%4.2g #pm %2.1g mm",myfit->GetParameter(5),myfit->GetParError(5))); - text.DrawLatexNDC(0.17,0.68,Form("frac = %4.3g ",myfit->GetParameter(3)/myfit->GetParameter(0))); - ca1->SaveAs("plots/cluY.pdf"); - cout<GetParameter(5)<SetTitle("U_{rec}-U_{gen} (mm)"); - hh4.GetYaxis()->SetTitle("Entries / 1 mm"); - text.DrawLatexNDC(0.17,0.82,Form("#sigma_{core} =%4.2g #pm %2.1g mm",myfit->GetParameter(2),myfit->GetParError(2))); - text.DrawLatexNDC(0.17,0.75,Form("#sigma_{tail} =%4.2g #pm %2.1g mm",myfit->GetParameter(5),myfit->GetParError(5))); - text.DrawLatexNDC(0.17,0.68,Form("frac = %4.3g ",myfit->GetParameter(3)/myfit->GetParameter(0))); - ca1->SaveAs("plots/cluU.pdf"); - cout<SetTitle("V_{rec}-V_{gen} (mm)"); - hh5.GetYaxis()->SetTitle("Entries / 1 mm"); - text.DrawLatexNDC(0.17,0.82,Form("#sigma_{core} =%4.2g #pm %2.1g mm",myfit->GetParameter(2),myfit->GetParError(2))); - text.DrawLatexNDC(0.17,0.75,Form("#sigma_{tail} =%4.2g #pm %2.1g mm",myfit->GetParameter(5),myfit->GetParError(5))); - text.DrawLatexNDC(0.17,0.68,Form("frac = %4.3g ",myfit->GetParameter(3)/myfit->GetParameter(0))); - ca1->SaveAs("plots/cluV.pdf"); - cout< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TrackCaloMatching/test/TMVARegression_BDTGAMu.weights.xml b/TrackCaloMatching/test/TMVARegression_BDTGAMu.weights.xml deleted file mode 100644 index ae8230095b..0000000000 --- a/TrackCaloMatching/test/TMVARegression_BDTGAMu.weights.xml +++ /dev/null @@ -1,3779 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TrackCaloMatching/test/TMVARegression_BDTGXEl.weights.xml b/TrackCaloMatching/test/TMVARegression_BDTGXEl.weights.xml deleted file mode 100644 index c38ae6d1d7..0000000000 --- a/TrackCaloMatching/test/TMVARegression_BDTGXEl.weights.xml +++ /dev/null @@ -1,4228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TrackCaloMatching/test/TMVARegression_BDTGXMu.weights.xml b/TrackCaloMatching/test/TMVARegression_BDTGXMu.weights.xml deleted file mode 100644 index e42d07fa39..0000000000 --- a/TrackCaloMatching/test/TMVARegression_BDTGXMu.weights.xml +++ /dev/null @@ -1,4174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TrackCaloMatching/test/TMVARegression_BDTGYEl.weights.xml b/TrackCaloMatching/test/TMVARegression_BDTGYEl.weights.xml deleted file mode 100644 index 2818b1b16c..0000000000 --- a/TrackCaloMatching/test/TMVARegression_BDTGYEl.weights.xml +++ /dev/null @@ -1,4219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TrackCaloMatching/test/TMVARegression_BDTGYMu.weights.xml b/TrackCaloMatching/test/TMVARegression_BDTGYMu.weights.xml deleted file mode 100644 index 760aa4d91d..0000000000 --- a/TrackCaloMatching/test/TMVARegression_BDTGYMu.weights.xml +++ /dev/null @@ -1,4018 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TrackCaloMatching/test/TMVAWriteRegress.C b/TrackCaloMatching/test/TMVAWriteRegress.C deleted file mode 100644 index 06bfd97a77..0000000000 --- a/TrackCaloMatching/test/TMVAWriteRegress.C +++ /dev/null @@ -1,139 +0,0 @@ -#include -#include -#include -#include - -#include "TChain.h" -#include "TFile.h" -#include "TTree.h" -#include "TString.h" -#include "TObjString.h" -#include "TSystem.h" -#include "TROOT.h" - -#include "TMVA/Tools.h" -#include "TMVA/Reader.h" - -using namespace TMVA; - - - -void TMVAWriteRegress(int choice, TString trainDS, int mode=1, bool noSpectator=0) -{ - - if (choice!=1 && choice !=2&& choice !=3) {cout<<"Choice must be 1 or 2 or 3"<AddVariable( "e0", "Energy cell 0", "MeV", 'F' ); - if (mode==3) dataloader->AddVariable( "e1", "Energy cell 1", "MeV", 'F' ); - dataloader->AddVariable( "e2", "Energy cell 2", "MeV", 'F' ); - dataloader->AddVariable( "e3", "Energy cell 3", "MeV", 'F' ); - dataloader->AddVariable( "e4", "Energy cell 4", "MeV", 'F' ); - dataloader->AddVariable( "e5", "Energy cell 5", "MeV", 'F' ); - dataloader->AddVariable( "e6", "Energy cell 6", "MeV", 'F' ); - dataloader->AddVariable( "e7", "Energy cell 7", "MeV", 'F' ); - dataloader->AddVariable( "e8", "Energy cell 8", "MeV", 'F' ); - dataloader->AddVariable( "e9", "Energy cell 9", "MeV", 'F' ); - dataloader->AddVariable( "e10", "Energy cell 10", "MeV", 'F' ); - dataloader->AddVariable( "e11", "Energy cell 11", "MeV", 'F' ); - dataloader->AddVariable( "e12", "Energy cell 12", "MeV", 'F' ); - dataloader->AddVariable( "e13", "Energy cell 13", "MeV", 'F' ); - dataloader->AddVariable( "e14", "Energy cell 14", "MeV", 'F' ); - dataloader->AddVariable( "e15", "Energy cell 15", "MeV", 'F' ); - dataloader->AddVariable( "e16", "Energy cell 16", "MeV", 'F' ); - dataloader->AddVariable( "e17", "Energy cell 17", "MeV", 'F' ); - dataloader->AddVariable( "e18", "Energy cell 18", "MeV", 'F' ); - dataloader->AddVariable( "e19", "Energy cell 19", "MeV", 'F' ); - if (mode!=3)dataloader->AddVariable( "e20", "Energy cell 20", "MeV", 'F' ); - - dataloader->AddVariable( "t0","vdPhi", "", 'F' ); - dataloader->AddVariable( "t1","vdTheta", "", 'F' ); - dataloader->AddVariable( "r0","r0", "", 'F' ); - dataloader->AddVariable( "z0","z0", "", 'F' ); - //dataloader->AddVariable( "ip0","ip0", "", 'F' ); - //dataloader->AddVariable( "ip1","ip1", "", 'F' ); - - - if (!noSpectator) - { - // You can add so-called "Spectator variables", which are not used in the MVA training, - dataloader->AddSpectator( "c0", "c0", "mm", 'F' ); - dataloader->AddSpectator( "c1", "c1", "mm", 'F' ); - dataloader->AddSpectator( "c2", "c2", "mm", 'F' ); - dataloader->AddSpectator( "c3", "c3", "mm", 'F' ); - dataloader->AddSpectator( "c4", "c4", "mm", 'F' ); - dataloader->AddSpectator( "c5", "c5", "mm", 'F' ); - dataloader->AddSpectator( "ffx", "ffx", "mm", 'F' ); - dataloader->AddSpectator( "ffy", "ffy", "mm", 'F' ); - dataloader->AddSpectator( "ffz", "ffz", "mm", 'F' ); - dataloader->AddSpectator( "vdx", "vdx", "mm", 'F' ); - dataloader->AddSpectator( "vdy", "vdy", "mm", 'F' ); - dataloader->AddSpectator( "vdz", "vdz", "mm", 'F' ); - } - - // Add the variable carrying the regression target - if (choice==1) dataloader->AddTarget( "targetX" ); - if (choice==2) dataloader->AddTarget( "targetY" ); - if (choice==3) dataloader->AddTarget( "targetA" ); - - - - // --- Register the regression tree - TFile input(trainDS); - TTree *regTree = (TTree*)input.Get("TreeReg"); - - - // You can add an arbitrary number of regression trees - dataloader->AddRegressionTree( regTree, 1.0 ); - - - // Apply additional cuts on the signal and background samples (can be different) - TCut mycut = ""; //"target>0&&target<2"; - - - // tell the factory to use all remaining events in the trees after training for testing: - dataloader->PrepareTrainingAndTestTree( mycut, "nTrain_Regression=0:nTest_Regression=0:SplitMode=Random:NormMode=NumEvents:!V" ); - - - //linear regression - //factory->BookMethod( dataloader, TMVA::Types::kLD, "LD", "!H:!V:VarTransform=None" ); - - //MLP - //factory->BookMethod( dataloader, TMVA::Types::kMLP, "MLP","!H:!V:VarTransform=Norm:NeuronType=tanh:NCycles=100:HiddenLayers=N+10:TestRate=6:TrainingMethod=BFGS:Sampling=0.3:SamplingEpoch=0.8:ConvergenceImprove=1e-6:ConvergenceTests=15:!UseRegulator" ); - - //svm - //factory->BookMethod( dataloader, TMVA::Types::kSVM, "SVM", "Gamma=0.25:Tol=0.001:VarTransform=Norm" ); - - - // Boosted Decision Trees - //factory->BookMethod( dataloader, TMVA::Types::kBDT, "BDT","!H:!V:NTrees=100:MinNodeSize=1.0%:BoostType=AdaBoostR2:SeparationType=RegressionVariance:nCuts=20:PruneMethod=CostComplexity:PruneStrength=30" ); - - //decorrelated BDT - factory->BookMethod(dataloader, TMVA::Types::kBDT, "BDTG","!H:!V:NTrees=100::BoostType=Grad:Shrinkage=0.1:UseBaggedBoost:BaggedSampleFraction=0.8:nCuts=40:MaxDepth=4"); - // -------------------------------------------------------------------------------------------------- - - - factory->TrainAllMethods(); - factory->TestAllMethods(); - factory->EvaluateAllMethods(); - - outputFile->Close(); - - delete factory; - delete dataloader; -} diff --git a/TrackCaloMatching/test/caloMatching.fcl b/TrackCaloMatching/test/caloMatching.fcl deleted file mode 100644 index be825f8381..0000000000 --- a/TrackCaloMatching/test/caloMatching.fcl +++ /dev/null @@ -1,144 +0,0 @@ -# - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -# Give this job a name. -process_name : Matching - -# Start form an empty source -source : -{ - module_type : EmptyEvent - maxEvents : -1 -} - -services : -{ - message : @local::default_message - - TFileService : { fileName : "caloMatching.root" } - - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - - BTrkHelper : @local::BTrkHelperDefault - - Mu2eG4Helper : { } - - SeedService : @local::automaticSeeds - -} - -physics : -{ - producers: - { - - # Generate the event - generate: @local::generate - - # Run G4 and add hits to the event - g4run : @local::g4run - - # Form StrawHits (SH). - makeSH : @local::makeSH - - # test module for Kalman fit: the - - @table::CaloDigiMC.producers - @table::CaloReco.producers - @table::CaloCluster.producers - - makeCaloCluster: - - TrkPatRec : @local::TrkPatRec - - - TrkExtrapol : - { - module_type : TrkExtrapol - fitterModuleLabel : TrkPatRec - diagLevel : 1 - maxNumberStoresPoints : 2 - # MC truth finder, analyzer configuration - KalFitMC : - { - } - - } - - # CaloMatching : - # { - # module_type : CaloMatching - # fitterModuleLabel : TrkPatRec - # diagLevel : 1 - # outPutNtup : 0 - # caloClusterModuleLabel : makeCaloCluster - # caloClusterAlgorithm : closest - # caloClusterSeeding : energy - # trkToCaloExtrapolModuleLabel : TrkExtrapol - # } - - } - analyzers : { - - eventdisplay: - { - module_type : EventDisplay - g4ModuleLabel : "g4run" - } - - } - - p1 : [generate - , g4run - , makeSH - , @sequence::CaloDigiMC.DigiSim - , @sequence::CaloReco.Reco - , @sequence::CaloCluster.Reco - , TrkPatRec - , TrkExtrapol - # , CaloMatching - ] - e1 : [outfile] - - trigger_paths : [p1] - end_paths : [e1] - -} - -outputs: -{ - # Define the output file. - outfile : - { - module_type : RootOutput - fileName : "data_caloMatching.root" - outputCommands : ['keep *_*_*_*' - # , 'drop mu2ePointTrajectoryMapVector_*_*_*' - # , 'drop mu2eSimParticles_*_*_*' - # Uncomment the above line to reduce file size. - ] - } -} - -# Override some of the default values. -#physics.producers.generate.inputfile : "Scripts/genconfig_Conversion.txt" -physics.producers.generate.inputfile : "Offline/CaloCluster/test/genconfig_giani.txt" -#services.GeometryService.inputFile : "Scripts/geom_nohp.txt" -services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common.txt" -physics.producers.makeSH.diagLevel : 0 -physics.producers.makeSH.maxFullPrint : 2 -source.firstRun : 1 -services.SeedService.baseSeed : 1 -services.SeedService.maxUniqueEngines : 20 -physics.producers.KalFitTest.KalFit.RemoveFailedFits : false -physics.producers.KalFitTest.KalFitMC.pureHits : false -# diff --git a/TrackCaloMatching/test/doTrainTestProd b/TrackCaloMatching/test/doTrainTestProd deleted file mode 100644 index 849622f454..0000000000 --- a/TrackCaloMatching/test/doTrainTestProd +++ /dev/null @@ -1,20 +0,0 @@ -# do not forget to change the mode in AnalysisBaseMatch.C -root -b Run.C -q - - -root -b 'TMVAWriteRegress.C(1,"dataMu2e/ElTrain.root",3,1)' -q -root -b 'TMVAWriteRegress.C(2,"dataMu2e/ElTrain.root",3,1)' -q -cp weightsX/weights/TMVARegression_BDTG.weights.xml ../../Offline/TrackCaloMatching/test/TMVARegression_BDTGXEl.weights.xml -cp weightsY/weights/TMVARegression_BDTG.weights.xml ../../Offline/TrackCaloMatching/test/TMVARegression_BDTGYEl.weights.xml - -root -b 'TMVAWriteRegress.C(1,"dataMu2e/MuTrain.root",3,1)' -q -root -b 'TMVAWriteRegress.C(2,"dataMu2e/MuTrain.root",3,1)' -q -cp weightsX/weights/TMVARegression_BDTG.weights.xml ../../Offline/TrackCaloMatching/test/TMVARegression_BDTGXMu.weights.xml -cp weightsY/weights/TMVARegression_BDTG.weights.xml ../../Offline/TrackCaloMatching/test/TMVARegression_BDTGYMu.weights.xml - - -root -b 'TMVAWriteRegress.C(3,"dataMu2e/ElTrain.root",3,1)' -q -cp weightsA/weights/TMVARegression_BDTG.weights.xml ../../Offline/TrackCaloMatching/test/TMVARegression_BDTGAEl.weights.xml - -root -b 'TMVAWriteRegress.C(3,"dataMu2e/MuTrain.root",3,1)' -q -cp weightsA/weights/TMVARegression_BDTG.weights.xml ../../Offline/TrackCaloMatching/test/TMVARegression_BDTGAMu.weights.xml diff --git a/TrackCaloMatching/test/producers.fcl b/TrackCaloMatching/test/producers.fcl deleted file mode 100644 index 7c68789443..0000000000 --- a/TrackCaloMatching/test/producers.fcl +++ /dev/null @@ -1,45 +0,0 @@ -# -*- mode: tcl -*- -BEGIN_PROLOG - -TrkExtrapol : { - module_type : TrkExtrapol - diagLevel : 0 - fitterModuleLabel : TrkPatRec - maxNumberStoresPoints : 1 - # MC truth finder, analyzer configuration - KalFitMC : { - } -} - -CaloMatching : { - module_type : CaloMatching - diagLevel : 0 - fitterModuleLabel : TrkPatRec - trkToCaloExtrapolModuleLabel : TrkExtrapol - caloClusterModuleLabel : MakeCaloCluster - outPutNtup : 0 - caloClusterAlgorithm : closest - caloClusterSeeding : energy -} - -TrackCaloMatching : { - module_type : TrackCaloMatching - diagLevel : 0 - minClusterEnergy : 10. # MeV - maxDeltaT : 20. # ns -#------------------------------------------------------------------------------ -# not a guess any more, but the number by Alex -# 2014-08-08: set dtOffset to 1.4 to avoid DT corrections in other places -#------------------------------------------------------------------------------ - meanInteractionDepth : 59. # mm -# dtOffset : 1.4 # ns - dtOffset : @local::TrackCaloMatchingDtOffset # ns - fitterModuleLabel : TrkPatRec - trkToCaloExtrapolModuleLabel : TrkExtrapol - caloClusterModuleLabel : MakeCaloCluster - outPutNtup : 0 - caloClusterAlgorithm : closest - caloClusterSeeding : energy -} - -END_PROLOG diff --git a/TrackCaloMatching/test/readCaloMatching.fcl b/TrackCaloMatching/test/readCaloMatching.fcl deleted file mode 100644 index 7036ff1ca6..0000000000 --- a/TrackCaloMatching/test/readCaloMatching.fcl +++ /dev/null @@ -1,232 +0,0 @@ -# - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -# Give this job a name. -process_name : DiskCaloMatching - -# Start form an empty source -source : -{ - module_type : EmptyEvent - module_type: RootInput - # maxEvents : -1 - fileNames : ["BkgInput.root"] -} - -services : -{ - message : @local::default_message - - TFileService : { fileName : "readCaloMatching_disk_test.root" } - - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - - BTrkHelper : @local::BTrkHelperDefault - - Mu2eG4Helper : { } - - SeedService : @local::automaticSeeds - -} - -physics : -{ - producers: - { - - # Generate the event - generate: @local::generate - - # Run G4 and add hits to the event - g4run : @local::g4run - - # Form StrawHits (SH). - makeSH : @local::makeSH - - FSHPreStereo: @local::FSHPreStereo - - MakeStereoHits : @local::MakeStereoHits - FlagStrawHits : @local::FlagStrawHits - FlagBkgHits : @local::FlagBkgHits - - # test module for Kalman fit: the - - # Form CaloHits (APD hits) - CaloReadoutHitsMaker : @local::MakeCaloReadoutHits - - # Form CaloCrystalHits (reconstruct crystals from APDs) - CaloCrystalHitsMaker : @local::CaloCrystalHitsMaker - - TrkPatRec : @local::TrkPatRec - - makeCaloCluster: - { - module_type : MakeCaloCluster - diagLevel : 0 - generatorModuleLabel : generate - caloCrystalModuleLabel : CaloCrystalHitsMaker - g4ModuleLabel : g4run - #caloReadoutModuleLabel : CaloReadoutHitsMaker - caloClusterAlgorithm : closest - caloClusterSeeding : energy - #caloClusterSeeding : time - deltaTime : 100.0 #ns - nCryPerCrystal : 1 - EnoiseCut : 0.00 #MeV - EclusterCut : 0.00 #MeV - maxFullPrint : 201 - } - TrkExtrapol : - { - module_type : TrkExtrapol - diagLevel : 0 - outPutNtup : 1 - fitterModuleLabel : TrkPatRec - # MC truth finder, analyzer configuration - KalFitMC : - { - } - - } - - - CaloMatching : - { - module_type : CaloMatching - fitterModuleLabel : TrkPatRec - diagLevel : 0 - outPutNtup : 1 - caloClusterModuleLabel : makeCaloCluster - caloClusterAlgorithm : closest - caloClusterSeeding : energy - trkToCaloExtrapolModuleLabel : TrkExtrapol - # MC truth finder, analyzer configuration - - - } - - - extractElData: - { - module_type : ExtractElectronsData - generatorModuleLabel : generate - g4ModuleLabel : g4run - makerModuleLabel : makeSH - #trackerStepPoints : tracker - #minEnergyDep : 0.0001 - #minHits : 5 - #doDisplay : true - #clickToAdvance : false - } - } - - filters: - { - #Look at the bad events from G4. - skipBadEvents: - { - module_type : KilledEventFilter - g4ModuleLabel : g4run - } - } - - - analyzers : { - - readfits : { - module_type : ReadKalFits - fitterModuleLabel : TrkPatRec - WeightEvents : false - KalFitMC : { } - verbosity : 2 - maxPrint : 200 - } - checkhitsEff: - { - module_type : ReadCaloMatching - fitterModuleLabel : TrkPatRec - diagLevel : 1 - qualityCuts : 2 - generatorModuleLabel : generate - g4ModuleLabel : g4run - makerModuleLabel : makeSH - caloReadoutModuleLabel : CaloReadoutHitsMaker - caloCrystalModuleLabel : CaloCrystalHitsMaker - caloClusterModuleLabel : makeCaloCluster - trkToCaloExtrapolModuleLabel : TrkExtrapol - trkCaloMatchingModuleLabel : CaloMatching - elextractModuleLabel : extractElData - maxFullPrint : 201 - } - - } - - p1 : [generate - , g4run - , makeSH - , CaloReadoutHitsMaker - , CaloCrystalHitsMaker - , makeCaloCluster - # , TrkPatRec - # , TrkExtrapol - # , CaloMatching - # , extractElData - # , skipBadEvents - ] - p2 : [ FSHPreStereo - , MakeStereoHits - , FlagStrawHits - , FlagBkgHits - , TrkPatRec - , TrkExtrapol - , CaloMatching - #, extractElData - ] - - e1 : [readfits - #,checkhitsEff - # outfile - ] - - trigger_paths : [p2] - end_paths : [e1] - -} - -outputs: -{ - # Define the output file. - outfile : - { - module_type : RootOutput - fileName : "data_disck_conv.root" - outputCommands : ['keep *_*_*_*' - # , 'drop mu2ePointTrajectoryMapVector_*_*_*' - # , 'drop mu2eSimParticles_*_*_*' - # Uncomment the above line to reduce file size. - ] - } -} - -# Override some of the default values. -#physics.producers.generate.inputfile : "Scripts/genconfig_Conversion.txt" -physics.producers.generate.inputfile : "Offline/Mu2eG4/test/genconfig_01.txt" -#services.GeometryService.inputFile : "Scripts/geom_nohp.txt" -services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common.txt" -physics.producers.makeSH.diagLevel : 0 -physics.producers.makeSH.maxFullPrint : 2 -source.firstRun : 1 -services.SeedService.baseSeed : 1 -services.SeedService.maxUniqueEngines : 20 -physics.producers.KalFitTest.KalFit.RemoveFailedFits : false -physics.producers.KalFitTest.KalFitMC.pureHits : false -# diff --git a/TrackCaloMatching/test/readExtrapol.fcl b/TrackCaloMatching/test/readExtrapol.fcl deleted file mode 100644 index c7b0a14ff1..0000000000 --- a/TrackCaloMatching/test/readExtrapol.fcl +++ /dev/null @@ -1,157 +0,0 @@ -# - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -# Give this job a name. -process_name : readExtrapol - -# Start form an empty source -source : -{ - module_type : EmptyEvent - # module_type: RootInput - maxEvents : -1 - #fileNames : ["BkgInput.root"] -} - -services : -{ - message : @local::default_message - - TFileService : { fileName : "readExtrapol.root" } - - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - - BTrkHelper : @local::BTrkHelperDefault - - Mu2eG4Helper : { } - - SeedService : @local::automaticSeeds - -} - -physics : -{ - producers: - { - - # Generate the event - generate: @local::generate - - # Run G4 and add hits to the event - g4run : @local::g4run - - # Form StrawHits (SH). - makeSH : @local::makeSH - - # test module for Kalman fit: the - - # Form CaloHits (APD hits) - CaloReadoutHitsMaker : @local::MakeCaloReadoutHits - - # Form CaloCrystalHits (reconstruct crystals from APDs) - CaloCrystalHitsMaker : @local::CaloCrystalHitsMaker - - TrkPatRec : @local::TrkPatRec - - - TrkExtrapol : - { - module_type : TrkExtrapol - fitterModuleLabel : TrkPatRec - # MC truth finder, analyzer configuration - KalFitMC : - { - } - - } - - extractElData: - { - module_type : ExtractElectronsData - generatorModuleLabel : generate - g4ModuleLabel : g4run - makerModuleLabel : makeSH - #trackerStepPoints : tracker - #minEnergyDep : 0.0001 - #minHits : 5 - #doDisplay : true - #clickToAdvance : false - } - } - - filters: - { - #Look at the bad events from G4. - skipBadEvents: - { - module_type : KilledEventFilter - g4ModuleLabel : g4run - } - } - - - analyzers : { - - checkhitsEff: - { - module_type : ReadExtrapol - fitterModuleLabel : TrkPatRec - diagLevel : 1 - qualityCuts : 2 - generatorModuleLabel : generate - g4ModuleLabel : g4run - makerModuleLabel : makeSH - caloReadoutModuleLabel : CaloReadoutHitsMaker - caloCrystalModuleLabel : CaloCrystalHitsMaker - trkToCaloExtrapolModuleLabel : TrkExtrapol - elextractModuleLabel : extractElData - maxFullPrint : 201 - } - - } - - p1 : [generate , g4run, makeSH, CaloReadoutHitsMaker, CaloCrystalHitsMaker, TrkPatRec, TrkExtrapol, extractElData, skipBadEvents] - e1 : [checkhitsEff, outfile] - - trigger_paths : [p1] - end_paths : [e1] - -} - -outputs: -{ - # Define the output file. - outfile : - { - module_type : RootOutput - fileName : "data_readExtrapol.root" - outputCommands : ['keep *_*_*_*' - # , 'drop mu2ePointTrajectoryMapVector_*_*_*' - # , 'drop mu2eSimParticles_*_*_*' - # Uncomment the above line to reduce file size. - ] - } -} - -# Override some of the default values. -#physics.producers.generate.inputfile : "Scripts/genconfig_Conversion.txt" -physics.producers.generate.inputfile : "Offline/CaloCluster/test/genconfig_giani.txt" -#services.GeometryService.inputFile : "Scripts/geom_nohp.txt" -services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common.txt" -physics.producers.makeSH.diagLevel : 0 -physics.producers.makeSH.maxFullPrint : 2 -source.firstRun : 1 -services.SeedService.baseSeed : 1 -services.SeedService.maxUniqueEngines : 20 -physics.producers.KalFitTest.KalFit.RemoveFailedFits : false -physics.producers.KalFitTest.KalFitMC.pureHits : false -# diff --git a/TrackCaloMatching/test/trkExtrapol.fcl b/TrackCaloMatching/test/trkExtrapol.fcl deleted file mode 100644 index 500cb1fbc2..0000000000 --- a/TrackCaloMatching/test/trkExtrapol.fcl +++ /dev/null @@ -1,117 +0,0 @@ -# - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -# Give this job a name. -process_name : trkExtrapol - -# Start form an empty source -source : -{ - module_type : EmptyEvent - maxEvents : -1 -} - -services : -{ - message : @local::default_message - - TFileService : { fileName : "trkExtrapol.root" } - - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - - BTrkHelper : @local::BTrkHelperDefault - - Mu2eG4Helper : { } - - SeedService : @local::automaticSeeds - -} - -physics : -{ - producers: - { - - # Generate the event - generate: @local::generate - - # Run G4 and add hits to the event - g4run : @local::g4run - - # Form StrawHits (SH). - makeSH : @local::makeSH - - # test module for Kalman fit: the - - - TrkPatRec : @local::TrkPatRec - - - TrkExtrapol : - { - module_type : TrkExtrapol - fitterModuleLabel : TrkPatRec - diagLevel : 3 - maxNumberStoresPoints : 1 - # MC truth finder, analyzer configuration - KalFitMC : - { - } - - } - } - analyzers : { - - eventdisplay: - { - module_type : EventDisplay - g4ModuleLabel : "g4run" - } - - } - - p1 : [generate , g4run, makeSH, TrkPatRec, TrkExtrapol ] - e1 : [eventdisplay,outfile] - - trigger_paths : [p1] - end_paths : [e1] - -} - -outputs: -{ - # Define the output file. - outfile : - { - module_type : RootOutput - fileName : "data_extrapol.root" - outputCommands : ['keep *_*_*_*' - # , 'drop mu2ePointTrajectoryMapVector_*_*_*' - # , 'drop mu2eSimParticles_*_*_*' - # Uncomment the above line to reduce file size. - ] - } -} - -# Override some of the default values. -#physics.producers.generate.inputfile : "Scripts/genconfig_Conversion.txt" -physics.producers.generate.inputfile : "Offline/CaloCluster/test/genconfig_giani.txt" -#services.GeometryService.inputFile : "Scripts/geom_nohp.txt" -services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common.txt" -physics.producers.makeSH.diagLevel : 0 -physics.producers.makeSH.maxFullPrint : 2 -source.firstRun : 1 -services.SeedService.baseSeed : 1 -services.SeedService.maxUniqueEngines : 20 -physics.producers.KalFitTest.KalFit.RemoveFailedFits : false -physics.producers.KalFitTest.KalFitMC.pureHits : false -# diff --git a/TrackerConditions/CMakeLists.txt b/TrackerConditions/CMakeLists.txt index 4df817bc92..8f5d42fa5e 100644 --- a/TrackerConditions/CMakeLists.txt +++ b/TrackerConditions/CMakeLists.txt @@ -17,7 +17,6 @@ cet_make_library( src/TrackerPanelMap.cc src/TrackerPanelMapMaker.cc LIBRARIES PUBLIC - BTrk_MatEnv Offline::BFieldGeom Offline::DAQConditions Offline::DataProducts diff --git a/TrackerConditions/inc/StrawResponse.hh b/TrackerConditions/inc/StrawResponse.hh index 1cd6d9a80c..68addb7e1d 100644 --- a/TrackerConditions/inc/StrawResponse.hh +++ b/TrackerConditions/inc/StrawResponse.hh @@ -149,15 +149,6 @@ namespace mu2e { // access raw drift information auto const& strawDrift() const { return *_strawDrift; } - // BTrk legacy functions. These will be retired with BTrk - // DO NOT write any new code referencing these functions, or modify them (except to fix bugs) - // values are intentionally hard-coded: no modification is allowed - double BTrk_Mint0doca() const { return -0.2; } - double BTrk_driftDistanceToTime(StrawId strawId, double ddist, double phi) const; - double BTrk_driftInstantSpeed(StrawId strawId, double ddist, double phi) const; - double BTrk_driftDistanceError(StrawId strawId, double ddist, double phi) const; - double BTrk_driftTimeToDistance(StrawId strawId, double dtime, double phi) const; - private: // helper functions diff --git a/TrackerConditions/src/SConscript b/TrackerConditions/src/SConscript index f571010b67..fbb581cb62 100644 --- a/TrackerConditions/src/SConscript +++ b/TrackerConditions/src/SConscript @@ -16,7 +16,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', - 'mu2e_Mu2eBTrk', 'mu2e_TrackerGeom', 'mu2e_DAQConditions', @@ -26,9 +25,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - 'BTrk_BaBar', - 'BTrk_MatEnv', - 'BTrk_DetectorModel', 'art_Framework_Services_Registry', 'art_root_io_tfile_support', 'art_Utilities', diff --git a/TrackerConditions/src/StrawDriftMaker.cc b/TrackerConditions/src/StrawDriftMaker.cc index 27eb2ee406..f9358db19d 100644 --- a/TrackerConditions/src/StrawDriftMaker.cc +++ b/TrackerConditions/src/StrawDriftMaker.cc @@ -12,7 +12,6 @@ #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "BTrk/BField/BField.hh" #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "CLHEP/Matrix/Vector.h" diff --git a/TrackerConditions/src/StrawPhysics.cc b/TrackerConditions/src/StrawPhysics.cc index 25822467ac..15229958aa 100644 --- a/TrackerConditions/src/StrawPhysics.cc +++ b/TrackerConditions/src/StrawPhysics.cc @@ -9,7 +9,6 @@ #include #include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "BTrk/BField/BField.hh" #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "CLHEP/Matrix/Vector.h" diff --git a/TrackerConditions/src/StrawResponse.cc b/TrackerConditions/src/StrawResponse.cc index 9164d60967..917626ef82 100644 --- a/TrackerConditions/src/StrawResponse.cc +++ b/TrackerConditions/src/StrawResponse.cc @@ -266,32 +266,4 @@ namespace mu2e { } } - - double StrawResponse::BTrk_driftDistanceToTime(StrawId strawId, double ddist, double phi) const { - return _strawDrift->D2T(ddist,phi); - } - - double StrawResponse::BTrk_driftInstantSpeed(StrawId strawId, double ddist, double phi) const { - return _strawDrift->GetInstantSpeedFromD(ddist); - } - - double StrawResponse::BTrk_driftDistanceError(StrawId strawId, double ddist, double phi) const { - static const std::vector derr = {0.363559, 0.362685, 0.359959, 0.349385, - 0.336731, 0.321784, 0.302363, 0.282691, 0.268223, 0.252673, 0.238557, - 0.229172, 0.2224, 0.219224, 0.217334, 0.212797, 0.210303, 0.209876, - 0.208739, 0.207411, 0.208738, 0.209646, 0.210073, 0.207101, 0.20431, - 0.203994, 0.202931, 0.19953, 0.196999, 0.194559, 0.191766, 0.187725, - 0.185959, 0.181423, 0.17848, 0.171357, 0.171519, 0.168422, 0.161338, - 0.156641, 0.151196, 0.146546, 0.144069, 0.139858, 0.135838, 0.13319, - 0.132159, 0.130062, 0.123545, 0.120212 }; - static double rstraw(2.5); - double doca = std::min(fabs(ddist),rstraw); - size_t idoca = std::min(derr.size()-1,size_t(floor(derr.size()*(doca/rstraw)))); - return derr[idoca]; - } - - double StrawResponse::BTrk_driftTimeToDistance(StrawId strawId, double dtime, double phi) const { - return _strawDrift->T2D(dtime,phi); - } - } diff --git a/TrackerConditions/src/StrawResponseMaker.cc b/TrackerConditions/src/StrawResponseMaker.cc index 691694e4aa..14ed3b4ea0 100644 --- a/TrackerConditions/src/StrawResponseMaker.cc +++ b/TrackerConditions/src/StrawResponseMaker.cc @@ -9,7 +9,6 @@ #include "Offline/GeneralUtilities/inc/SplineInterpolation.hh" #include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "BTrk/BField/BField.hh" #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "CLHEP/Matrix/Vector.h" diff --git a/TrackerMC/src/MakeMCKalSeed_module.cc b/TrackerMC/src/MakeMCKalSeed_module.cc index 5522427bcb..22f773c1ba 100644 --- a/TrackerMC/src/MakeMCKalSeed_module.cc +++ b/TrackerMC/src/MakeMCKalSeed_module.cc @@ -18,7 +18,6 @@ #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "BTrk/BField/BField.hh" // utiliities // persistent data #include "Offline/MCDataProducts/inc/SimParticle.hh" diff --git a/TrackerMC/src/MakeStrawGasSteps_module.cc b/TrackerMC/src/MakeStrawGasSteps_module.cc index d3800da501..99e95b8394 100644 --- a/TrackerMC/src/MakeStrawGasSteps_module.cc +++ b/TrackerMC/src/MakeStrawGasSteps_module.cc @@ -20,7 +20,6 @@ #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "BTrk/BField/BField.hh" #include "Offline/Mu2eUtilities/inc/TwoLinePCA.hh" #include "Offline/MCDataProducts/inc/StepPointMC.hh" diff --git a/TrackerMC/src/SConscript b/TrackerMC/src/SConscript index 5172a60bdf..d6d22aeee6 100644 --- a/TrackerMC/src/SConscript +++ b/TrackerMC/src/SConscript @@ -64,7 +64,6 @@ helper.make_plugins( [ mainlib, 'tbb', 'cetlib', 'cetlib_except', - 'BTrk_BField', 'CLHEP', 'boost_filesystem', 'boost_math_tr1', diff --git a/TrackerMC/src/StrawDigisFromStrawGasSteps_module.cc b/TrackerMC/src/StrawDigisFromStrawGasSteps_module.cc index dcd814bf67..67b012e73e 100644 --- a/TrackerMC/src/StrawDigisFromStrawGasSteps_module.cc +++ b/TrackerMC/src/StrawDigisFromStrawGasSteps_module.cc @@ -27,7 +27,6 @@ #include "Offline/GeometryService/inc/DetectorSystem.hh" #include "Offline/BFieldGeom/inc/BFieldManager.hh" #include "Offline/TrackerConditions/inc/TrackerStatus.hh" -#include "BTrk/BField/BField.hh" // utiliities #include "Offline/Mu2eUtilities/inc/TwoLinePCA.hh" #include "Offline/DataProducts/inc/TrkTypes.hh" diff --git a/Trigger/src/SConscript b/Trigger/src/SConscript index 061ff2dff3..8fbd563ac5 100644 --- a/Trigger/src/SConscript +++ b/Trigger/src/SConscript @@ -20,8 +20,6 @@ mainlib = helper.make_mainlib ( [] ) helper.make_plugins( [ mainlib, 'mu2e_TrkExt', 'mu2e_TrkDiag', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_ParticleID', diff --git a/TrkDiag/CMakeLists.txt b/TrkDiag/CMakeLists.txt index e95ebc9b7c..a1167b0bab 100644 --- a/TrkDiag/CMakeLists.txt +++ b/TrkDiag/CMakeLists.txt @@ -1,12 +1,9 @@ cet_make_library( SOURCE - src/TrkCaloDiag.cc - src/TrkComp.cc src/TrkMCTools.cc LIBRARIES PUBLIC - + Offline::BFieldGeom - Offline::BTrkData Offline::ConfigTools Offline::DataProducts Offline::GeometryService @@ -22,7 +19,7 @@ cet_build_plugin(BinnedSpectrumWeight art::module REG_SOURCE src/BinnedSpectrumWeight_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::ConfigTools Offline::MCDataProducts Offline::Mu2eUtilities @@ -33,7 +30,7 @@ cet_build_plugin(BkgDiag art::module REG_SOURCE src/BkgDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::DataProducts Offline::GeometryService Offline::MCDataProducts @@ -44,7 +41,7 @@ cet_build_plugin(ComboHitDiag art::module REG_SOURCE src/ComboHitDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::GeometryService Offline::MCDataProducts Offline::ProditionsService @@ -56,7 +53,7 @@ cet_build_plugin(HelixDiag art::module REG_SOURCE src/HelixDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::BFieldGeom Offline::GeneralUtilities Offline::GeometryService @@ -71,7 +68,7 @@ cet_build_plugin(ProtonBunchTimeDiag art::module REG_SOURCE src/ProtonBunchTimeDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::DataProducts Offline::MCDataProducts Offline::RecoDataProducts @@ -81,7 +78,7 @@ cet_build_plugin(RMCWeight art::module REG_SOURCE src/RMCWeight_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::ConfigTools Offline::MCDataProducts Offline::Mu2eUtilities @@ -99,7 +96,7 @@ cet_build_plugin(StrawHitDiag art::module REG_SOURCE src/StrawHitDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::ConditionsService Offline::DataProducts Offline::GeometryService @@ -114,7 +111,7 @@ cet_build_plugin(StrawResponseTest art::module REG_SOURCE src/StrawResponseTest_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::ProditionsService Offline::TrackerConditions ) @@ -123,7 +120,7 @@ cet_build_plugin(TimeClusterDiag art::module REG_SOURCE src/TimeClusterDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::CalorimeterGeom Offline::GeneralUtilities Offline::GeometryService @@ -136,7 +133,7 @@ cet_build_plugin(TrackPID art::module REG_SOURCE src/TrackPID_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::CalorimeterGeom Offline::GeometryService Offline::Mu2eUtilities @@ -147,7 +144,7 @@ cet_build_plugin(TrackQuality art::module REG_SOURCE src/TrackQuality_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::AnalysisConditions Offline::GlobalConstantsService Offline::Mu2eUtilities @@ -160,7 +157,7 @@ cet_build_plugin(TrkGeomTest art::module REG_SOURCE src/TrkGeomTest_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::GeometryService Offline::ProditionsService Offline::TrackerConditions @@ -171,7 +168,7 @@ cet_build_plugin(TrkRecoDiag art::module REG_SOURCE src/TrkRecoDiag_module.cc LIBRARIES REG Offline::TrkDiag - + Offline::BFieldGeom Offline::GeneralUtilities Offline::GeometryService diff --git a/TrkDiag/inc/TrkCaloDiag.hh b/TrkDiag/inc/TrkCaloDiag.hh deleted file mode 100644 index 5b5616c4d7..0000000000 --- a/TrkDiag/inc/TrkCaloDiag.hh +++ /dev/null @@ -1,61 +0,0 @@ -// -// Diagnostics for track-calo matching -// -#ifndef TrkCaloDiag_HH -#define TrkCaloDiag_HH -// framework -// -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" -// mu2e tracking -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -// Track Calo matching -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" -#include "Offline/TrkDiag/inc/TrkCaloInfo.hh" -// particleId -#include "Offline/ParticleID/inc/PIDLogLRatio.hh" -#include "Offline/ParticleID/inc/PIDLogL1D.hh" -#include "Offline/ParticleID/inc/PIDLogLEp.hh" -// ROOT incldues -#include "TTree.h" -#include "Rtypes.h" -// BaBar includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/TrkBase/TrkParticle.hh" - -namespace mu2e { - - class TrkCaloDiag { - public: - TrkCaloDiag(TrkParticle const& tpart, TrkFitDirection const& fdir, fhicl::ParameterSet const& pset); - // find the required data products in the event - void findData(const art::Event& event); - // add calo info for a particular track - void addCaloInfo(KalRep const* krep); - // add calo info for a particular match - void fillCaloInfo(TrackClusterMatch const& tcm, TrkCaloInfo& tcinfo); - // add the calo info branches to the tree - void addBranches(TTree* tree,const char* suffix=""); - art::Handle const& caloMatchHandle() { return _caloMatchHandle; } - private: - // calorimeter matching labels - std::string _caloMatchModule; - art::Handle _caloMatchHandle; - // branch variables - std::vector _caloinfo; - Int_t _ncalo; - - // PID configuration - typedef PIDLogLRatio PIDdt; - typedef PIDLogLRatio PIDEp; - // there is no default constructor for PID classes so the configuration MUST be - // accurate to even instantiantiate these objects - PIDdt _pid_dt; - PIDEp _pid_ep; - - }; - -} -#endif - diff --git a/TrkDiag/inc/TrkComp.hh b/TrkDiag/inc/TrkComp.hh deleted file mode 100644 index 7436d6be2f..0000000000 --- a/TrkDiag/inc/TrkComp.hh +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef TrkComp_HH -#define TrkComp_HH -// root -#include "Rtypes.h" -class KalRep; -#include "Offline/RecoDataProducts/inc/KalSeed.hh" -// -// Functor Class to compare tracks and find overlaps (2 tracks sharing a substantial number of hits) -// Dave Brown, LBNL 7/8/2016 -namespace mu2e { - class TrkComp { - public: - // compute the number of active TrStrawHits using the same StrawHit in common between 2 tracks. - unsigned nOverlap(const KalRep* k1, const KalRep* k2); - unsigned nOverlap(const KalSeed& k1, const KalSeed& k2); - // void fillOverlaps(KalRepPtrCollection const& trks,std::vector& overlaps); - }; -} -#endif diff --git a/TrkDiag/inc/TrkMCTools.hh b/TrkDiag/inc/TrkMCTools.hh index 0fd03bcfa0..cb5288cffa 100644 --- a/TrkDiag/inc/TrkMCTools.hh +++ b/TrkDiag/inc/TrkMCTools.hh @@ -10,7 +10,6 @@ #include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "Offline/MCDataProducts/inc/KalSeedMC.hh" -#include "BTrk/BbrGeom/HepPoint.h" #include "Offline/MCDataProducts/inc/PrimaryParticle.hh" #include diff --git a/TrkDiag/src/SConscript b/TrkDiag/src/SConscript index c6be1273d3..1b5380c0f6 100644 --- a/TrkDiag/src/SConscript +++ b/TrkDiag/src/SConscript @@ -17,8 +17,6 @@ mainlib = helper.make_mainlib ( [ 'openblas', 'mu2e_TrkReco', 'mu2e_ParticleID', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_ConditionsService', @@ -63,8 +61,6 @@ helper.make_plugins( [ 'openblas', 'mu2e_TrkReco', 'mu2e_ParticleID', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', 'mu2e_SeedService', diff --git a/TrkDiag/src/TrkCaloDiag.cc b/TrkDiag/src/TrkCaloDiag.cc deleted file mode 100644 index 8c5ee247f5..0000000000 --- a/TrkDiag/src/TrkCaloDiag.cc +++ /dev/null @@ -1,82 +0,0 @@ -// -// Diagnostics for track-calo matching -// - -#include "Offline/TrkDiag/inc/TrkCaloDiag.hh" -namespace mu2e -{ - - TrkCaloDiag::TrkCaloDiag( TrkParticle const& tpart, TrkFitDirection const& fdir, fhicl::ParameterSet const& pset) : - _ncalo(0), - _pid_dt(pset.get("PIDdt",fhicl::ParameterSet())), - _pid_ep(pset.get("PIDEp",fhicl::ParameterSet())) - { - // construct the calo matching module name. Convention is 1st letter of direction, 1st letter of particle name + 1st letter of charge - // This code will break if the fhicl prolog conventions change, FIXME!!! - std::string chargename = tpart.charge() > 0.0 ? "p" : "m"; - std::string caloMatchingRoot = pset.get("caloMatchingRoot","TrackCaloMatching"); - _caloMatchModule = caloMatchingRoot + fdir.name().substr(0,1) + tpart.name().substr(0,1) + chargename; - } - - void TrkCaloDiag::addCaloInfo(KalRep const* krep) { - if(_caloMatchHandle.isValid()){ - _caloinfo.clear(); - _ncalo = 0; - for( auto const& tcm : *_caloMatchHandle ) { - if(tcm.textrapol()->trk().get() == krep){ - TrkCaloInfo tcinfo; - fillCaloInfo(tcm,tcinfo); - _caloinfo.push_back(tcinfo); - _ncalo++; - } - } - } - } - - void TrkCaloDiag::fillCaloInfo(TrackClusterMatch const& tcm, TrkCaloInfo& tcinfo) { - // matching info - tcinfo._dt = tcm.dt(); - tcinfo._du = tcm.du(); - tcinfo._dv = tcm.dv(); - tcinfo._ds = tcm.ds(); - tcinfo._ep = tcm.ep(); - tcinfo._uvChisq = tcm.chi2(); - tcinfo._tChisq = tcm.chi2_time(); - // PID information - tcinfo._dtllr = _pid_dt.value(tcm.dt()); - tcinfo._epllr = _pid_ep.value(tcm.ep(),tcm.ds()); - // cluster info - const CaloCluster* cluster = tcm.caloCluster(); - tcinfo._eclust = cluster->energyDep(); - tcinfo._tclust = cluster->time(); - tcinfo._section = cluster->diskID(); - tcinfo._cpos = XYZVectorF(cluster->cog3Vector()); - // track information at intersection point. Don't use this as there's an - // additional fltlen added for the depth (59mm). - // KalRep const* krep = tcm.textrapol()->trk() - // double ipath = tcinfo.textrapol()->pathLengthEntrance(); - // tcinfo._tpos = XYZVectorF(krep.position(ipath); - // tcinfo._tdir = XYZVectorF(krep.direction(ipath); - // tcinfo._ttrk = krel.arrivalTime(ipath); - tcinfo._tpos = XYZVectorF(CLHEP::Hep3Vector(tcm.xtrk(),tcm.ytrk(),tcm.ztrk())); - tcinfo._tdir = XYZVectorF(CLHEP::Hep3Vector(tcm.nx(),tcm.ny(),tcm.nz())); - tcinfo._ttrk = tcm.ttrk(); - } - - void TrkCaloDiag::addBranches(TTree* tree,const char* suffix) { - std::string ssuf(suffix); - std::string bname = std::string("ncalo") +ssuf; - tree->Branch(bname.c_str(),&_ncalo,"ncalo/I"); - bname = std::string("calo") +ssuf; - tree->Branch(bname.c_str(),&_caloinfo); - } - - void TrkCaloDiag::findData(const art::Event& event) { - event.getByLabel(_caloMatchModule,_caloMatchHandle); - // clear the branch in case there are no calo objects found - _ncalo = 0; - _caloinfo.clear(); - } - -} - diff --git a/TrkDiag/src/TrkComp.cc b/TrkDiag/src/TrkComp.cc deleted file mode 100644 index bf015d47b0..0000000000 --- a/TrkDiag/src/TrkComp.cc +++ /dev/null @@ -1,97 +0,0 @@ -// -// Functor Class to compare tracks and find overlaps (2 tracks sharing a substantial number of hits) -// Dave Brown, LBNL 7/8/2016 -#include "Offline/TrkDiag/inc/TrkComp.hh" -// BaBar -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include - -namespace mu2e { - - // count use of the same StrawHitis in different tracks - unsigned TrkComp::nOverlap(const KalRep* k1, const KalRep* k2){ - unsigned nover(0); - // count shared StrawHits. Note this currently requires a downcast, it should - // be supported by the TrkHit base class, FIXME! - TrkStrawHitVector tshv1; - convert(k1->hitVector(),tshv1); - TrkStrawHitVector tshv2; - convert(k2->hitVector(),tshv2); - // sort these by StrawHit index, which is unique - indexcomp icomp; - std::sort(tshv1.begin(),tshv1.end(),icomp); - std::sort(tshv2.begin(),tshv2.end(),icomp); - // find the 1st active hit in each vector - auto itsh1 = tshv1.begin(); - while(itsh1 != tshv1.end() && !(*itsh1)->isActive() )++itsh1; - auto itsh2 = tshv2.begin(); - while(itsh2 != tshv2.end() && !(*itsh2)->isActive() )++itsh2; - // loop over all potential overlapps - while(itsh1 != tshv1.end() && itsh2 != tshv2.end()){ - // check for overlap - if((*itsh1)->index() == (*itsh2)->index()) { - // same straw hit: increment overlap and both iterators - ++nover; ++itsh1; ++itsh2; - while(itsh1 != tshv1.end() && !(*itsh1)->isActive() )++itsh1; - while(itsh2 != tshv2.end() && !(*itsh2)->isActive() )++itsh2; - } else if((*itsh1)->index() < (*itsh2)->index()) { - // move to next potential overlap - while(itsh1 != tshv1.end() && (*itsh1)->index() < (*itsh2)->index() ){ - ++itsh1; - while(itsh1 != tshv1.end() && !(*itsh1)->isActive() )++itsh1; - } - } else { - while(itsh2 != tshv2.end() && (*itsh2)->index() < (*itsh1)->index() ){ - ++itsh2; - while(itsh2 != tshv2.end() && !(*itsh2)->isActive() )++itsh2; - } - } - } - return nover; - } - - // count use of the same StrawHitis in different tracks - unsigned TrkComp::nOverlap(const KalSeed& k1, const KalSeed& k2){ - unsigned nover(0); - // count shared StrawHits. Note this currently requires a downcast, it should - // be supported by the TrkHit base class, FIXME! - std::vector tshv1 = k1.hits(); - std::vector tshv2 = k2.hits(); - // sort these by StrawHit index, which is unique - mu2e::indexcompseed icomp; - std::sort(tshv1.begin(),tshv1.end(),icomp); - std::sort(tshv2.begin(),tshv2.end(),icomp); - // find the 1st active hit in each vector - static StrawHitFlag active(StrawHitFlag::active); - auto itsh1 = tshv1.begin(); - while(itsh1 != tshv1.end() && !itsh1->flag().hasAllProperties(active) )++itsh1; - auto itsh2 = tshv2.begin(); - while(itsh2 != tshv2.end() && !itsh2->flag().hasAllProperties(active) )++itsh2; - // loop over all potential overlapps - while(itsh1 != tshv1.end() && itsh2 != tshv2.end()){ - // check for overlap - if(itsh1->index() == itsh2->index()) { - // same straw hit: increment overlap and both iterators - ++nover; ++itsh1; ++itsh2; - while(itsh1 != tshv1.end() && !itsh1->flag().hasAllProperties(active) )++itsh1; - while(itsh2 != tshv2.end() && !itsh2->flag().hasAllProperties(active) )++itsh2; - } else if(itsh1->index() < itsh2->index()) { - // move to next potential overlap - while(itsh1 != tshv1.end() && itsh1->index() < itsh2->index() ){ - ++itsh1; - while(itsh1 != tshv1.end() && !itsh1->flag().hasAllProperties(active) )++itsh1; - } - } else { - while(itsh2 != tshv2.end() && itsh2->index() < itsh1->index() ){ - ++itsh2; - while(itsh2 != tshv2.end() && !itsh2->flag().hasAllProperties(active) )++itsh2; - } - } - } - return nover; - } - -} - diff --git a/TrkDiag/src/TrkMCTools.cc b/TrkDiag/src/TrkMCTools.cc index 1bc847a614..a0ae4e0241 100644 --- a/TrkDiag/src/TrkMCTools.cc +++ b/TrkDiag/src/TrkMCTools.cc @@ -9,7 +9,6 @@ #include "Offline/TrackerGeom/inc/Tracker.hh" #include "Offline/Mu2eUtilities/inc/TwoLinePCA.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GeometryService/inc/DetectorSystem.hh" diff --git a/TrkExt/CMakeLists.txt b/TrkExt/CMakeLists.txt deleted file mode 100644 index 345b8e215d..0000000000 --- a/TrkExt/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -cet_make_library( - SOURCE - src/TrkExtDetectors.cc - src/TrkExtDiag.cc - src/TrkExtInstanceName.cc - src/TrkExtMaterial.cc - src/TrkExtMCHits.cc - src/TrkExtProtonAbsorber.cc - src/TrkExtShape.cc - src/TrkExtStoppingTarget.cc - src/TrkExtToyDS.cc - LIBRARIES PUBLIC - art_root_io::TFileService_service - - Offline::BFieldGeom - Offline::BTrkData - Offline::ConfigTools - Offline::DataProducts - Offline::DetectorSolenoidGeom - Offline::GeneralUtilities - Offline::GeometryService - Offline::MCDataProducts - Offline::MECOStyleProtonAbsorberGeom - Offline::RecoDataProducts - Offline::StoppingTargetGeom -) - -cet_build_plugin(TrkExt art::module - REG_SOURCE src/TrkExt_module.cc - LIBRARIES REG - Offline::TrkExt - - Offline::BFieldGeom - Offline::BTrkData - Offline::DataProducts - Offline::GeneralUtilities - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts -) - -install_source(SUBDIRS src) -install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/TrkExt/inc/TrkExtDetectors.hh b/TrkExt/inc/TrkExtDetectors.hh deleted file mode 100644 index 2dcdba9a67..0000000000 --- a/TrkExt/inc/TrkExtDetectors.hh +++ /dev/null @@ -1,59 +0,0 @@ -// -// Detector description for TrkExt -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtDetectors_HH -#define TrkExtDetectors_HH - -#include -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtShape.hh" -#include "Offline/TrkExt/inc/TrkExtToyDS.hh" -#include "Offline/TrkExt/inc/TrkExtProtonAbsorber.hh" -#include "Offline/TrkExt/inc/TrkExtStoppingTarget.hh" - -namespace mu2e { - - namespace TrkExtDetectorList { - enum Enum { - Undefined = -1, - ToyDS = 0, - ProtonAbsorber = 1, - StoppingTarget = 2 - }; - } - - class TrkExtDetectors : public TrkExtShape - { - - public: - TrkExtDetectors() ; - ~TrkExtDetectors() { } - - void initialize () ; - bool contains (CLHEP::Hep3Vector& p) ; - TrkExtDetectorList::Enum volumeId(CLHEP::Hep3Vector &xx) ; - double limit() { return _limit; } - double mostProbableEnergyLoss (const CLHEP::Hep3Vector& p, double ds, TrkExtDetectorList::Enum volid = TrkExtDetectorList::Undefined) ; - double meanEnergyLoss (const CLHEP::Hep3Vector& p, double ds, TrkExtDetectorList::Enum volid = TrkExtDetectorList::Undefined) ; - double scatteringAngle (const CLHEP::Hep3Vector& p, double ds, TrkExtDetectorList::Enum volid) ; - CLHEP::Hep3Vector intersection (const CLHEP::Hep3Vector & x1, const CLHEP::Hep3Vector & x2) ; - - - private: - - TrkExtToyDS _ds; - TrkExtProtonAbsorber _pa; - TrkExtStoppingTarget _st; - - }; - - - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/inc/TrkExtDiag.hh b/TrkExt/inc/TrkExtDiag.hh deleted file mode 100644 index 9d9498be0b..0000000000 --- a/TrkExt/inc/TrkExtDiag.hh +++ /dev/null @@ -1,227 +0,0 @@ -// -// -// Class for reading TrkExt -// -// Note on index for (EXT)VDHitInfo struct : -// -// 0 for down-going (target->tracker) (pz>=0), -// 1 for up-going (tracker->target) (pz<0). -// -// See the note at TrkExtInstanceName.hh -// Note that direction of extrapolation stepping is opposite -// for updown=0 track (ex. normal ce without reflection). -// Don't be confused with extrapolation stepping direction. -// -// Then, status is defined by : -// 0 : no data avaliable -// 1 : down going only -// 2 : up going only -// 3 : both avaliable -// -// Note that, for EXTVDHitInfo struct with normal ce extrapolation, -// status = 1 is possible case (when there is no reflection), -// when status = 2 is not possible. -// Mostly it should be status = 3. -// -#ifndef TrkExtDiag_HH -#define TrkExtDiag_HH - -#include "art/Framework/Principal/fwd.h" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "TTree.h" -#include "Rtypes.h" -#include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/ThreeVector.h" - -namespace mu2e -{ - const unsigned int MAXNHOT = 100; - const unsigned int MAXNTRK = 100; - const unsigned int MAXNSIM = 1000; - const unsigned int MAXNEXT = 10000; - const unsigned int MAXNPA = 50; - const unsigned int MAXNST = 50; - const unsigned int MAXNVD = 10; - - struct PositionInfo { - Float_t x; - Float_t y; - Float_t z; - PositionInfo() : x(0), y(0), z(0) {} - }; - - struct HitInfo { - Float_t x; - Float_t y; - Float_t z; - Float_t px; - Float_t py; - Float_t pz; - Float_t t; - Float_t s; - HitInfo() : s(0) {} - }; - - struct VDHitInfo { - Float_t x[2]; - Float_t y[2]; - Float_t z[2]; - Float_t px[2]; - Float_t py[2]; - Float_t pz[2]; - Float_t p[2]; - Float_t d0[2]; - Float_t p0[2]; - Float_t om[2]; - Float_t z0[2]; - Float_t td[2]; - UInt_t status; - VDHitInfo() : status(0) {} - void clear() { - for (int i = 0 ; i <2 ; ++i) { - x[i] = y[i] = z[i] = px[i] = py[i] = pz[i] = 0; - p[i] = d0[i] = p0[i] = om[i] = z0[i] = td[i] = 0; - status = 0; - } - } - }; - - struct EXTVDHitInfo { - Float_t r[2]; - Float_t p[2]; - Float_t d0[2]; - Float_t p0[2]; - Float_t om[2]; - Float_t z0[2]; - Float_t td[2]; - Float_t er[2]; - Float_t ep[2]; - Float_t ed0[2]; - Float_t ep0[2]; - Float_t eom[2]; - Float_t ez0[2]; - Float_t etd[2]; - UInt_t status; - EXTVDHitInfo() : status(0) {} - void clear() { - for (int i = 0 ; i <2 ; ++i) { - r[i] = p[i] = d0[i] = p0[i] = om[i] = z0[i] = td[i] = 0; - er[i] = ep[i] = ed0[i] = ep0[i] = eom[i] = ez0[i] = etd[i] = 0; - status = 0; - } - } - }; - - struct HelixParameterInfo { - Float_t d0; - Float_t p0; - Float_t om; - Float_t z0; - Float_t td; - Float_t ed0; - Float_t ep0; - Float_t eom; - Float_t ez0; - Float_t etd; - HelixParameterInfo() : - d0(0.), p0(0.), om(0.), z0(0.), td(0.), - ed0(0.), ep0(0.), eom(0.), ez0(0.), etd(0.) {} - void clear() { - d0 = p0 = om = z0 = td = 0; - ed0 = ep0 = eom = ez0 = etd = 0; - } - }; - - - class TrkExtDiag { - public: - explicit TrkExtDiag(fhicl::ParameterSet const&); - virtual ~TrkExtDiag(); - TTree* createTrkExtDiag(); - void setRunInfo(); - void setSubRunInfo(); - void trkExtDiag(const art::Event & evt, const KalRep & trk, const TrkExtTraj & trkext); - void trkExtDiag(void); - - private: - unsigned int readHit(const art::Event &evt, const TrkHitVector & hot); - unsigned int readTrk(const art::Event &evt, const KalRep & krep); - unsigned int readMC(const art::Event &evt, const KalRep & krep, const TrkHitVector & hot); - unsigned int readExt(const art::Event &evt, const TrkExtTraj & trkext); - - CLHEP::HepVector getHelixParameters (const CLHEP::Hep3Vector & x, const CLHEP::Hep3Vector & p, int sign) const ; - CLHEP::HepVector getHelixParametersErr (const CLHEP::Hep3Vector & x, const CLHEP::Hep3Vector & p, CLHEP::Hep3Vector &ex, CLHEP::Hep3Vector &ep, int sign) const ; - double findTurnAround (double s1, double s2, double s3, double f1, double f2, double f3); - double findTurnAroundSim (int i, double f1, double f2, double f3); - double interpolate (double s, double s1, double s2, double s3, double f1, double f2, double f3); - double interpolate2 (double s, double s1, double s2, double f1, double f2); - double getRadialError (const CLHEP::Hep3Vector & x, const CLHEP::HepMatrix & cov); - double getMomentumError (const CLHEP::Hep3Vector & p, const CLHEP::HepMatrix & cov); - - private: - // event-wide - int _evtid, _hepid, _updown, _trkid, _exitcode; - // hit - unsigned int _nhots; - float _hotx[MAXNHOT], _hoty[MAXNHOT], _hotz[MAXNHOT], _hott0[MAXNHOT]; - // trk - unsigned int _ntrks; - float _trkl0, _trkl1, _trkl[MAXNTRK], _trkx[MAXNTRK], _trky[MAXNTRK], _trkz[MAXNTRK]; - float _trkpx[MAXNTRK], _trkpy[MAXNTRK], _trkpz[MAXNTRK], _trkp[MAXNTRK]; - HelixParameterInfo _trk0; - HelixParameterInfo _trk1; - // mc - unsigned int _nsim; - float _simx[MAXNSIM], _simy[MAXNSIM], _simz[MAXNSIM], _simp0, _simt0; - // mc - turn around point - PositionInfo _simtp; - int _simtpqual; - // mc - pa and st - unsigned int _nmcpa, _nmcst; - float _mcpapx[MAXNPA], _mcpapy[MAXNPA], _mcpapz[MAXNPA], _mcpap[MAXNPA], _mcpadp[MAXNPA], _mcpade[MAXNPA], _mcpadei[MAXNPA], _mcpadeni[MAXNPA], _mcpaz[MAXNPA]; - float _mcstpx[MAXNST], _mcstpy[MAXNST], _mcstpz[MAXNST], _mcstp[MAXNST], _mcstdp[MAXNST], _mcstde[MAXNST], _mcstdei[MAXNST], _mcstdeni[MAXNST], _mcstx[MAXNPA], _mcsty[MAXNPA], _mcstz[MAXNPA], _mcstt[MAXNPA]; - // mc - vd - VDHitInfo _vdsi; - VDHitInfo _vdso; - VDHitInfo _vdtf; - VDHitInfo _vdtm; - VDHitInfo _vdtb; - // trkext - unsigned int _next; - float _extx[MAXNEXT], _exty[MAXNEXT], _extz[MAXNEXT]; - float _extpx[MAXNEXT], _extpy[MAXNEXT], _extpz[MAXNEXT], _extp[MAXNEXT]; - float _extrho[MAXNEXT], _exts[MAXNEXT], _extt[MAXNEXT]; - float _extex[MAXNEXT], _extey[MAXNEXT], _extez[MAXNEXT]; - float _extepx[MAXNEXT], _extepy[MAXNEXT], _extepz[MAXNEXT], _extep[MAXNEXT], _exter[MAXNEXT]; - int _extvid[MAXNEXT]; - // trkext - turn around point - int _extitp; - HitInfo _exttp; - // trkext - pa and st - unsigned int _nextpa, _nextst; - float _extpaz[MAXNPA], _extpadp[MAXNPA], _extpadptot; - float _extstx[MAXNST], _extsty[MAXNST], _extstz[MAXNST], _extstt[MAXNST], _extstdp[MAXNST], _extstdptot; - // trkext - vd - EXTVDHitInfo _extvdsi; - EXTVDHitInfo _extvdso; - EXTVDHitInfo _extvdtf; - EXTVDHitInfo _extvdtm; - EXTVDHitInfo _extvdtb; - - //local variables - std::string _makerModuleLabel; - std::string _g4ModuleLabel; - CLHEP::Hep3Vector _origin; - double _vdzsi, _vdzso, _vdztf, _vdztm, _vdztb; - BFieldManager const * _bfMgr; - - - public: - TTree *_extdiag; - }; -} - -#endif - diff --git a/TrkExt/inc/TrkExtInstanceName.hh b/TrkExt/inc/TrkExtInstanceName.hh deleted file mode 100644 index 45a0dd2df3..0000000000 --- a/TrkExt/inc/TrkExtInstanceName.hh +++ /dev/null @@ -1,71 +0,0 @@ -// -// Instance name information for TrkExt data product -// -// -// Original author MyeongJae Lee -// -// Definition of updown : 0 for downstream (target->tracker->calorimeter) and 1 for upstream (calorimeter->tracker->target). -// This definition is kept for all track direction definition, for example, the index of VDHitInfo class in TrkExtDiag.hh -// -#ifndef TrkExtInstanceName_HH -#define TrkExtInstanceName_HH - -#include -#include -#include "BTrk/TrkBase/TrkParticle.hh" - -namespace mu2e { - - namespace TrkExtParticleMass { - // Mass of particles. - // TODO : Need to change to read from condition service. However the accuracy is no good for some particles (electron) - const double MASS_ELECTRON = 0.510998910; - const double MASS_MUON = 105.658367; - const double MASS_PION = 139.57018; - const double MASS_PROTON = 938.272013; - } - - class TrkExtInstanceNameEntry { - - public: - TrkExtInstanceNameEntry (TrkParticle::type _hepid, bool _updown, std::string _fitterName=""); - ~TrkExtInstanceNameEntry() {} - std::string name; - bool updown; - int charge; - double mass2; - int hepid; - std::string fitterName; - unsigned int ntrk; - }; - - - class TrkExtInstanceName { - - public: - TrkExtInstanceName(); - ~TrkExtInstanceName() { } - void clear (void) { _entries.clear(); } - unsigned int size(void) const {return _entries.size();} - TrkExtInstanceNameEntry & get(unsigned int i) { return _entries[i]; } - bool updown (unsigned int i) const { return _entries[i].updown; } - int charge (unsigned int i) const { return _entries[i].charge; } - double mass2 (unsigned int i) const { return _entries[i].mass2; } - int hepid (unsigned int i) const { return _entries[i].hepid; } - std::string name (unsigned int i) const { return _entries[i].name; } - std::string fitterName (unsigned int i) const { return _entries[i].fitterName; } - void addTrack(unsigned int i) { _entries[i].ntrk += 1; } - unsigned int ntrk (unsigned int i) const { return _entries[i].ntrk; } - - void construct (TrkParticle::type _hepid, bool _up_down, std::string _fitterName) ; - - private: - std::vector _entries; - }; - - - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/inc/TrkExtMCHits.hh b/TrkExt/inc/TrkExtMCHits.hh deleted file mode 100644 index c45f9c7c0c..0000000000 --- a/TrkExt/inc/TrkExtMCHits.hh +++ /dev/null @@ -1,53 +0,0 @@ -// -// Original author MyeongJae Lee -// -#ifndef TrkExtMCHits_HH -#define TrkExtMCHits_HH - -// C++ includes. -#include -#include - -// Framework includes. -#include "art/Framework/Principal/Event.h" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "cetlib/map_vector.h" - -namespace mu2e { - - class TrkExtMCHits { - - public: - TrkExtMCHits() ; - TrkExtMCHits(const art::Event& event, std::string g4ModuleLabel, std::string instanceName, cet::map_vector_key simid, double distcut = 1.) ; - ~TrkExtMCHits() ; - - const std::vector & getClusters() const {return _hitcol;} - unsigned int getNClusters() const {return _hitcol.size();} - const StepPointMCCollection & getCluster(unsigned int clust) const {return _hitcol[clust]; } - unsigned int getNHit (unsigned int clust) const { return _hitcol[clust].size(); } - const StepPointMC & getHit (unsigned int clust, unsigned int hit) const { return (_hitcol[clust])[hit]; } - CLHEP::Hep3Vector momentum (unsigned int clust) const ; - CLHEP::Hep3Vector position (unsigned int clust) const ; - double time (unsigned int clust) const; - double deltap (unsigned int clust) const; - double eDep (unsigned int clust) const; - double ionizingEdep (unsigned int clust) const; - double nonIonizingEdep (unsigned int clust) const; - - private: - double interpolate3 (double z, double x1, double x2, double x3, double y1, double y2, double y3) const; - double interpolate2 (double z, double x1, double x2, double y1, double y2) const ; - - private: - std::string _g4ModuleLabel; - std::string _instanceName; - std::vector _hitcol; - double _distcut; - - }; - -} // end namespace mu2e - -#endif diff --git a/TrkExt/inc/TrkExtMaterial.hh b/TrkExt/inc/TrkExtMaterial.hh deleted file mode 100644 index aa8dc1e677..0000000000 --- a/TrkExt/inc/TrkExtMaterial.hh +++ /dev/null @@ -1,57 +0,0 @@ -// -// Material description for TrkExt -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtMaterial_HH -#define TrkExtMaterial_HH - -#include -#include "CLHEP/Vector/ThreeVector.h" - - -namespace mu2e { - - - class TrkExtMaterial { - - public: - TrkExtMaterial() ; - TrkExtMaterial(std::string n) ; - ~TrkExtMaterial() { } - - double meanEnergyLoss (const CLHEP::Hep3Vector& p, double ds) ; - double mostProbableEnergyLoss (const CLHEP::Hep3Vector& p, double ds) ; - double scatteringAngle (const CLHEP::Hep3Vector& p, double ds) ; - std::string name () { return _name; } - - private: - - static constexpr double _mec22 = 0.510998910 * 0.510998910; - static constexpr double _mec2 = 0.510998910; - - std::string _name; - double _dpmp[6]; - double _edpmp[6]; - double _dpsp[3]; - double _edpsp[3]; - double _thpar[3]; - double _rho; - - enum TrkExtMaterialList { - Undefined = -1, - Vac = 0, - Al = 1, - PE = 2 - } _matid; - - }; - - - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/inc/TrkExtProtonAbsorber.hh b/TrkExt/inc/TrkExtProtonAbsorber.hh deleted file mode 100644 index 88df16df18..0000000000 --- a/TrkExt/inc/TrkExtProtonAbsorber.hh +++ /dev/null @@ -1,42 +0,0 @@ -// -// ProtonAbsorber description for TrkExt -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtProtonAbsorber_HH -#define TrkExtProtonAbsorber_HH - -#include -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtShape.hh" -#include "Offline/TrkExt/inc/TrkExtMaterial.hh" - -namespace mu2e { - - class TrkExtProtonAbsorber : public TrkExtShape, public TrkExtMaterial - { - - public: - TrkExtProtonAbsorber() ; - ~TrkExtProtonAbsorber() { } - - void initialize () ; - bool contains (CLHEP::Hep3Vector& p) ; - - private: - double z0, z1; - double r0in, r0out, r1in, r1out; - double slope_in, slope_out; - bool valid; - std::string name; - - }; - - - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/inc/TrkExtShape.hh b/TrkExt/inc/TrkExtShape.hh deleted file mode 100644 index 83f4183117..0000000000 --- a/TrkExt/inc/TrkExtShape.hh +++ /dev/null @@ -1,34 +0,0 @@ -// -// Shape description for TrkExt -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtShape_HH -#define TrkExtShape_HH - -#include "CLHEP/Vector/ThreeVector.h" - -namespace mu2e { - - class TrkExtShape { - - public: - TrkExtShape(double boundaryLimit = 0.001) ; - ~TrkExtShape() { } - - virtual bool contains (CLHEP::Hep3Vector& p) =0 ; - virtual void initialize (void) =0 ; - CLHEP::Hep3Vector intersection (const CLHEP::Hep3Vector & x1, const CLHEP::Hep3Vector & x2) ; - - protected: - - double _limit; - - }; - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/inc/TrkExtStoppingTarget.hh b/TrkExt/inc/TrkExtStoppingTarget.hh deleted file mode 100644 index 9e93cb1808..0000000000 --- a/TrkExt/inc/TrkExtStoppingTarget.hh +++ /dev/null @@ -1,52 +0,0 @@ -// -// StoppingTarget description for TrkExt -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtStoppingTarget_HH -#define TrkExtStoppingTarget_HH - -#include -#include -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtShape.hh" -#include "Offline/TrkExt/inc/TrkExtMaterial.hh" - -namespace mu2e { - - - class foil_data_type { - public: - foil_data_type (double x1, double x2, double x3, double x4) : - rout(x1), - z0(x2), - zc(x3), - z1(x4) - {} - double rout, z0, zc, z1; - }; - - class TrkExtStoppingTarget : public TrkExtShape, public TrkExtMaterial - { - - public: - TrkExtStoppingTarget() ; - ~TrkExtStoppingTarget() { } - - void initialize () ; - bool contains (CLHEP::Hep3Vector& p) ; - - private: - std::vector foil; - int nfoil; - std::string name; - double rmax, zmin, zmax; - - }; - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/inc/TrkExtToyDS.hh b/TrkExt/inc/TrkExtToyDS.hh deleted file mode 100644 index 4d2bc68900..0000000000 --- a/TrkExt/inc/TrkExtToyDS.hh +++ /dev/null @@ -1,39 +0,0 @@ -// -// ToyDS description for TrkExt -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtToyDS_HH -#define TrkExtToyDS_HH - -#include -#include -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtShape.hh" -#include "Offline/TrkExt/inc/TrkExtMaterial.hh" - -namespace mu2e { - - - class TrkExtToyDS : public TrkExtShape, public TrkExtMaterial - { - - public: - TrkExtToyDS() ; - ~TrkExtToyDS() { } - - void initialize () ; - bool contains (CLHEP::Hep3Vector& p) ; - - private: - std::string name; - double rin, rout, zmin, zmax; - - }; - -} // end namespace mu2e - - -#endif diff --git a/TrkExt/src/SConscript b/TrkExt/src/SConscript deleted file mode 100644 index c2bd7a5bed..0000000000 --- a/TrkExt/src/SConscript +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -# -# Script to build the files found in this directory. -# -# Original author Rob Kutschke. -# - -import os -Import('env') -Import('mu2e_helper') - -babarlibs = env['BABARLIBS'] -rootlibs = env['ROOTLIBS'] - -helper=mu2e_helper(env); - -mainlib = helper.make_mainlib ( [ 'mu2e_Mu2eBTrk', - 'mu2e_TrkReco', - 'mu2e_BTrkData', - 'mu2e_GeometryService', - 'mu2e_BFieldGeom', - 'mu2e_MECOStyleProtonAbsorberGeom', - 'mu2e_DetectorSolenoidGeom', - 'mu2e_StoppingTargetGeom', - 'mu2e_MCDataProducts', - 'mu2e_RecoDataProducts', - 'mu2e_ConfigTools', - 'mu2e_DataProducts', - babarlibs, - 'art_Framework_Core', - 'art_Framework_Principal', - 'art_Framework_Services_Registry', - 'art_root_io_TFileService', - 'art_root_io_tfile_support', - 'art_Persistency_Provenance', - 'art_Persistency_Common', - 'art_Utilities', - 'canvas', - 'fhiclcpp', - 'fhiclcpp_types', - 'tbb', - 'cetlib', - 'cetlib_except', - rootlibs, - 'CLHEP', - ] ) - -helper.make_plugins( [ mainlib, - 'mu2e_Mu2eBTrk', - 'mu2e_TrkReco', - 'mu2e_BTrkData', - 'mu2e_GeometryService', - 'mu2e_BFieldGeom', - 'mu2e_MCDataProducts', - 'mu2e_RecoDataProducts', - 'mu2e_DataProducts', - 'mu2e_GeneralUtilities', - babarlibs, - 'art_Framework_Core', - 'art_Framework_Principal', - 'art_Framework_Services_Registry', - 'art_root_io_tfile_support', - 'art_root_io_TFileService', - 'art_Framework_Services_Optional_RandomNumberGenerator', - 'art_Persistency_Common', - 'art_Persistency_Provenance', - 'art_Utilities', - 'canvas', - 'MF_MessageLogger', - 'fhiclcpp', - 'cetlib', - 'cetlib_except', - 'CLHEP', - rootlibs, - 'boost_filesystem', - ] ) - -# This tells emacs to view this file in python mode. -# Local Variables: -# mode:python -# End: diff --git a/TrkExt/src/TrkExtDetectors.cc b/TrkExt/src/TrkExtDetectors.cc deleted file mode 100644 index c0331052cd..0000000000 --- a/TrkExt/src/TrkExtDetectors.cc +++ /dev/null @@ -1,128 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// - -// C++ includes. -#include -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtDetectors.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - - - - - TrkExtDetectors::TrkExtDetectors() : TrkExtShape() - { - } - - void TrkExtDetectors::initialize() { - _ds.initialize(); - _pa.initialize(); - _st.initialize(); - } - - bool TrkExtDetectors::contains (Hep3Vector &xx) { - return _ds.contains(xx); - } - - TrkExtDetectorList::Enum TrkExtDetectors::volumeId(Hep3Vector & xx) { - if (_pa.contains(xx)) return TrkExtDetectorList::ProtonAbsorber; - else if (_st.contains(xx)) return TrkExtDetectorList::StoppingTarget; - else if (_ds.contains(xx)) return TrkExtDetectorList::ToyDS; - else return TrkExtDetectorList::Undefined; - } - - - - Hep3Vector TrkExtDetectors::intersection (const Hep3Vector & x1, const Hep3Vector & x2) { - TrkExtDetectorList::Enum f1, f2; - Hep3Vector xstart = x1; - Hep3Vector xstop = x2; - - f1 = volumeId(xstart); - f2 = volumeId(xstop); - if (f1 == f2) { - cerr << "TrkExtDetectors Warning : call intersection at wrong positions at begin " << f1 << xstart << ", " << f2 < _limit); - return xstop; - } - - double TrkExtDetectors::mostProbableEnergyLoss (const Hep3Vector& p, double ds, TrkExtDetectorList::Enum volid) { - switch (volid) { - case TrkExtDetectorList::ProtonAbsorber: - return _pa.mostProbableEnergyLoss(p, ds); - case TrkExtDetectorList::StoppingTarget: - return _st.mostProbableEnergyLoss(p, ds); - case TrkExtDetectorList::Undefined: - case TrkExtDetectorList::ToyDS: - default: - return 0; - } - return 0; - } - - - double TrkExtDetectors::meanEnergyLoss (const Hep3Vector& p, double ds, TrkExtDetectorList::Enum volid) { - switch (volid) { - case TrkExtDetectorList::ProtonAbsorber: - return _pa.meanEnergyLoss(p, ds); - case TrkExtDetectorList::StoppingTarget: - return _st.meanEnergyLoss(p, ds); - case TrkExtDetectorList::Undefined: - case TrkExtDetectorList::ToyDS: - default: - return 0; - } - return 0; - } - - double TrkExtDetectors::scatteringAngle (const CLHEP::Hep3Vector& p, double ds, TrkExtDetectorList::Enum volid) { - switch (volid) { - case TrkExtDetectorList::ProtonAbsorber: - return _pa.scatteringAngle(p, ds); - case TrkExtDetectorList::StoppingTarget: - return _st.scatteringAngle(p, ds); - case TrkExtDetectorList::Undefined: - case TrkExtDetectorList::ToyDS: - default: - return 0; - } - return 0; - } - - - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExtDiag.cc b/TrkExt/src/TrkExtDiag.cc deleted file mode 100644 index a7b1feca4d..0000000000 --- a/TrkExt/src/TrkExtDiag.cc +++ /dev/null @@ -1,978 +0,0 @@ -// -// Functions for reading TrkExt -// -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/fwd.h" -#include "art/Framework/Principal/Handle.h" -#include "art_root_io/TFileService.h" -#include "fhiclcpp/ParameterSet.h" - -#include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "Offline/TrkExt/inc/TrkExtDiag.hh" -#include "Offline/TrkExt/inc/TrkExtMCHits.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "BTrk/TrkBase/TrkHit.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/BField/BField.hh" -#include "BTrk/BField/BFieldFixed.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/BbrPointErr.hh" -#include "BTrk/BbrGeom/BbrError.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/GeometryService/inc/VirtualDetector.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/DataProducts/inc/PDGCode.hh" - -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "TTree.h" - -using namespace std; -using CLHEP::HepVector; -using CLHEP::Hep3Vector; - -namespace mu2e -{ - - TrkExtDiag::TrkExtDiag(fhicl::ParameterSet const& pset) : - _makerModuleLabel(pset.get("makerModuleLabel","makeSH")), - _g4ModuleLabel(pset.get("g4ModuleLabel","g4run")) - { } - - TrkExtDiag::~TrkExtDiag() { - } - - TTree* TrkExtDiag::createTrkExtDiag() { - art::ServiceHandle tfs; - - _extdiag = tfs->make("hTrk", "Track and recon info"); - //event-wide - _extdiag->Branch ("exitcode", &_exitcode, "exitcode/I"); - //hit - _extdiag->Branch ("nhots", &_nhots, "nhots/i"); - _extdiag->Branch ("hotx", _hotx, "hotx[nhots]/F"); - _extdiag->Branch ("hoty", _hoty, "hoty[nhots]/F"); - _extdiag->Branch ("hotz", _hotz, "hotz[nhots]/F"); - _extdiag->Branch ("hott0", _hott0, "hott0[nhots]/F"); - //trk - _extdiag->Branch ("ntrks", &_ntrks, "ntrks/i"); - _extdiag->Branch ("trkl0", &_trkl0, "trkl0/F"); - _extdiag->Branch ("trkl1", &_trkl1, "trkl1/F"); - _extdiag->Branch ("trkl", _trkl, "trkl[ntrks]/F"); - _extdiag->Branch ("trkx", _trkx, "trkx[ntrks]/F"); - _extdiag->Branch ("trky", _trky, "trky[ntrks]/F"); - _extdiag->Branch ("trkz", _trkz, "trkz[ntrks]/F"); - _extdiag->Branch ("trkpx", _trkpx, "trkpx[ntrks]/F"); - _extdiag->Branch ("trkpy", _trkpy, "trkpy[ntrks]/F"); - _extdiag->Branch ("trkpz", _trkpz, "trkpz[ntrks]/F"); - _extdiag->Branch ("trkp", _trkp, "trkp[ntrks]/F"); - _extdiag->Branch ("trk0", &_trk0, "d0/F:p0/F:om/F:z0/F:td/F:ed0/F:ep0/F:eom/F:ez0/F:etd/F"); - _extdiag->Branch ("trk1", &_trk1, "d0/F:p0/F:om/F:z0/F:td/F:ed0/F:ep0/F:eom/F:ez0/F:etd/F"); - //mc - _extdiag->Branch ("nsim", &_nsim, "nsim/i"); - _extdiag->Branch ("simx", _simx, "simx[nsim]/F"); - _extdiag->Branch ("simy", _simy, "simy[nsim]/F"); - _extdiag->Branch ("simz", _simz, "simz[nsim]/F"); - _extdiag->Branch ("simp0", &_simp0, "simp0/F"); - _extdiag->Branch ("simt0", &_simt0, "simt0/F"); - //mc - turn around point - _extdiag->Branch ("simtp", &_simtp, "x/F:y:z"); - _extdiag->Branch ("simtpqual", &_simtpqual, "simtpqual/I"); - //mc - pa and st - _extdiag->Branch ("nmcpa", &_nmcpa, "nmcpa/i"); - _extdiag->Branch ("nmcst", &_nmcst, "nmcst/i"); - _extdiag->Branch ("mcpapx", _mcpapx, "mcpapx[nmcpa]/F"); - _extdiag->Branch ("mcpapy", _mcpapy, "mcpapy[nmcpa]/F"); - _extdiag->Branch ("mcpapz", _mcpapz, "mcpapz[nmcpa]/F"); - _extdiag->Branch ("mcpap", _mcpap, "mcpap[nmcpa]/F"); - _extdiag->Branch ("mcpadp", _mcpadp, "mcpadp[nmcpa]/F"); - _extdiag->Branch ("mcpade", _mcpade, "mcpade[nmcpa]/F"); - _extdiag->Branch ("mcpadei", _mcpadei, "mcpadei[nmcpa]/F"); - _extdiag->Branch ("mcpadeni", _mcpadeni, "mcpadeni[nmcpa]/F"); - _extdiag->Branch ("mcpaz", _mcpaz, "mcpaz[nmcpa]/F"); - _extdiag->Branch ("mcstpx", _mcstpx, "mcstpx[nmcst]/F"); - _extdiag->Branch ("mcstpy", _mcstpy, "mcstpy[nmcst]/F"); - _extdiag->Branch ("mcstpz", _mcstpz, "mcstpz[nmcst]/F"); - _extdiag->Branch ("mcstp", _mcstp, "mcstp[nmcst]/F"); - _extdiag->Branch ("mcstdp", _mcstdp, "mcstdp[nmcst]/F"); - _extdiag->Branch ("mcstde", _mcstde, "mcstde[nmcst]/F"); - _extdiag->Branch ("mcstdei", _mcstdei, "mcstdei[nmcst]/F"); - _extdiag->Branch ("mcstdeni", _mcstdeni, "mcstdeni[nmcst]/F"); - _extdiag->Branch ("mcstx", _mcstx, "mcstx[nmcst]/F"); - _extdiag->Branch ("mcsty", _mcsty, "mcsty[nmcst]/F"); - _extdiag->Branch ("mcstz", _mcstz, "mcstz[nmcst]/F"); - _extdiag->Branch ("mcstt", _mcstt, "mcstt[nmcst]/F"); - // mc - vd - _extdiag->Branch ("vdsi", &_vdsi, "x[2]/F:y[2]/F:z[2]/F:px[2]/F:py[2]/F:pz[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:status/i"); - _extdiag->Branch ("vdso", &_vdso, "x[2]/F:y[2]/F:z[2]/F:px[2]/F:py[2]/F:pz[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:status/i"); - _extdiag->Branch ("vdtf", &_vdtf, "x[2]/F:y[2]/F:z[2]/F:px[2]/F:py[2]/F:pz[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:status/i"); - _extdiag->Branch ("vdtm", &_vdtm, "x[2]/F:y[2]/F:z[2]/F:px[2]/F:py[2]/F:pz[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:status/i"); - _extdiag->Branch ("vdtb", &_vdtb, "x[2]/F:y[2]/F:z[2]/F:px[2]/F:py[2]/F:pz[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:status/i"); - // trkext - _extdiag->Branch ("next", &_next, "next/i"); - _extdiag->Branch ("extx", _extx, "extx[next]/F"); - _extdiag->Branch ("exty", _exty, "exty[next]/F"); - _extdiag->Branch ("extz", _extz, "extz[next]/F"); - _extdiag->Branch ("extpx", _extpx, "extpx[next]/F"); - _extdiag->Branch ("extpy", _extpy, "extpy[next]/F"); - _extdiag->Branch ("extpz", _extpz, "extpz[next]/F"); - _extdiag->Branch ("extp", _extp, "extp[next]/F"); - _extdiag->Branch ("extrho", _extrho, "extrho[next]/F"); - _extdiag->Branch ("exts", _exts, "exts[next]/F"); - _extdiag->Branch ("extt", _extt, "extt[next]/F"); - _extdiag->Branch ("extex", _extex, "extex[next]/F"); - _extdiag->Branch ("extey", _extey, "extey[next]/F"); - _extdiag->Branch ("extez", _extez, "extez[next]/F"); - _extdiag->Branch ("extepx", _extepx, "extepx[next]/F"); - _extdiag->Branch ("extepy", _extepy, "extepy[next]/F"); - _extdiag->Branch ("extepz", _extepz, "extepz[next]/F"); - _extdiag->Branch ("extep", _extep, "extep[next]/F"); - _extdiag->Branch ("exter", _exter, "exter[next]/F"); - _extdiag->Branch ("extvid", _extvid, "extvid[next]/I"); - // trkext - pa and st - _extdiag->Branch ("nextpa", &_nextpa, "nextpa/i"); - _extdiag->Branch ("nextst", &_nextst, "nextst/i"); - _extdiag->Branch ("extpaz", _extpaz, "extpaz[nextpa]/F"); - _extdiag->Branch ("extpadp",&_extpadp, "extpadp[nextpa]/F"); - _extdiag->Branch ("extpadptot", &_extpadptot, "extpadptot/F"); - _extdiag->Branch ("extstx", _extstx, "extstx[nextst]/F"); - _extdiag->Branch ("extsty", _extsty, "extsty[nextst]/F"); - _extdiag->Branch ("extstz", _extstz, "extstz[nextst]/F"); - _extdiag->Branch ("extstt", _extstt, "extstt[nextst]/F"); - _extdiag->Branch ("extstdp", _extstdp, "extstdp[nextst]/F"); - _extdiag->Branch ("extstdptot", &_extstdptot, "extstdptot/F"); - // trkext - vd - _extdiag->Branch ("extvdsi", &_extvdsi, "r[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:er[2]/F:ep[2]/F:ed0[2]/F:ep0[2]/F:eom[2]/F:ez0[2]/F:etd[2]/F:status/i"); - _extdiag->Branch ("extvdso", &_extvdso, "r[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:er[2]/F:ep[2]/F:ed0[2]/F:ep0[2]/F:eom[2]/F:ez0[2]/F:etd[2]/F:status/i"); - _extdiag->Branch ("extvdtf", &_extvdtf, "r[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:er[2]/F:ep[2]/F:ed0[2]/F:ep0[2]/F:eom[2]/F:ez0[2]/F:etd[2]/F:status/i"); - _extdiag->Branch ("extvdtm", &_extvdtm, "r[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:er[2]/F:ep[2]/F:ed0[2]/F:ep0[2]/F:eom[2]/F:ez0[2]/F:etd[2]/F:status/i"); - _extdiag->Branch ("extvdtb", &_extvdtb, "r[2]/F:p[2]/F:d0[2]/F:p0[2]/F:om[2]/F:z0[2]/F:td[2]/F:er[2]/F:ep[2]/F:ed0[2]/F:ep0[2]/F:eom[2]/F:ez0[2]/F:etd[2]/F:status/i"); - // trkext - turn around point - _extdiag->Branch ("extitp", &_extitp, "extitp/I"); - _extdiag->Branch ("exttp", &_exttp, "x/F:y:z:px:py:pz:t:s:volid/I"); - ; - return _extdiag; - } - - void TrkExtDiag::setRunInfo(){ - GeomHandle det; - _origin = det->toMu2e( CLHEP::Hep3Vector(0.,0.,0.) ); // add this to transfer detector coord. to mu2e coord. - _vdzsi = _vdzso = _vdztf = _vdztm = _vdztb = 0; - GeomHandle vd; - _vdzsi = (vd->getGlobal(VirtualDetectorId::ST_In) - _origin).z(); - _vdzso = (vd->getGlobal(VirtualDetectorId::ST_Out) - _origin).z(); - _vdztf = (vd->getGlobal(VirtualDetectorId::TT_FrontHollow) - _origin).z(); - _vdztm = (vd->getGlobal(VirtualDetectorId::TT_MidInner) - _origin).z(); - _vdztb = (vd->getGlobal(VirtualDetectorId::TT_Back) - _origin).z(); - } - - void TrkExtDiag::setSubRunInfo(){ - _bfMgr = GeomHandle().get(); - } - - HepVector TrkExtDiag::getHelixParameters (const Hep3Vector & x, const Hep3Vector & p, int sign) const { - HepVector hpar(6); - const HepPoint vertex(x.x(), x.y(), x.z()); - double Bz = (_bfMgr->getBField(x + _origin)).z(); - double fltlen = 0.; - TrkHelixUtils::helixFromMom(hpar, fltlen, vertex, p, -1.*(double)sign, Bz); - return hpar; - } - - HepVector TrkExtDiag::getHelixParametersErr (const Hep3Vector & x, const Hep3Vector & p, Hep3Vector & ex, Hep3Vector & ep, int sign) const { - HepVector hpar(6); - const HepPoint vertex(x.x(), x.y(), x.z()); - Hep3Vector B = _bfMgr->getBField(x + _origin); - //double fltlen = 0.; - BbrError exm(3); - BbrError epm(3); - exm(1,1) = ex.x(); - exm(2,2) = ex.y(); - exm(3,3) = ex.z(); - epm(1,1) = ep.x(); - epm(2,2) = ep.y(); - epm(3,3) = ep.z(); - BbrPointErr pos(vertex, exm); - BbrVectorErr pmom(p, epm); - HepMatrix cxp(3,3,0); - BFieldFixed fieldmap (B.x(), B.y(), B.z()); - - HelixParams hepar = TrkHelixUtils::helixFromMomErr ( pos, pmom, cxp, -1.*(double) sign, fieldmap) ; - const HepSymMatrix & cov = hepar.covariance(); - for (int i = 1 ; i <= 6 ; ++i) { - hpar(i) = sqrt(cov(i,i)); - } - return hpar; - } - - double TrkExtDiag::findTurnAroundSim (int i, double f1, double f2, double f3) { - double a = 0.5*f1 - f2 + 0.5*f3; - double b = -0.5*f1*(2*i+1) + f2*(2*i) - 0.5*f3*(2*i-1); - if (a!=0) return -b/2./a; - else return 0; - } - - double TrkExtDiag::findTurnAround (double s1, double s2, double s3, double f1, double f2, double f3) { - double s1s2 = s1-s2; - double s2s3 = s2-s3; - double s3s1 = s3-s1; - double a = -f1/s1s2/s3s1 - f2/s1s2/s2s3 - f3/s3s1/s2s3; - double b = +f1*(s2+s3)/s1s2/s3s1 + f2*(s1+s3)/s1s2/s2s3 + f3*(s1+s2)/s3s1/s2s3; - double c = -f1*s2*s3/s1s2/s3s1 - f2*s1*s3/s1s2/s2s3 - f3*s1*s2/s3s1/s2s3; - double D = b*b-4.*a*c; - if (D>=0) { - double r1 = (-b+sqrt(D))/2./a; - double r2 = (-b-sqrt(D))/2./a; - double d1 = fabs(r1-s2); - double d2 = fabs(r2-s2); - if (d1>d2) return r2; - else if (d2>d1) return r1; - else return 0.5*(r1+r2); - } - else { - return 0; - } - } - - double TrkExtDiag::interpolate2 (double s, double s1, double s2, double f1, double f2) { - return (f2-f1)/(s2-s1)*(s-s1)+f1; - } - - double TrkExtDiag::interpolate (double s, double s1, double s2, double s3, double f1, double f2, double f3) { - double s1s2 = s1-s2; - double s2s3 = s2-s3; - double s3s1 = s3-s1; - return -f1*(s-s2)*(s-s3)/s1s2/s3s1 - f2*(s-s1)*(s-s3)/s1s2/s2s3 - f3*(s-s1)*(s-s2)/s3s1/s2s3; - } - - double TrkExtDiag::getRadialError (const CLHEP::Hep3Vector & xx, const CLHEP::HepMatrix & cov) { - double r = xx.rho(); - double x = xx.x(); - double y = xx.y(); - if (r == 0) r = 0.001; - //cout << xx<Fill(); - } - - void TrkExtDiag::trkExtDiag() { - _nhots = 0; - _ntrks = 0; - _trkl0 = _trkl1 = 0; - _trk0.d0 = _trk0.z0 = _trk0.p0 = _trk0.om = _trk0.td = 0; - _trk1.d0 = _trk1.z0 = _trk1.p0 = _trk1.om = _trk1.td = 0; - _nsim = 0; - _simp0 = _simt0 = 0; - _nmcpa = _nmcst = 0; - _vdsi.status = 0; - _vdso.status = 0; - _vdtf.status = 0; - _vdtm.status = 0; - _vdtb.status = 0; - _next = 0; - _nextpa = _nextst = 0; - _extpadptot = _extstdptot = 0; - _extvdsi.status = 0; - _extvdso.status = 0; - _extvdtf.status = 0; - _extvdtm.status = 0; - _extvdtb.status = 0; - _extdiag->Fill(); - } - - ///////////// - // readHit // - ///////////// - - unsigned int TrkExtDiag::readHit(const art::Event &evt, const TrkHitVector & hots) { - unsigned int i = 0; - for (auto iter = hots.begin() ; iter != hots.end() ; ++iter) { - const TrkHit * hit = *iter; - const mu2e::TrkStrawHit* strawHit = dynamic_cast(hit); - if (strawHit) { - const HepPoint &point = strawHit->hitTraj()->position(strawHit->hitLen()); - _hotx[i] = point.x(); - _hoty[i] = point.y(); - _hotz[i] = point.z(); - _hott0[i] = strawHit->hitT0()._t0 / CLHEP::ns; - ++i; - } - if (i >= MAXNHOT) { - cerr << "TrkExtDiag warning : MAXNHOT reached. Remaining are ignored" <(hit); - if (trkstrawHit == nullptr) { - cerr << "TrkExtDiag warning : no trkstrawHit" <comboHit(); - - art::Handle shcHandle; - evt.getByLabel(_makerModuleLabel, shcHandle); - if (!(shcHandle.isValid())) { - cerr << "TrkExtDiag warning : shcHandle invalid" << endl; - continue; - } - - ComboHitCollection const& shc = *shcHandle; - int hitid = -1; - - for (i = 0 ; i stepsCHandle; - evt.getByLabel(_makerModuleLabel, "StrawHitMCPtr", stepsCHandle); - if (!(stepsCHandle.isValid())) { - cerr << "TrkExtDiag warning : stepsCHandle invalid" << endl; - continue; - } - PtrStepPointMCVectorCollection const & stepsC = *stepsCHandle; - - if (stepsC.size() <=0) { - cerr << "TrkExtDiag warning : no stepsC" << endl; - continue; - } - - PtrStepPointMCVector const & steps (stepsC.at(hitid)); - - if (steps.size() <=0) { - cerr << "TrkExtDiag warning : no steps" << endl; - continue; - } - - StepPointMC const & step = *steps.at(0); - - SimParticle const &sim = *step.simParticle(); - - cet::map_vector_key simid = sim.id(); - - // art::Handle trajHandle; - // evt.getByLabel(_g4ModuleLabel, trajHandle); - // if (!(trajHandle.isValid())) { - // cerr << "TrkExtDiag warning : tragHandle invalid" << endl; - // continue; - // } - // - // const PointTrajectoryCollection & trajC = *trajHandle; - // - // const PointTrajectory* traj = trajC.getOrNull(simid); - // if (traj == nullptr) { - // cerr << "TrkExtDiag warning : traj invalid" << endl; - // continue; - // } - // - - //const vector& pvec = traj->points(); - const vector pvec; // PointTrajectoryCollection has been gone for years. Leave a dummy variable here to not break compilation; there is a request to not remove this file. - - double simstep = 1.; - if (pvec.size() >= MAXNSIM) { - simstep = (double)pvec.size() / (double)MAXNSIM; - } - minsim = pvec.size(); - if (minsim > MAXNSIM) minsim = MAXNSIM; - - for (i = 0 ; i < minsim ; ++i) { - j = (int)(simstep*i+0.5); - if (j >= pvec.size()) j = pvec.size() -1; - Hep3Vector position = pvec[j]; - _simx[i] = position.x(); - _simy[i] = position.y(); - _simz[i] = position.z() + 1800; - } - _simtp.z = 99999; - _simtpqual = -1; - - for (i = 1 ; i < pvec.size()-1 ; ++i) { - double z1 = pvec[i-1].z(); - double z2 = pvec[i].z(); - double z3 = pvec[i+1].z(); - if (z2+1800.>0) break; - if ((z3-z2)*(z1-z2)> 0) { - if (i>10 && i+10 0) _simtpqual = 3; - else _simtpqual = 2; - } - else { - _simtpqual = 1; - } - double ic = findTurnAroundSim (i, z1, z2, z3); - if (ic>0) { - double i1 = (double)((int)ic); - double i2 = i1+1; - Hep3Vector p1 = pvec[i1]; - Hep3Vector p2 = pvec[i2]; - _simtp.x = interpolate2(ic, i1, i2, p1.x(), p2.x()); - _simtp.y = interpolate2(ic, i1, i2, p1.y(), p2.y()); - _simtp.z = interpolate2(ic, i1, i2, p1.z(), p2.z()) + 1800.; - } - break; - } - } - - _simt0 = sim.startGlobalTime(); - _simp0 = sim.startMomentum().vect().mag(); - - readflag = true; - - //readvd - _vdsi.clear(); - _vdso.clear(); - _vdtf.clear(); - _vdtm.clear(); - _vdtb.clear(); - TrkExtMCHits mcvd(evt, _g4ModuleLabel, "virtualdetector", simid); - int hepid = sim.pdgId(); - int sign; - if (hepid == PDGCode::e_minus || hepid == PDGCode::mu_minus || hepid == PDGCode::pi_minus || hepid == PDGCode::K_minus || hepid == PDGCode::anti_proton) sign = 1; - else if (hepid == PDGCode::e_plus || hepid == PDGCode::mu_plus || hepid == PDGCode::pi_plus || hepid == PDGCode::K_plus || hepid == PDGCode::proton) sign = -1; - else sign = 0; - for (i = 0 ; i =0) index = 0; - else index = 1; - switch (firsthit.volumeId()) { - case VirtualDetectorId::ST_In : - if ( _vdsi.status & (unsigned int)(index+1) ) { - cerr << "TrkExtDiag warning : Too many VD hit at " << firsthit.volumeId() << ". Ignored." << endl; - continue; - } - _vdsi.x[index] = pos.x(); - _vdsi.y[index] = pos.y(); - _vdsi.z[index] = pos.z(); - _vdsi.px[index] = mom.x(); - _vdsi.py[index] = mom.y(); - _vdsi.pz[index] = mom.z(); - _vdsi.p[index] = mom.mag(); - hpar = getHelixParameters (pos, mom, sign); - _vdsi.d0[index] = hpar(1); - _vdsi.p0[index] = hpar(2); - _vdsi.om[index] = hpar(3); - _vdsi.z0[index] = hpar(4); - _vdsi.td[index] = hpar(5); - _vdsi.status = _vdsi.status | (unsigned int)(index+1); - break; - case VirtualDetectorId::ST_Out : - if ( _vdso.status & (unsigned int)(index+1) ) { - cerr << "TrkExtDiag warning : Too many VD hit at " << firsthit.volumeId() << ". Ignored." << endl; - continue; - } - _vdso.x[index] = pos.x(); - _vdso.y[index] = pos.y(); - _vdso.z[index] = pos.z(); - _vdso.px[index] = mom.x(); - _vdso.py[index] = mom.y(); - _vdso.pz[index] = mom.z(); - _vdso.p[index] = mom.mag(); - hpar = getHelixParameters (pos, mom, sign); - _vdso.d0[index] = hpar(1); - _vdso.p0[index] = hpar(2); - _vdso.om[index] = hpar(3); - _vdso.z0[index] = hpar(4); - _vdso.td[index] = hpar(5); - _vdso.status = _vdso.status | (unsigned int)(index+1); - break; - case VirtualDetectorId::TT_FrontHollow : - case VirtualDetectorId::TT_FrontPA : - if ( _vdtf.status & (unsigned int)(index+1) ) { - cerr << "TrkExtDiag warning : Too many VD hit at " << firsthit.volumeId() << ". Ignored." << endl; - continue; - } - _vdtf.x[index] = pos.x(); - _vdtf.y[index] = pos.y(); - _vdtf.z[index] = pos.z(); - _vdtf.px[index] = mom.x(); - _vdtf.py[index] = mom.y(); - _vdtf.pz[index] = mom.z(); - _vdtf.p[index] = mom.mag(); - hpar = getHelixParameters (pos, mom, sign); - _vdtf.d0[index] = hpar(1); - _vdtf.p0[index] = hpar(2); - _vdtf.om[index] = hpar(3); - _vdtf.z0[index] = hpar(4); - _vdtf.td[index] = hpar(5); - _vdtf.status = _vdtf.status | (unsigned int)(index+1); - break; - case VirtualDetectorId::TT_MidInner : - case VirtualDetectorId::TT_Mid : - if ( _vdtm.status & (unsigned int)(index+1) ) { - cerr << "TrkExtDiag warning : Too many VD hit at " << firsthit.volumeId() << ". Ignored." << endl; - continue; - } - _vdtm.x[index] = pos.x(); - _vdtm.y[index] = pos.y(); - _vdtm.z[index] = pos.z(); - _vdtm.px[index] = mom.x(); - _vdtm.py[index] = mom.y(); - _vdtm.pz[index] = mom.z(); - _vdtm.p[index] = mom.mag(); - hpar = getHelixParameters (pos, mom, sign); - _vdtm.d0[index] = hpar(1); - _vdtm.p0[index] = hpar(2); - _vdtm.om[index] = hpar(3); - _vdtm.z0[index] = hpar(4); - _vdtm.td[index] = hpar(5); - _vdtm.status = _vdtm.status | (unsigned int)(index+1); - break; - case VirtualDetectorId::TT_Back : - if ( _vdtb.status & (unsigned int)(index+1) ) { - cerr << "TrkExtDiag warning : Too many VD hit at " << firsthit.volumeId() << ". Ignored." << endl; - continue; - } - _vdtb.x[index] = pos.x(); - _vdtb.y[index] = pos.y(); - _vdtb.z[index] = pos.z(); - _vdtb.px[index] = mom.x(); - _vdtb.py[index] = mom.y(); - _vdtb.pz[index] = mom.z(); - _vdtb.p[index] = mom.mag(); - hpar = getHelixParameters (pos, mom, sign); - _vdtb.d0[index] = hpar(1); - _vdtb.p0[index] = hpar(2); - _vdtb.om[index] = hpar(3); - _vdtb.z0[index] = hpar(4); - _vdtb.td[index] = hpar(5); - _vdtb.status = _vdtb.status | (unsigned int)(index+1); - break; - default : - break; - } - } - - // pa - TrkExtMCHits mcpa(evt, _g4ModuleLabel, "protonabsorber", simid); - _nmcpa = mcpa.getNClusters(); - for (i = 0 ; i < _nmcpa ; ++i) { - if (i >= MAXNPA) { - cerr << "ReadTrkExt : too many PA hits " << mcpa.getNClusters() << endl; - break; - } - Hep3Vector mom = mcpa.momentum(i); - Hep3Vector pos = mcpa.position(i) - _origin; - _mcpapx[i] = mom.x(); - _mcpapy[i] = mom.y(); - _mcpapz[i] = mom.z(); - _mcpap[i] = mom.mag(); - _mcpaz[i] = pos.z(); - _mcpadp[i] = mcpa.deltap(i); - _mcpade[i] = mcpa.eDep(i); - _mcpadei[i] = mcpa.ionizingEdep(i); - _mcpadeni[i] = mcpa.nonIonizingEdep(i); - } - - // st - TrkExtMCHits mcst(evt, _g4ModuleLabel, "stoppingtarget", simid); - _nmcst = mcst.getNClusters(); - for (i = 0 ; i < _nmcst ; ++i) { - if (i >= MAXNST) { - cerr << "ReadTrkExt : too many ST hits " << mcst.getNClusters() << endl; - break; - } - Hep3Vector mom = mcst.momentum(i); - Hep3Vector pos = mcst.position(i) - _origin; - _mcstpx[i] = mom.x(); - _mcstpy[i] = mom.y(); - _mcstpz[i] = mom.z(); - _mcstp[i] = mom.mag(); - _mcstx[i] = pos.x(); - _mcsty[i] = pos.y(); - _mcstz[i] = pos.z(); - _mcstt[i] = mcst.time(i); - _mcstdp[i] = mcst.deltap(i); - _mcstde[i] = mcst.eDep(i); - _mcstdei[i] = mcst.ionizingEdep(i); - _mcstdeni[i] = mcst.nonIonizingEdep(i); - } - - } // end of hot loop - - if (!readflag) { - cerr << "TrkExtDiag Error: Cannot read MC information" << endl; - return 0; - } - return minsim; - } - - ///////////// - // readExt // - ///////////// - - unsigned int TrkExtDiag::readExt(const art::Event &evt, const TrkExtTraj & trkext){ - unsigned int i; - // trkext - double x, y, z, px, py, pz, p, rho; - int turnaround = -1; - for (i = 0 ; i < trkext.size() ; ++i) { - const TrkExtTrajPoint & hit = trkext[i]; - _extx[i] = x = hit.x(); - _exty[i] = y = hit.y(); - _extz[i] = z = hit.z(); - _extrho[i] = rho = hit.rho(); - _extp[i] = p = hit.p(); - _extpx[i] = px = hit.px(); - _extpy[i] = py = hit.py(); - _extpz[i] = pz = hit.pz(); - _extex[i] = hit.ex(); - _extey[i] = hit.ey(); - _extez[i] = hit.ez(); - _extepx[i] = hit.epx(); - _extepy[i] = hit.epy(); - _extepz[i] = hit.epz(); - _extep[i] = safeSqrt( hit.covpxpx()*px*px + hit.covpypy()*py*py + hit.covpzpz()*pz*pz + 2.*px*py*hit.covpxpy() + 2.*py*pz*hit.covpypz() + 2.*pz*px*hit.covpxpz() ) / p; - _exter[i] = safeSqrt( hit.covxx()*x*x + hit.covyy()*y*y + 2.*x*y*hit.covxy() ) / rho; - _extvid[i] = hit.volumeId(); - _extt[i] = hit.flightTime(); - _exts[i] = hit.flightLength(); - if (i>0) { - if (_extpz[i] * _extpz[i-1] <=0) turnaround = i; - } - } - - // turn around point - _extitp = turnaround; - _exttp.s = 0; - if (int(_extitp-1) >=0 && int(_extitp +1) vdsihits = trkext.getPointsAtZ(_vdzsi); - for (i = 0 ; i < vdsihits.size() ; ++i) { - unsigned int index; - if (vdsihits[i].pz()>=0) index = 0; - else index = 1; - if (_extvdsi.status & (unsigned int)(index+1)) { - cout << "TrkExtDiag warning : more than 2 same directional hits in VDsi : " << endl; - continue; - } - _extvdsi.r[index] = vdsihits[i].rho(); - _extvdsi.p[index] = vdsihits[i].p(); - const Hep3Vector & pos = vdsihits[i].position(); - const Hep3Vector & mom = vdsihits[i].momentum(); - const HepMatrix & cov = vdsihits[i].covariance(); - _extvdsi.er[index] = getRadialError(pos, cov); - _extvdsi.ep[index] = getMomentumError(mom, cov); - //cout << _extvdsi.er[index] <<", " <<_extvdsi.ep[index] << endl; - HepVector hpar = getHelixParameters (pos, mom, sign); - Hep3Vector poserr = vdsihits[i].positionError(); - Hep3Vector momerr = vdsihits[i].momentumError(); - HepVector hepar = getHelixParametersErr (pos, mom, poserr, momerr, sign); - _extvdsi.d0[index] = hpar(1); - _extvdsi.p0[index] = hpar(2); - _extvdsi.om[index] = hpar(3); - _extvdsi.z0[index] = hpar(4); - _extvdsi.td[index] = hpar(5); - _extvdsi.ed0[index] = hepar(1); - _extvdsi.ep0[index] = hepar(2); - _extvdsi.eom[index] = hepar(3); - _extvdsi.ez0[index] = hepar(4); - _extvdsi.etd[index] = hepar(5); - _extvdsi.status = _extvdsi.status | (unsigned int)(index+1); - } - - std::vector vdsohits = trkext.getPointsAtZ(_vdzso); - for (i = 0 ; i < vdsohits.size() ; ++i) { - unsigned int index; - if (vdsohits[i].pz()>=0) index = 0; - else index = 1; - if (_extvdso.status & (unsigned int)(index+1)) { - cout << "TrkExtDiag warning : more than 2 same directional hits in VDsi : " << endl; - continue; - } - _extvdso.r[index] = vdsohits[i].rho(); - _extvdso.p[index] = vdsohits[i].p(); - const Hep3Vector & pos = vdsohits[i].position(); - const Hep3Vector & mom = vdsohits[i].momentum(); - const HepMatrix & cov = vdsohits[i].covariance(); - _extvdso.er[index] = getRadialError(pos, cov); - _extvdso.ep[index] = getMomentumError(mom, cov); - HepVector hpar = getHelixParameters (pos, mom, sign); - Hep3Vector poserr = vdsohits[i].positionError(); - Hep3Vector momerr = vdsohits[i].momentumError(); - HepVector hepar = getHelixParametersErr (pos, mom, poserr, momerr, sign); - _extvdso.d0[index] = hpar(1); - _extvdso.p0[index] = hpar(2); - _extvdso.om[index] = hpar(3); - _extvdso.z0[index] = hpar(4); - _extvdso.td[index] = hpar(5); - _extvdso.ed0[index] = hepar(1); - _extvdso.ep0[index] = hepar(2); - _extvdso.eom[index] = hepar(3); - _extvdso.ez0[index] = hepar(4); - _extvdso.etd[index] = hepar(5); - _extvdso.status = _extvdso.status | (unsigned int)(index+1); - } - - std::vector vdtfhits = trkext.getPointsAtZ(_vdztf); - for (i = 0 ; i < vdtfhits.size() ; ++i) { - unsigned int index; - if (vdtfhits[i].pz()>=0) index = 0; - else index = 1; - if (_extvdtf.status & (unsigned int)(index+1)) { - cout << "TrkExtDiag warning : more than 2 same directional hits in VDsi : " << endl; - continue; - } - _extvdtf.r[index] = vdtfhits[i].rho(); - _extvdtf.p[index] = vdtfhits[i].p(); - const Hep3Vector & pos = vdtfhits[i].position(); - const Hep3Vector & mom = vdtfhits[i].momentum(); - const HepMatrix & cov = vdtfhits[i].covariance(); - _extvdtf.er[index] = getRadialError(pos, cov); - _extvdtf.ep[index] = getMomentumError(mom, cov); - HepVector hpar = getHelixParameters (pos, mom, sign); - Hep3Vector poserr = vdtfhits[i].positionError(); - Hep3Vector momerr = vdtfhits[i].momentumError(); - HepVector hepar = getHelixParametersErr (pos, mom, poserr, momerr, sign); - _extvdtf.d0[index] = hpar(1); - _extvdtf.p0[index] = hpar(2); - _extvdtf.om[index] = hpar(3); - _extvdtf.z0[index] = hpar(4); - _extvdtf.td[index] = hpar(5); - _extvdtf.ed0[index] = hepar(1); - _extvdtf.ep0[index] = hepar(2); - _extvdtf.eom[index] = hepar(3); - _extvdtf.ez0[index] = hepar(4); - _extvdtf.etd[index] = hepar(5); - _extvdtf.status = _extvdtf.status | (unsigned int)(index+1); - } - - std::vector vdtmhits = trkext.getPointsAtZ(_vdztm); - for (i = 0 ; i < vdtmhits.size() ; ++i) { - unsigned int index; - if (vdtmhits[i].pz()>=0) index = 0; - else index = 1; - if (_extvdtm.status & (unsigned int)(index+1)) { - cout << "TrkExtDiag warning : more than 2 same directional hits in VDsi : " << endl; - continue; - } - _extvdtm.r[index] = vdtmhits[i].rho(); - _extvdtm.p[index] = vdtmhits[i].p(); - const Hep3Vector & pos = vdtmhits[i].position(); - const Hep3Vector & mom = vdtmhits[i].momentum(); - const HepMatrix & cov = vdtmhits[i].covariance(); - _extvdtm.er[index] = getRadialError(pos, cov); - _extvdtm.ep[index] = getMomentumError(mom, cov); - HepVector hpar = getHelixParameters (pos, mom, sign); - Hep3Vector poserr = vdtmhits[i].positionError(); - Hep3Vector momerr = vdtmhits[i].momentumError(); - HepVector hepar = getHelixParametersErr (pos, mom, poserr, momerr, sign); - _extvdtm.d0[index] = hpar(1); - _extvdtm.p0[index] = hpar(2); - _extvdtm.om[index] = hpar(3); - _extvdtm.z0[index] = hpar(4); - _extvdtm.td[index] = hpar(5); - _extvdtm.ed0[index] = hepar(1); - _extvdtm.ep0[index] = hepar(2); - _extvdtm.eom[index] = hepar(3); - _extvdtm.ez0[index] = hepar(4); - _extvdtm.etd[index] = hepar(5); - _extvdtm.status = _extvdtm.status | (unsigned int)(index+1); - } - - std::vector vdtbhits = trkext.getPointsAtZ(_vdztb); - for (i = 0 ; i < vdtbhits.size() ; ++i) { - unsigned int index; - if (vdtbhits[i].pz()>=0) index = 0; - else index = 1; - if (_extvdtb.status & (unsigned int)(index+1)) { - cout << "TrkExtDiag warning : more than 2 same directional hits in VDsi : " << endl; - continue; - } - _extvdtb.r[index] = vdtbhits[i].rho(); - _extvdtb.p[index] = vdtbhits[i].p(); - const Hep3Vector & pos = vdtbhits[i].position(); - const Hep3Vector & mom = vdtbhits[i].momentum(); - const HepMatrix & cov = vdtbhits[i].covariance(); - _extvdtb.er[index] = getRadialError(pos, cov); - _extvdtb.ep[index] = getMomentumError(mom, cov); - HepVector hpar = getHelixParameters (pos, mom, sign); - Hep3Vector poserr = vdtbhits[i].positionError(); - Hep3Vector momerr = vdtbhits[i].momentumError(); - HepVector hepar = getHelixParametersErr (pos, mom, poserr, momerr, sign); - _extvdtb.d0[index] = hpar(1); - _extvdtb.p0[index] = hpar(2); - _extvdtb.om[index] = hpar(3); - _extvdtb.z0[index] = hpar(4); - _extvdtb.td[index] = hpar(5); - _extvdtb.ed0[index] = hepar(1); - _extvdtb.ep0[index] = hepar(2); - _extvdtb.eom[index] = hepar(3); - _extvdtb.ez0[index] = hepar(4); - _extvdtb.etd[index] = hepar(5); - _extvdtb.status = _extvdtb.status | (unsigned int)(index+1); - } - - // exitcode - _exitcode = trkext.exitCode(); - - return trkext.size(); - } - -} diff --git a/TrkExt/src/TrkExtInstanceName.cc b/TrkExt/src/TrkExtInstanceName.cc deleted file mode 100644 index 3b7687a731..0000000000 --- a/TrkExt/src/TrkExtInstanceName.cc +++ /dev/null @@ -1,99 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// Note : See the included file for particle/direction definitions. -// -// In TrkParticle : -// eMinus, ePlus, muMinus, muPlus, piMunis, piPlus, KMilus, KPlus -// are defined. -// In TrkFitDirection: -// Upstream=1, Downstream=0 -// are assigned. -// instance = fdir.name() + tpart.name() -// - -// C++ includes. -#include -#include -#include - -// Framework includes. - -#include "Offline/TrkExt/inc/TrkExtInstanceName.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "BTrk/TrkBase/TrkParticle.hh" - - -using namespace std; - -namespace mu2e { - - TrkExtInstanceNameEntry::TrkExtInstanceNameEntry (TrkParticle::type _hepid, bool _up_down, std::string _fitterName) : - fitterName(_fitterName) - { - switch (_hepid) { - case TrkParticle::e_minus: - charge = -1; - mass2 = TrkExtParticleMass::MASS_ELECTRON * TrkExtParticleMass::MASS_ELECTRON; - break; - case TrkParticle::e_plus: - charge = 1; - mass2 = TrkExtParticleMass::MASS_ELECTRON * TrkExtParticleMass::MASS_ELECTRON; - break; - case TrkParticle::mu_minus: - charge = -1; - mass2 = TrkExtParticleMass::MASS_MUON * TrkExtParticleMass::MASS_MUON; - break; - case TrkParticle::mu_plus: - charge = 1; - mass2 = TrkExtParticleMass::MASS_MUON * TrkExtParticleMass::MASS_MUON; - break; - case TrkParticle::pi_minus: - charge = -1; - mass2 = TrkExtParticleMass::MASS_PION * TrkExtParticleMass::MASS_PION; - break; - case TrkParticle::pi_plus: - charge = 1; - mass2 = TrkExtParticleMass::MASS_PION * TrkExtParticleMass::MASS_PION; - break; - case TrkParticle::p_plus: - charge = 1; - mass2 = TrkExtParticleMass::MASS_PROTON * TrkExtParticleMass::MASS_PROTON; - break; - case TrkParticle::anti_p_minus: - charge = -1; - mass2 = TrkExtParticleMass::MASS_PROTON * TrkExtParticleMass::MASS_PROTON; - break; - default: - cerr << "TrkExtInstanceNameEntry Error: not implemented mode" << endl; - charge = 0; - mass2 = 0; - } - updown = _up_down; - hepid = (int)_hepid; - string fitDirName; - if (updown) fitDirName = TrkFitDirection(TrkFitDirection::upstream).name(); - else fitDirName = TrkFitDirection(TrkFitDirection::downstream).name(); - string fitPtlName = TrkParticle(_hepid).name(); - - name = fitDirName + fitPtlName; - ntrk = 0; - } - - - - TrkExtInstanceName::TrkExtInstanceName () { - _entries.clear(); - } - - void TrkExtInstanceName::construct (TrkParticle::type _hepid, bool _up_down, string _fitterName) - { - TrkExtInstanceNameEntry tmp1 (_hepid, _up_down, _fitterName); - _entries.push_back(tmp1); - } - - - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExtMCHits.cc b/TrkExt/src/TrkExtMCHits.cc deleted file mode 100644 index f59fea5256..0000000000 --- a/TrkExt/src/TrkExtMCHits.cc +++ /dev/null @@ -1,227 +0,0 @@ -// -// Original author MyeongJae Lee -// - -// C++ includes. -#include -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtMCHits.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Handle.h" - -using namespace CLHEP; -using namespace std; - -namespace mu2e { - - - TrkExtMCHits::TrkExtMCHits( ) { - _g4ModuleLabel = ""; - _instanceName = ""; - _hitcol.clear(); - _distcut = 1.; - } - - TrkExtMCHits::~TrkExtMCHits() { } - - TrkExtMCHits::TrkExtMCHits(const art::Event& event, std::string g4ModuleLabel, std::string instanceName, cet::map_vector_key simid, double distcut) { - _g4ModuleLabel = g4ModuleLabel; - _instanceName = instanceName; - _hitcol.clear(); - _distcut = distcut; - - art::Handle hits; - event.getByLabel(_g4ModuleLabel, _instanceName, hits); - if (!hits.isValid()) { - _hitcol.clear(); - cerr << "TrkExtMCHits : cannot find StepPointMC for " << instanceName << endl; - return; - } - - if (hits->size() <=0) { - _hitcol.clear(); - return; - } - - unsigned int i; - for ( i=0; isize(); ++i ){ - const StepPointMC& hit = (*hits)[i]; - if (hit.trackId() == simid) { - bool flag = false; - for (unsigned int k = 0 ; k < _hitcol.size() ; ++k) { - StepPointMCCollection & mccol = _hitcol[k]; - for (unsigned int l = 0 ; l < mccol.size() ; ++l) { - StepPointMC & mc = mccol[l]; - if ((mc.position() - hit.position()).mag() <_distcut) { - mccol.push_back(hit); - flag = true; - break; - } - } - if (flag) break; - } - if (!flag) { - StepPointMCCollection mccol; - mccol.push_back(hit); - _hitcol.push_back(mccol); - } - } - } - return; - } - - Hep3Vector TrkExtMCHits::momentum (unsigned int clust) const { - const vector & cluster = _hitcol[clust]; - if (cluster.size() <=0) { - cerr << "TrkExtMCHits Error : invalid _hitcol" << endl; - Hep3Vector p(0,0,0); - return p; - } - else if (cluster.size() ==1) { - return cluster[0].momentum(); - } - else if (cluster.size() == 2) { - double z1 = cluster[0].position().z(); - double z2 = cluster[1].position().z(); - double zc = 0.5 * (z1+z2); - double px = interpolate2(zc, z1, z2, cluster[0].momentum().x(), cluster[1].momentum().x()); - double py = interpolate2(zc, z1, z2, cluster[0].momentum().y(), cluster[1].momentum().y()); - double pz = interpolate2(zc, z1, z2, cluster[0].momentum().z(), cluster[1].momentum().z()); - Hep3Vector p(px,py,pz); - return p; - } - else { - unsigned int i1 = 0; - unsigned int i3 = cluster.size()-1; - unsigned int i2 = (i1+i3)/2; - double z1 = cluster[i1].position().z(); - double z2 = cluster[i2].position().z(); - double z3 = cluster[i3].position().z(); - double zc = (z1+z3)*0.5; - if (z2 == zc) { - return cluster[i2].momentum(); - } - double px = interpolate3(zc, z1,z2,z3,cluster[i1].momentum().x(), cluster[i2].momentum().x(), cluster[i3].momentum().x()); - double py = interpolate3(zc, z1,z2,z3,cluster[i1].momentum().y(), cluster[i2].momentum().y(), cluster[i3].momentum().y()); - double pz = interpolate3(zc, z1,z2,z3,cluster[i1].momentum().z(), cluster[i2].momentum().z(), cluster[i3].momentum().z()); - Hep3Vector p(px,py,pz); - return p; - } - } - - Hep3Vector TrkExtMCHits::position (unsigned int clust) const { - const vector & cluster = _hitcol[clust]; - if (cluster.size() <=0) { - cerr << "TrkExtMCHits Error : invalid _hitcol" << endl; - Hep3Vector p(0,0,0); - return p; - } - else if (cluster.size() ==1) { - return cluster[0].position(); - } - else if (cluster.size() == 2) { - double z1 = cluster[0].position().z(); - double z2 = cluster[1].position().z(); - double zc = 0.5 * (z1+z2); - double x = interpolate2(zc, z1, z2, cluster[0].position().x(), cluster[1].position().x()); - double y = interpolate2(zc, z1, z2, cluster[0].position().y(), cluster[1].position().y()); - Hep3Vector p(x,y,zc); - return p; - } - else { - unsigned int i1 = 0; - unsigned int i3 = cluster.size()-1; - unsigned int i2 = (i1+i3)/2; - double z1 = cluster[i1].position().z(); - double z2 = cluster[i2].position().z(); - double z3 = cluster[i3].position().z(); - double zc = (z1+z3)*0.5; - if (z2 == zc) { - return cluster[i2].position(); - } - double x = interpolate3(zc, z1,z2,z3,cluster[i1].position().x(), cluster[i2].position().x(), cluster[i3].position().x()); - double y = interpolate3(zc, z1,z2,z3,cluster[i1].position().y(), cluster[i2].position().y(), cluster[i3].position().y()); - Hep3Vector p(x,y,zc); - return p; - } - } - - double TrkExtMCHits::time (unsigned int clust) const { - const vector & cluster = _hitcol[clust]; - if (cluster.size() <=0) { - cerr << "TrkExtMCHits Error : invalid _hitcol" << endl; - return 0; - } - else { - double ret = 0; - for (unsigned int i = 0 ; i & cluster = _hitcol[clust]; - return fabs(cluster[0].momentum().mag() - cluster[cluster.size()-1].momentum().mag()); - } - - double TrkExtMCHits::eDep (unsigned int clust) const { - const vector & cluster = _hitcol[clust]; - double eDep = 0; - for (unsigned int i = 0 ; i < cluster.size() ; ++i) { - eDep += cluster[i].eDep(); - } - return eDep; - } - - double TrkExtMCHits::ionizingEdep (unsigned int clust) const { - const vector & cluster = _hitcol[clust]; - double eDep = 0; - for (unsigned int i = 0 ; i < cluster.size() ; ++i) { - eDep += cluster[i].ionizingEdep(); - } - return eDep; - } - - double TrkExtMCHits::nonIonizingEdep (unsigned int clust) const { - const vector & cluster = _hitcol[clust]; - double eDep = 0; - for (unsigned int i = 0 ; i < cluster.size() ; ++i) { - eDep += cluster[i].nonIonizingEDep(); - } - return eDep; - } - - double TrkExtMCHits::interpolate3 (double z, double x1, double x2, double x3, double y1, double y2, double y3) const { - double x1_x2 = x1 - x2; - double x2_x3 = x2 - x3; - double x3_x1 = x3 - x1; - if (x1_x2 !=0 && x2_x3 != 0 && x3_x1 != 0) { - return y1*(z-x2)*(x3-z)/x1_x2/x3_x1 + y2*(x1-z)*(z-x3)/x1_x2/x2_x3 + y3*(z-x1)*(x2-z)/x3_x1/x2_x3; - } - else { - return 0; - } - } - - double TrkExtMCHits::interpolate2 (double z, double x1, double x2, double y1, double y2) const { - if (x2 != x1) { - return (y2-y1)/(x2-x1)*(z-x1)+y1; - } - else { - return 0; - } - } - - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExtMaterial.cc b/TrkExt/src/TrkExtMaterial.cc deleted file mode 100644 index 0e733874a5..0000000000 --- a/TrkExt/src/TrkExtMaterial.cc +++ /dev/null @@ -1,138 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// Note : here we define various parameters which are used in material effect calculation. -// The algorithm should be updated to a more rubust algorithm: TODO -// - -// C++ includes. -#include -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "Offline/TrkExt/inc/TrkExtMaterial.hh" -#include "Offline/GeneralUtilities/inc/safeSqrt.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - - - - - TrkExtMaterial::TrkExtMaterial( ) : - _name("undefined") - { - _matid = Undefined; - } - - - TrkExtMaterial::TrkExtMaterial( string n) : - _name(n) - { - if (n.find("PE")!=string::npos) { - _dpmp[0] = -0.719604; - _dpmp[1] = 0.904384; - _dpmp[2] = -0.0136965; - _dpmp[3] = 1.18018; - _dpmp[4] = 1.66496e-5; - _dpmp[5] = 2.56602e-6; - _dpsp[0] = 2.01486; - _edpsp[0] = 0.0098517; - _dpsp[1] = 0.0220202; - _edpsp[1] = 0.000184769; - _dpsp[2] = -1.19048e-06; - _edpsp[2] = 8.58465e-07; - _thpar[0] = 0.6063; - _thpar[1] = 0.7636; - _thpar[2] = 0.0875; - _rho = 0.89; //g cm-3 - _matid = PE; - } - else if (n.find("Al")!=string::npos) { - _dpmp[0] = -0.435264; - _dpmp[1] = 1.02322; - _dpmp[2] = -0.00790427; - _dpmp[3] = 1.05155; - _dpmp[4] = -1.45739e-5; - _dpmp[5] = -1.64281e-6; - _dpsp[0] = 1.54196; - _edpsp[0] = 0.00855373; - _dpsp[1] = 0.040025; - _edpsp[1] = 0.000160425; - _dpsp[2] = 1.66667e-06; - _edpsp[2] = 7.45356e-07; - _thpar[0] = 1.4420; - _thpar[1] = 0.8294; - _thpar[2] = 0.0875; - _rho = 2.699; - _matid = Al; - } - else if (n.find("Vac")!=string::npos) { - _dpmp[0] = 0; - _dpmp[1] = 0; - _dpmp[2] = 0; - _dpmp[3] = 0; - _dpmp[4] = 0; - _dpmp[5] = 0; - _dpsp[0] = 0; - _dpsp[1] = 0; - _dpsp[2] = 0; - _thpar[0] = 0; - _thpar[1] = 0; - _thpar[2] = 0; - _rho = 0; - _matid = Vac; - } - else { - _dpmp[0] = 0; - _dpmp[1] = 0; - _dpmp[2] = 0; - _dpmp[3] = 0; - _dpmp[4] = 0; - _dpmp[5] = 0; - _dpsp[0] = 0; - _dpsp[1] = 0; - _dpsp[2] = 0; - _thpar[0] = 0; - _thpar[1] = 0; - _thpar[2] = 0; - _rho = 0; - _matid = Undefined; - } - - - } - - - double TrkExtMaterial::meanEnergyLoss (const Hep3Vector& p, double ds) { - double ke = safeSqrt(p.mag2() + _mec22) - _mec2; - return _rho * (_dpsp[0] + _dpsp[1]*ke + _dpsp[2]*ke*ke) * 0.1 * ds; - return 0; - } - - double TrkExtMaterial::mostProbableEnergyLoss (const Hep3Vector & p, double ds) { - if (_matid == Vac || _matid == Undefined) return 0; - double mom = p.mag() - 104.; - double thick = log10(fabs(ds)); - double de = pow(10., (_dpmp[0]+_dpmp[1]*thick+_dpmp[2]*thick*thick)*(_dpmp[3]+_dpmp[4]*mom+_dpmp[5]*mom*mom)); - return de; - } - - double TrkExtMaterial::scatteringAngle (const CLHEP::Hep3Vector& p, double ds) { - double fabsds = fabs(ds); - if (fabsds <=0) return 0; - return _thpar[0] * safeSqrt(fabsds) / p.mag() * (_thpar[1] + _thpar[2] * log10(fabsds)) ; - } - - - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExtProtonAbsorber.cc b/TrkExt/src/TrkExtProtonAbsorber.cc deleted file mode 100644 index f81e7bfc03..0000000000 --- a/TrkExt/src/TrkExtProtonAbsorber.cc +++ /dev/null @@ -1,102 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// - -// C++ includes. -#include -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtProtonAbsorber.hh" -#include "Offline/MECOStyleProtonAbsorberGeom/inc/MECOStyleProtonAbsorber.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/GeneralUtilities/inc/safeSqrt.hh" -#include "Offline/ConfigTools/inc/SimpleConfig.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - - - - - TrkExtProtonAbsorber::TrkExtProtonAbsorber() : - TrkExtShape(0.001), - TrkExtMaterial("PE") - { - valid = false; - } - - void TrkExtProtonAbsorber::initialize() - { - // geometry is read from mu2e coordinate. therefore, it should be transformed to detector coordinate - art::ServiceHandle geom; - SimpleConfig const * config = &(geom->config()); - if (!(config->getBool("hasProtonAbsorber"))) { - cerr << "TrkExtProtonAbsorber is disabled!" << endl; - valid = false; - return; - } - - GeomHandle pabs; - if (!(pabs->isAvailable(0)) && !(pabs->isAvailable(0)) ) { - cerr << "TrkExtProtonAbsorber warning : pabs1 & pabs2 not avaliable" << endl; - valid = false; - return; - } - - int index; - if (pabs->isAvailable(0)) index = 0; - else index = 1; - z0 = pabs->part(index).center().z() - pabs->part(index).halfLength(); - r0in = pabs->part(index).innerRadiusAtStart(); - r0out = pabs->part(index).outerRadiusAtStart(); - - if (pabs->isAvailable(1)) index = 1; - else index = 0; - z1 = pabs->part(index).center().z() + pabs->part(index).halfLength(); - r1in = pabs->part(index).innerRadiusAtEnd(); - r1out = pabs->part(index).outerRadiusAtEnd(); - - GeomHandle det; - Hep3Vector origin = det->toMu2e( CLHEP::Hep3Vector(0.,0.,0.) ); - z0 -= origin.z(); - z1 -= origin.z(); - slope_out = (r1out - r0out) / (z1 - z0); - slope_in = (r1in - r0in) / (z1 - z0); - - cout << "TrkExtProtonAbsorber read : " << endl; - cout << " rOut = [" << r0out << ", " << r1out << "]" << endl; - cout << " rIn = [" << r0in << ", " << r1in << "]" << endl; - cout << " z = [" << z0 << ", " << z1 << "]" << endl; - - valid = true; - - } - - bool TrkExtProtonAbsorber::contains (Hep3Vector &xx) { - // xx should be detector coordinate - if (!valid) return false; - double r = safeSqrt(xx.x() * xx.x() + xx.y() * xx.y()); - double z = xx.z(); - if (z slope_out*(z-z0)+r0out) return false; - return true; - } - - - - - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExtShape.cc b/TrkExt/src/TrkExtShape.cc deleted file mode 100644 index 5031157037..0000000000 --- a/TrkExt/src/TrkExtShape.cc +++ /dev/null @@ -1,58 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// - -// C++ includes. -#include -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtShape.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - - TrkExtShape::TrkExtShape( double boundaryLimit ) : - _limit(boundaryLimit) - { } - - Hep3Vector TrkExtShape::intersection (const Hep3Vector & x1, const Hep3Vector & x2) { - cout << "TrkExtShape called" << endl; - bool f1, f2; - Hep3Vector xstart = x1; - Hep3Vector xstop = x2; - do { - f1 = contains(xstart); - f2 = contains(xstop); - if (f1 == f2) { - cerr << "TrkExtShape Warning : call intersection at wrong positions at begin" << endl; - Hep3Vector ret = (x1+x2)*0.5; - return ret; - } - - Hep3Vector xhalf = (xstart+xstop)*0.5; - bool fhalf = contains(xhalf); - if (fhalf == f1) { - xstop = xhalf; - } - else if (fhalf == f2) { - xstart = xhalf; - } - else { - cerr << "TrkExtShape Warning : call intersection at wrong positions at processing" << endl; - return xhalf; - } - } while ((xstart-xstop).mag() > _limit); - return xstop; - } - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExtStoppingTarget.cc b/TrkExt/src/TrkExtStoppingTarget.cc deleted file mode 100644 index f843f12bb3..0000000000 --- a/TrkExt/src/TrkExtStoppingTarget.cc +++ /dev/null @@ -1,80 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// - -// C++ includes. -#include -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtStoppingTarget.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/StoppingTargetGeom/inc/StoppingTarget.hh" -#include "Offline/StoppingTargetGeom/inc/TargetFoil.hh" -#include "Offline/GeneralUtilities/inc/safeSqrt.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - - TrkExtStoppingTarget::TrkExtStoppingTarget() : - TrkExtShape(), - TrkExtMaterial("Al") - { - foil.clear(); - nfoil = -1; - } - - void TrkExtStoppingTarget::initialize() { - // geometry is read from mu2e coordinate. therefore, it should be transformed to detector coordinate - GeomHandle det; - Hep3Vector origin = det->toMu2e( CLHEP::Hep3Vector(0.,0.,0.) ); - - GeomHandle target; - foil.clear(); - for (int i = 0 ; i < target->nFoils() ; ++i) { - TargetFoil f = target->foil(i); - foil_data_type ftmp (f.rOut(), - f.centerInDetectorSystem().z() - f.halfThickness(), - f.centerInDetectorSystem().z(), - f.centerInDetectorSystem().z() + f.halfThickness()); - foil.push_back(ftmp); - } - - nfoil = foil.size(); - - rmax = -999; - zmax = -999999; - zmin = 999999; - for (int i = 0 ; i < nfoil ; ++i) { - cout << "TrkExtStoppingTarget read foil " << i << " at " << foil[i].zc << ", r = " << foil[i].rout << endl; - if (foil[i].rout > rmax) rmax = foil[i].rout; - if (foil[i].z1 > zmax) zmax = foil[i].z1; - if (foil[i].z0 < zmin) zmin = foil[i].z0; - } - cout << "TrkExtStoppingTarget read foil rmax=" << rmax << ", zmax=" << zmax << ", zmin=" << zmin << endl; - } - - bool TrkExtStoppingTarget::contains (Hep3Vector &xx) { - // xx should be detector coordinate - if (nfoil<=0) return false; - double r = safeSqrt(xx.x() * xx.x() + xx.y() * xx.y()); - double z = xx.z(); - if (zzmax || r>rmax) return false; - for (int i = 0 ; i -#include - -// Framework includes. - -#include "CLHEP/Vector/ThreeVector.h" -#include "Offline/TrkExt/inc/TrkExtToyDS.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/DetectorSolenoidGeom/inc/DetectorSolenoid.hh" -#include "Offline/StoppingTargetGeom/inc/StoppingTarget.hh" -#include "Offline/StoppingTargetGeom/inc/TargetFoil.hh" -#include "Offline/ConfigTools/inc/SimpleConfig.hh" -#include "Offline/GeneralUtilities/inc/safeSqrt.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - - TrkExtToyDS::TrkExtToyDS() : - TrkExtShape(0.001), - TrkExtMaterial("Vac") - { - rin = 1000; - rout = 1300; - zmin = 6000; - zmax = 9226; - } - - void TrkExtToyDS::initialize() { - // geometry is read from mu2e coordinate. therefore, it should be transformed to detector coordinate - GeomHandle det; - Hep3Vector origin = det->toMu2e( CLHEP::Hep3Vector(0.,0.,0.) ); - - GeomHandle dsgeom; - rin = dsgeom->rIn1(); - rout = dsgeom->rOut2(); - zmin = dsgeom->position().z() - dsgeom->halfLength() - origin.z(); - zmax = dsgeom->position().z() + dsgeom->halfLength() - origin.z(); - - cout << "TrkExtToyDS read rin=" << rin << ", rout=" << rout << ", zmin=" << zmin << ", zmax=" << zmax <zmax || r>rin) return false; - return true; - } - -} // end namespace mu2e - diff --git a/TrkExt/src/TrkExt_module.cc b/TrkExt/src/TrkExt_module.cc deleted file mode 100644 index a4d8aa061c..0000000000 --- a/TrkExt/src/TrkExt_module.cc +++ /dev/null @@ -1,1167 +0,0 @@ -// -// Track Extrapolation module. -// All in Detector coordinate. Points other than tracker coordinates are properly transformed. -// B field basically requires mu2e coordinate -// G4 uses G4World coordinate -// See the note at TrkExtTraj.hh for the meaning of point information, especially when volume changing. -// -// Original author MyeongJae Lee -// - -// C++ includes. -#include -#include -#include - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/Handle.h" -#include "art_root_io/TFileService.h" -#include "fhiclcpp/ParameterSet.h" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/GeometryService/inc/WorldG4.hh" - -using namespace CLHEP; -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "TH1F.h" -#include "TTree.h" -#include "TNtuple.h" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "BTrk/TrkBase/TrkHit.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/DataProducts/inc/VirtualDetectorId.hh" -#include "Offline/GeneralUtilities/inc/safeSqrt.hh" - -#include "Offline/BFieldGeom/inc/BFieldManager.hh" - -#include "Offline/RecoDataProducts/inc/TrkExtTrajPoint.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" -#include "Offline/TrkExt/inc/TrkExtDetectors.hh" -#include "Offline/TrkExt/inc/TrkExtInstanceName.hh" - -using namespace std; - -namespace mu2e { - - // Other constants - const double VELOCITY_OF_LIGHT = 2.99792458e8; - const int MAXSIM = 5000; - const int MAXNBACK = 10000; - const double RUNGE_KUTTA_KQ = 1.e-9*VELOCITY_OF_LIGHT; //k = 2.99e-1, q = 1. Actual charge is multiplied in runtime. - - namespace TrkExtExitCode { - enum Enum { - Undefined = -1, - DoNotExit = 0, - WriteData = 1, - UndefinedVolume = 2, - MaximumMomentum = 3, - ReflectionLimit = 4, - MaximumPoints = 5 - }; - } - - class TrkExt : public art::EDProducer { - - public: - explicit TrkExt(fhicl::ParameterSet const& pset); - virtual ~TrkExt() { } - void beginJob(); - void beginRun(art::Run &run) override; - void beginSubRun(art::SubRun & lblock ) override; - virtual void produce(art::Event& event); - void endJob(); - - private: - - int _processed_events; - - std::string _g4ModuleLabel; - std::string _makerModuleLabel; - std::vector _fitterModuleLabelArray; - std::vector _fitparticleArray; - std::vector _fitdirectionArray; - - double _maxMomentum; - bool _turnOnMaterialEffect; - bool _useStoppingPower; - int _maxNBack; - double _extrapolationStep; //in mm - double _recordingStep; - bool _mcFlag; - bool _useVirtualDetector; - int _bFieldGradientMode; - bool _turnOnMultipleScattering; - int _debugLevel; - int _verbosity; - - bool _flagEloss; - bool _flagDiagnostics; - - TTree * _hEloss; - std::vector _hExitCode; - std::vector _hNSteps; - std::vector _hNData; - std::vector _hFL; - std::vector _hNPAClust; - std::vector _hNSTClust; - std::vector _hPinit; - std::vector _hPfin; - std::vector _hDeltapPA; - std::vector _hDeltapST; - TNtuple * _hNtracks; - - - float _vdx[5], _vdy[5], _vdz[5], _vdpx[5], _vdpy[5], _vdpz[5], _vdp[5]; - int _evtid, _trkid; - float _eloss_mean, _eloss_mp, _eloss_p; - int _eloss_vid; - - TrkExtTraj _traj; - - Hep3Vector _origin; - Hep3Vector _mu2eOriginInWorld; - - BFieldManager const * _bfMgr; - TrkExtDetectors _mydet; - TrkExtInstanceName _trkPatRecInstanceName; - - double _dummyStoppingTarget_halfLength; - double _dummyStoppingTarget_z0; - double _pa_HalfLength; - - void readTrkPatRec(KalRep const & trk, - Hep3Vector * xstart, Hep3Vector * pstart, - Hep3Vector * xstop, Hep3Vector * pstop, - HepMatrix * covstart, HepMatrix * covstop, - double * timestart, double * timestop) ; - bool readVD (const art::Event& event, TrkHitVector const& hits) ; - int doExtrapolation (Hep3Vector x, Hep3Vector p, double t, HepMatrix cov, bool direction, TrkExtInstanceNameEntry & instance) ; - - HepVector _runge_kutta_newpar_5th (HepVector r0, double ds, bool mode, int charge) ; - HepVector _runge_kutta_newpar_f (HepVector r, Hep3Vector B, int charge) ; - - TrkExtTrajPoint calculateNextPosition(TrkExtTrajPoint r00, double ds, double mass2, int charge); - - Hep3Vector getBField (Hep3Vector& x) ; // in Detector coordinate - Hep3Vector getBField (const Hep3Vector& x) ; // in Detector coordinate - Hep3Vector getBField (HepVector& r) ; // in Detector coordinate - Hep3Vector getBFieldWithGradient( const Hep3Vector & x, - double & bxx, double & bxy, double & bxz, - double & byx, double & byy, double & byz, - double & bzx, double & bzy, double & bzz); - bool checkOutofReflectionLimit (bool updown, const Hep3Vector & x, const Hep3Vector & p); // in Detector coordinate - HepMatrix getCovarianceTransport(TrkExtTrajPoint & r0, double ds, double deltapp, int charge); - HepMatrix getCovarianceMultipleScattering(TrkExtTrajPoint & r0, double ds); - - }; - - TrkExt::TrkExt(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _g4ModuleLabel(pset.get("g4ModuleLabel")), - _makerModuleLabel(pset.get("makerModuleLabel")), - _fitterModuleLabelArray(pset.get >("fitterModuleLabelArray")), - _fitparticleArray(pset.get >("fitparticleArray")), - _fitdirectionArray(pset.get >("fitdirectionArray")), - _maxMomentum(pset.get("maxMomentum", 104.96)), - _turnOnMaterialEffect(pset.get("turnOnMaterialEffect", true)), - _useStoppingPower(pset.get("useStoppingPower", false)), - _maxNBack(pset.get("maxNBack", 5000)), - _extrapolationStep(pset.get("extrapolationStep", 5.0)), // in mm - _recordingStep(pset.get("recordingStep", 10.0)), // in mm - _mcFlag(pset.get("mcFlag", false)), - _useVirtualDetector(pset.get("useVirtualDetector", false)), - _bFieldGradientMode(pset.get("bFieldGradientMode", 1)), - _turnOnMultipleScattering(pset.get("turnOnMultipleScattering", true)), - _debugLevel(pset.get("debugLevel", 1)), - _verbosity(pset.get("verbosity", 1)), - _hEloss(0) - { - _processed_events = -1; - - if (_g4ModuleLabel != "") { - _mcFlag = true; - } - - _dummyStoppingTarget_halfLength = pset.get("dummyStoppingTarget.halfLength", 400.); - _dummyStoppingTarget_z0 = pset.get("dummyStoppingTarget.z0", 5900.); - _pa_HalfLength = pset.get("protonabsorber.halfLength", 1250.); - - if ( _fitterModuleLabelArray.size() <=0 - || _fitparticleArray.size() <= 0 - || _fitdirectionArray.size() <=0 - || _fitterModuleLabelArray.size() != _fitparticleArray.size() - || _fitterModuleLabelArray.size() != _fitdirectionArray.size() - || _fitdirectionArray.size() != _fitparticleArray.size() ) { - throw cet::exception("RANGE") - << "TrkExt error: fitterModuleNameArray, fitparticleArray, or fitdirectionArray are not given properly or never given."; - } - - for (unsigned int i = 0 ; i <_fitterModuleLabelArray.size() ; ++i) { - _trkPatRecInstanceName.construct( - (TrkParticle::type)(_fitparticleArray[i]), - _fitdirectionArray[i], - _fitterModuleLabelArray[i]); - } - - for (unsigned int i = 0 ; i <_trkPatRecInstanceName.size() ; ++i) { - produces(_trkPatRecInstanceName.name(i).c_str()); - if (_verbosity>=1) cout << "TrkExt : module=" << _trkPatRecInstanceName.fitterName(i) << ", instance=" << _trkPatRecInstanceName.name(i) << " created" << endl; - int ihepid = abs(_trkPatRecInstanceName.hepid(i)); - if (ihepid != 11 && ihepid != 13 && ihepid != 211 && ihepid != 321 && ihepid != 2212) - throw cet::exception("CONFIGURATION") - << "TrkExt error : Unknown incomming particle type " << ihepid << ". Check your configuration, and report to the original author if it's really wanted." << endl; - //TODO - } - - switch (_debugLevel) { - case 1: - _flagEloss = false; - _flagDiagnostics = true; - break; - case 2: - _flagEloss = true; - _flagDiagnostics = true; - break; - case 0: - default: - _flagEloss = false; - _flagDiagnostics = false; - break; - } - - } - - void TrkExt::beginJob(){ - - // some input check - if (_maxNBack > MAXNBACK) _maxNBack = MAXNBACK; - if (_extrapolationStep == 0) _extrapolationStep = 5.; - else if (_extrapolationStep <0) _extrapolationStep = fabs(_extrapolationStep); - if (_recordingStep <0) _recordingStep = 0.0; - if (!_mcFlag) { - if (_useVirtualDetector) { - if (_verbosity>=0) cout << "TrkExt: VirtualDetector turned off for data" << endl; - _useVirtualDetector = false; - } - } - - if (_bFieldGradientMode != 0 - && _bFieldGradientMode != 1) { - if (_verbosity>=0) cout << "TrkExt: bFieldGradientMode forced to 1" << endl; - _bFieldGradientMode = 1; - } - - if (_verbosity>=1) cout << "TrkExt: extrapolationStep = " << _extrapolationStep << endl; - if (_verbosity>=1) cout << "TrkExt: recordingStep = " << _recordingStep << endl; - - // histograms - - art::ServiceHandle tfs; - - if (_flagEloss) { - _hEloss = tfs->make("hEloss", "Energy loss info"); - _hEloss->Branch("mean", &_eloss_mean, "mean/F"); - _hEloss->Branch("mp", &_eloss_mp, "mp/F"); - _hEloss->Branch("volid", &_eloss_vid, "volid/I"); - _hEloss->Branch("p", &_eloss_p, "p/F"); - } - - if (_flagDiagnostics) { - char hname[100], htitle[1000]; - for (unsigned int i = 0 ; i <_trkPatRecInstanceName.size() ; ++i) { - _hExitCode.push_back((TH1F*)0); - _hNSteps.push_back((TH1F*)0); - _hNData.push_back((TH1F*)0); - _hFL.push_back((TH1F*)0); - _hNPAClust.push_back((TH1F*)0); - _hNSTClust.push_back((TH1F*)0); - _hPinit.push_back((TH1F*)0); - _hPfin.push_back((TH1F*)0); - _hDeltapPA.push_back((TH1F*)0); - _hDeltapST.push_back((TH1F*)0); - } - for (unsigned int i = 0 ; i <_trkPatRecInstanceName.size() ; ++i) { - sprintf (hname, "hExitCode_%d", i); - sprintf (htitle, "Exit code for %s", _trkPatRecInstanceName.name(i).c_str()); - _hExitCode[i] = tfs->make(hname, htitle, 10, -1, 9); - sprintf (hname, "hNSteps_%d", i); - sprintf (htitle, "Ext steps for %s", _trkPatRecInstanceName.name(i).c_str()); - _hNSteps[i] = tfs->make(hname, htitle, 300, 0, 30000./_extrapolationStep); - sprintf (hname, "hNData_%d", i); - sprintf (htitle, "Data points for %s", _trkPatRecInstanceName.name(i).c_str()); - _hNData[i] = tfs->make(hname, htitle, 200, 0, _maxNBack); - sprintf (hname, "hFL_%d", i); - sprintf (htitle, "Flight length (m) for %s", _trkPatRecInstanceName.name(i).c_str()); - _hFL[i] = tfs->make(hname, htitle, 300, 0, 30.); - sprintf (hname, "hNPAClust_%d", i); - sprintf (htitle, "PA cluster for %s", _trkPatRecInstanceName.name(i).c_str()); - _hNPAClust[i] = tfs->make(hname, htitle, 20, 0, 20); - sprintf (hname, "hNSTClust_%d", i); - sprintf (htitle, "ST cluster for %s", _trkPatRecInstanceName.name(i).c_str()); - _hNSTClust[i] = tfs->make(hname, htitle, 20, 0, 20); - sprintf (hname, "hPinit_%d", i); - sprintf (htitle, "Initial momentum for %s", _trkPatRecInstanceName.name(i).c_str()); - _hPinit[i] = tfs->make(hname, htitle, 200, 90, 110); - sprintf (hname, "hPfin_%d", i); - sprintf (htitle, "Final momentum for %s", _trkPatRecInstanceName.name(i).c_str()); - _hPfin[i] = tfs->make(hname, htitle, 200, 90, 110); - sprintf (hname, "hDeltapPA_%d", i); - sprintf (htitle, "Energy loss in PA for %s", _trkPatRecInstanceName.name(i).c_str()); - _hDeltapPA[i] = tfs->make(hname, htitle, 200, -2, 2); - sprintf (hname, "hDeltapST_%d", i); - sprintf (htitle, "Energy loss in ST for %s", _trkPatRecInstanceName.name(i).c_str()); - _hDeltapST[i] = tfs->make(hname, htitle, 200, -2, 2); - } - } - _hNtracks = tfs->make("hNtracks", "Extrapolation statistics", "hepid:dir:ntrk"); - - //TODO : warn if uniform B-field. - - } - - void TrkExt::beginRun(art::Run & run){ - if (_verbosity>=2) cout << "TrkExt: From beginRun: " << run.id().run() << endl; - GeomHandle det; - _origin = det->toMu2e( CLHEP::Hep3Vector(0.,0.,0.) ); // add this to transfer detector coord. to mu2e coord. - GeomHandle g4world; - _mu2eOriginInWorld = g4world->mu2eOriginInWorld(); // add this to transfer mu2e coord. to g4 coord. - if (_verbosity>=2) cout << "TrkExt: Detector coord origin in mu2e coord = " << _origin << endl; - if (_verbosity>=2) cout << "TrkExt: Mu2e coord origin in G4 coord = " << _mu2eOriginInWorld << endl; - - } - - void TrkExt::beginSubRun(art::SubRun & lblock ) { - if (_verbosity>=2) cout << "TrkExt: From beginSubRun. " << endl; - _bfMgr = GeomHandle().get(); - _mydet.initialize(); - } - - void TrkExt::endJob(){ - if (_verbosity>=2) cout << "TrkExt: From endJob. " << endl; - for ( unsigned int i = 0 ; i < _trkPatRecInstanceName.size() ; ++i) { - _hNtracks->Fill(_trkPatRecInstanceName.hepid(i), _trkPatRecInstanceName.updown(i), _trkPatRecInstanceName.ntrk(i)); - } - - } - - ////////// Produce /////////// - - void TrkExt::produce(art::Event& event) { - _evtid = event.id().event(); - ++_processed_events; - if (_processed_events%100 == 0) { - if (_verbosity>=1) cout << "TrkExt: processing " << _processed_events << "-th events at evtid=" << _evtid << endl; - } - if (_verbosity>=2) cout << "TrkExt: processing " << _processed_events << "-th events at evtid=" << _evtid << endl; - - art::Handle trksHandle; - - for ( unsigned int instanceIter = 0 ; instanceIter < _trkPatRecInstanceName.size() ; ++instanceIter) { - unique_ptr trajcol(new TrkExtTrajCollection); - - TrkExtInstanceNameEntry & instance = _trkPatRecInstanceName.get(instanceIter); - - event.getByLabel(instance.fitterName, instance.name, trksHandle); - if (!trksHandle.isValid()) { - if (_verbosity>=1) cout << "TrkExt : " << "no" << " obj for " << instance.name << " of event " << _evtid << endl; - continue; - } - - KalRepCollection const& trks = *trksHandle; - if (trks.size() >0) { - if (_verbosity>=1) cout << "TrkExt : " << trks.size() << " obj for " << instance.name << " of event " << _evtid << endl; - } - - for ( size_t i=0; i< trks.size(); ++i ){ - _trkPatRecInstanceName.addTrack(instanceIter); - _trkid = i; - KalRep const& trk = trks.at(i); - Hep3Vector xstart, pstart, xstop, pstop; - HepMatrix covstart(6,6,0); - HepMatrix covstop(6,6,0); - double tstart, tstop; - readTrkPatRec (trk, &xstart, &pstart, &xstop, &pstop, &covstart, &covstop, &tstart, &tstop); - - if (_verbosity>=2) cout << "Track extrapolation at " << _evtid << ", track " << _trkid << endl; - - _traj.clear(); - if (_useVirtualDetector) { - TrkHitVector const& hits = trk.hitVector(); - if (!(readVD(event, hits))) { - if (_verbosity>=0) cout << "TrkExt Warning: Cannot read VD at evt " << _evtid << ", trk " << i << ". Skipping" << endl; - trajcol->push_back(_traj); - continue; - } - if (_vdx[2] < -99998 || _vdy[2] < -99998 || _vdz[2] <-99998) { - if (_verbosity>=0) cout << "TrkExt Warning: VD2 info not found at evt " << _evtid << ", trk " << i << ". Skipping" << endl; - trajcol->push_back(_traj); - continue; - } - xstart.set (_vdx[2], _vdy[2], _vdz[2]); - pstart.set (_vdpx[2], _vdpy[2], _vdpz[2]); - } - - int nsteps; - //upstream ptl extrapolates time-forward to stopping target - if (instance.updown) nsteps = doExtrapolation (xstop, pstop, tstop, covstop, true, instance); - //downstream ptl extrapolates time-backward to stopping target - else nsteps = doExtrapolation (xstart, pstart, tstart, covstart, false, instance); - if (_flagDiagnostics) { - _hExitCode[instanceIter]->Fill(_traj.exitCode()); - _hNSteps[instanceIter]->Fill(nsteps); - _hNData[instanceIter]->Fill(_traj.size()); - _hFL[instanceIter]->Fill(fabs(_traj.flightLength()*0.001)); - _hNPAClust[instanceIter]->Fill(_traj.getNPAHits()); - _hNSTClust[instanceIter]->Fill(_traj.getNSTHits()); - _hPinit[instanceIter]->Fill(_traj.front().momentum().mag()); - _hPfin[instanceIter]->Fill(_traj.back().momentum().mag()); - _hDeltapPA[instanceIter]->Fill(_traj.getDeltapPA()); - _hDeltapST[instanceIter]->Fill(_traj.getDeltapST()); - } - - trajcol->push_back(_traj); - - } // end of trks loop - event.put(std::move(trajcol), instance.name.c_str()); - } // end of instance loop - - } - - ////////// Utility functions /////////// - - bool TrkExt::checkOutofReflectionLimit(bool updown, const Hep3Vector & x, const Hep3Vector & p) { - if (!updown) { // downstream particle - if(p.z() >=0) return false; - Hep3Vector xx = x+_origin; - if(xx.z() > _dummyStoppingTarget_z0+_dummyStoppingTarget_halfLength+2.*_pa_HalfLength) return true; - return false; - } - else { - if(p.z() <=0) return false; - Hep3Vector xx = x+_origin; - if(xx.z() > _dummyStoppingTarget_z0+_dummyStoppingTarget_halfLength+2.*_pa_HalfLength) return true; - return false; - } - return false; - } - - ////////// BField functions /////////// - - Hep3Vector TrkExt::getBField (Hep3Vector& x) { - // x in Detector coordinate - //mu2e::GeomHandle bfMgr; - Hep3Vector b = _bfMgr->getBField(x + _origin); - if (b.mag() >10) { - Hep3Vector xx = x+_origin; - if (_verbosity>=0) cout << "TrkExt: Crazy bfield : (" << b.x() << ", " << b.y() << ", " << b.z() << ") at (" << xx.x() << ", " << xx.y() << ", " << xx.z() << ")" << endl; - } - return b; - } - - Hep3Vector TrkExt::getBField (const Hep3Vector& x) { - Hep3Vector xx = x + _origin; - Hep3Vector b = _bfMgr->getBField(xx); - if (b.mag() >10) { - if (_verbosity>=0) cout << "TrkExt: Crazy bfield : (" << b.x() << ", " << b.y() << ", " << b.z() << ") at (" << xx.x() << ", " << xx.y() << ", " << xx.z() << ")" << endl; - } - return b; - } - - Hep3Vector TrkExt::getBField (HepVector& r) { - Hep3Vector x(r[0], r[1], r[2]); - return getBField(x); - } - - - Hep3Vector TrkExt::getBFieldWithGradient( const Hep3Vector & x, - double & bxx, double & bxy, double & bxz, - double & byx, double & byy, double & byz, - double & bzx, double & bzy, double & bzz) { - - Hep3Vector B0 = getBField(x); - - if (_bFieldGradientMode == 1) { - double xx = x.x(); - double yy = x.y(); - double zz = x.z(); - double h = 5.; - Hep3Vector mx (xx-h,yy,zz); - Hep3Vector px (xx+h,yy,zz); - Hep3Vector my (xx,yy-h,zz); - Hep3Vector py (xx,yy+h,zz); - Hep3Vector mz (xx,yy,zz-h); - Hep3Vector pz (xx,yy,zz+h); - - Hep3Vector Bmx = getBField(mx); - Hep3Vector Bpx = getBField(px); - Hep3Vector Bmy = getBField(my); - Hep3Vector Bpy = getBField(py); - Hep3Vector Bmz = getBField(mz); - Hep3Vector Bpz = getBField(pz); - - bxx = (Bpx.x() - Bmx.x()) / (2.*h); - bxy = (Bpy.x() - Bmy.x()) / (2.*h); - bxz = (Bpz.x() - Bmz.x()) / (2.*h); - byx = (Bpx.y() - Bmx.y()) / (2.*h); - byy = (Bpy.y() - Bmy.y()) / (2.*h); - byz = (Bpz.y() - Bmz.y()) / (2.*h); - bzx = (Bpx.z() - Bmx.z()) / (2.*h); - bzy = (Bpy.z() - Bmy.z()) / (2.*h); - bzz = (Bpz.z() - Bmz.z()) / (2.*h); - } - else { - bxx = 0; - bxy = 0; - bxz = 0; - byx = 0; - byy = 0; - byz = 0; - bzx = 0; - bzy = 0; - bzz = 0; - } - return B0; - } - - /////////// Read VD ////////////// - - bool TrkExt::readVD (const art::Event& event, TrkHitVector const& hits) { - unsigned int i = 0, j, k = -1; - - // iterate from hot list - for (auto iter = hits.begin() ; iter != hits.end() ; ++iter) { - ++k; - const TrkHit * hit = *iter; - // read assoc. TrkStrawHit - const mu2e::TrkStrawHit* trkStrawHit = dynamic_cast(hit); - - // try next if not found - if (!trkStrawHit) continue; - - // read assoc. StrawHit - const ComboHit& comobHit = trkStrawHit->comboHit(); - - // read ComboHitCollection - art::Handle shcHandle; - event.getByLabel(_makerModuleLabel, shcHandle); - ComboHitCollection const & shc = *shcHandle; - - // find the same StrawHit entry from ComboHitCollection - int hitid = -1; - for (i = 0 ; i stepsCHandle; - event.getByLabel(_makerModuleLabel, "StrawHitMCPtr", stepsCHandle); - PtrStepPointMCVectorCollection const & stepsC = *stepsCHandle; - - if (stepsC.size() <=0) continue; - - PtrStepPointMCVector const & steps (stepsC.at(hitid)); - - if (steps.size() <=0) continue; - - StepPointMC const & step = *steps.at(0); - - // read SimParticle from StepPointMC - SimParticle const &sim = *step.simParticle(); - - // now simid is found - cet::map_vector_key simid = sim.id(); - - // read VD - vector vdp[5]; - vector vdx[5]; - for (i = 0 ; i <5 ; ++i) { - vdp[i].clear(); - vdx[i].clear(); - } - art::Handle hits; - event.getByLabel(_g4ModuleLabel,"virtualdetector",hits); - for ( i=0; isize(); ++i ){ - const StepPointMC& hit = (*hits)[i]; - if (hit.trackId() != simid) continue; - - switch (hit.volumeId()) { - case VirtualDetectorId::ST_In : - j = 0; - break; - case VirtualDetectorId::ST_Out : - j = 1; - break; - case VirtualDetectorId::TT_FrontHollow : - case VirtualDetectorId::TT_FrontPA : - j = 2; - break; - case VirtualDetectorId::TT_MidInner : - case VirtualDetectorId::TT_Mid : - j = 3; - break; - case VirtualDetectorId::TT_Back : - j = 4; - break; - default : - j = 9999; - break; - } - if (j >10) continue; - vdp[j].push_back(hit.momentum()); - vdx[j].push_back(hit.position()-_origin); - } - for (i = 0 ; i <5 ; ++i) { - if (vdp[i].size() >0) { - Hep3Vector psum(0,0,0); - Hep3Vector xsum(0,0,0); - for (unsigned int k = 0 ; k < vdp[i].size() ; ++k) { - psum += (vdp[i])[k]; - xsum += (vdx[i])[k]; - } - - psum /= double(vdp[i].size()); - xsum /= double(vdx[i].size()); - _vdx[i] = xsum.x(); - _vdy[i] = xsum.y(); - _vdz[i] = xsum.z(); - _vdpx[i] = psum.x(); - _vdpy[i] = psum.y(); - _vdpz[i] = psum.z(); - _vdp[i] = psum.mag(); - } - else { - _vdx[i] = -99999; - _vdy[i] = -99999; - _vdz[i] = -99999; - _vdpx[i] = -99999; - _vdpy[i] = -99999; - _vdpz[i] = -99999; - _vdp[i] = -99999; - } - } - // read successful. return true - return true; - } - - // Reaching here means VD reading not successful. return false - - return false; - } - - /////////// Read TrkPatRec ////////////// - - void TrkExt::readTrkPatRec(KalRep const & krep, Hep3Vector * xstart, Hep3Vector * pstart, Hep3Vector * xstop, Hep3Vector * pstop, HepMatrix * covstart, HepMatrix * covstop, double * timestart, double * timestop) { - - double _trkl0 = krep.startValidRange(); - double _trkl1 = krep.endValidRange(); - HepPoint xstart_ = krep.position(_trkl0); - Hep3Vector pstart_ = krep.momentum(_trkl0); - double tstart_ = krep.arrivalTime(_trkl0); - HepPoint xstop_ = krep.position(_trkl1); - Hep3Vector pstop_ = krep.momentum(_trkl1); - double tstop_ = krep.arrivalTime(_trkl1); - HepSymMatrix xxcov0(3,0); - HepSymMatrix xxcov1(3,0); - HepSymMatrix ppcov0(3,0); - HepSymMatrix ppcov1(3,0); - HepMatrix xpcov0(3,3,0); - HepMatrix xpcov1(3,3,0); - HepMatrix covstart_(6,6,0); - HepMatrix covstop_(6,6,0); - krep.getAllCovs(_trkl0, xxcov0, ppcov0, xpcov0); - krep.getAllCovs(_trkl1, xxcov1, ppcov1, xpcov1); - - covstart_[0][0] = xxcov0[0][0]; - covstart_[0][1] = xxcov0[0][1]; - covstart_[0][2] = xxcov0[0][2]; - covstart_[0][3] = xpcov0[0][0]; - covstart_[0][4] = xpcov0[0][1]; - covstart_[0][5] = xpcov0[0][2]; - covstart_[1][1] = xxcov0[1][1]; - covstart_[1][2] = xxcov0[1][2]; - covstart_[1][3] = xpcov0[1][0]; - covstart_[1][4] = xpcov0[1][1]; - covstart_[1][5] = xpcov0[1][2]; - covstart_[2][2] = xxcov0[2][2]; - covstart_[2][3] = xpcov0[2][0]; - covstart_[2][4] = xpcov0[2][1]; - covstart_[2][5] = xpcov0[2][2]; - covstart_[3][3] = ppcov0[0][0]; - covstart_[3][4] = ppcov0[0][1]; - covstart_[3][5] = ppcov0[0][2]; - covstart_[4][4] = ppcov0[1][1]; - covstart_[4][5] = ppcov0[1][2]; - covstart_[5][5] = ppcov0[2][2]; - - covstop_[0][0] = xxcov1[0][0]; - covstop_[0][1] = xxcov1[0][1]; - covstop_[0][2] = xxcov1[0][2]; - covstop_[0][3] = xpcov1[0][0]; - covstop_[0][4] = xpcov1[0][1]; - covstop_[0][5] = xpcov1[0][2]; - covstop_[1][1] = xxcov1[1][1]; - covstop_[1][2] = xxcov1[1][2]; - covstop_[1][3] = xpcov1[1][0]; - covstop_[1][4] = xpcov1[1][1]; - covstop_[1][5] = xpcov1[1][2]; - covstop_[2][2] = xxcov1[2][2]; - covstop_[2][3] = xpcov1[2][0]; - covstop_[2][4] = xpcov1[2][1]; - covstop_[2][5] = xpcov1[2][2]; - covstop_[3][3] = ppcov1[0][0]; - covstop_[3][4] = ppcov1[0][1]; - covstop_[3][5] = ppcov1[0][2]; - covstop_[4][4] = ppcov1[1][1]; - covstop_[4][5] = ppcov1[1][2]; - covstop_[5][5] = ppcov1[2][2]; - for (int i = 1 ; i <6 ; ++i) { - for (int j = 0 ; j set(xstart_.x(), xstart_.y(), xstart_.z()); - pstart->set(pstart_.x(), pstart_.y(), pstart_.z()); - xstop->set(xstop_.x(), xstop_.y(), xstop_.z()); - pstop->set(pstop_.x(), pstop_.y(), pstop_.z()); - *covstart = covstart_; - *covstop = covstop_; - *timestart = tstart_; - *timestop = tstop_; - //see TrkMomCalculator::calcCurvAllCovs at BTrk/BaBar/BTrk/TrkBase/src/TrkMomCalculator.cc - return; - } - - // - ///////// Track extrapolation //////////// - - int TrkExt::doExtrapolation (Hep3Vector xx, Hep3Vector pp, double tt, HepMatrix ccov, bool direction, TrkExtInstanceNameEntry & instance) { - if (ccov.num_row() != 6 || ccov.num_col() != 6) { - if (_verbosity>=0) cout << "TrkExt Warning : cannot use cov matrix." <=2) cout << " small increment in ds " << endl; - r1 = calculateNextPosition(r0, ds, mass2, charge); - } while (r1.volumeId() == r0.volumeId()); - }*/ - //if (_verbosity>=2) cout << " final ds = " << ds << endl; - } - } //end of volume check - - // flight length: global (s) and local (dds) - s += ds; - dds += ds; - - // momentum loss term - deltapp = 0; - - // material effect check - if (_turnOnMaterialEffect) { - - // get mean energy loss - de_mean = _mydet.meanEnergyLoss(r0.momentum(), fabs(ds), TrkExtDetectorList::Enum(r0.volumeId())); //TODO: must be able to treat various ptls. now only electron get correct answer - - // get most probable energy loss - de_mp = _mydet.mostProbableEnergyLoss(r0.momentum(), fabs(ds), TrkExtDetectorList::Enum(r0.volumeId())); //TODO - - // deside which will be used - if (_useStoppingPower) { de = de_mean; } - else { de = de_mp; } - - // if energy loss do exist - if (de >0) { - - // convert to momentum loss. TODO : now its's not valid except electron/positron - double e1 = safeSqrt(r0.momentum().mag()*r0.momentum().mag() + mass2) - stepSign*de; - double p1 = safeSqrt(e1*e1-mass2); - double sf = p1 / r0.momentum().mag(); - deltapp = sf -1.; - - // apply to the momentum of next position (r1) - r1.scaleMomentum(sf); - - // record energy loss info - if (_flagEloss) { - _eloss_mean = de_mean / fabs(ds); - _eloss_mp = de_mp / fabs(ds); - _eloss_vid = r0.volumeId(); - _eloss_p = r0.momentum().mag(); - _hEloss->Fill(); - } - } - } // end of material effect check - - // covariance calculation -calculating covariance from transport is default - HepMatrix cov1 = getCovarianceTransport(r0, ds, deltapp, charge); - - // calculate covariance from multiple scattering and add to previous one - it's optional - if (_turnOnMultipleScattering) { - HepMatrix cov2 = getCovarianceMultipleScattering(r0, ds); - HepMatrix cov = cov1 + cov2; - r1.setCovariance (cov); - } - else { - r1.setCovariance (cov1); - } - - // PA and ST hit booking - if (r0.volumeId() != r1.volumeId()) { - if (r1.volumeId() == TrkExtDetectorList::ProtonAbsorber) { // entering to PA - enter_idx = r1.trajPointId(); - enter_volid = TrkExtDetectorList::ProtonAbsorber; - } - else if (r1.volumeId() == TrkExtDetectorList::StoppingTarget) { // entering to ST - enter_idx = r1.trajPointId(); - enter_volid = TrkExtDetectorList::StoppingTarget; - } - else if (r1.volumeId() == TrkExtDetectorList::ToyDS) { - if (enter_volid == TrkExtDetectorList::ProtonAbsorber) { // exiting from PA - _traj.addPAHit(enter_idx, r1.trajPointId()); - enter_idx = -1; - enter_volid = TrkExtDetectorList::Undefined; - } - else if (enter_volid == TrkExtDetectorList::StoppingTarget) { // exting from ST - _traj.addSTHit(enter_idx, r1.trajPointId()); - enter_idx = -1; - enter_volid = TrkExtDetectorList::Undefined; - } - } - else {;} - } - - // loop exit conditions : record and exit loop - if ( r1.volumeId() == TrkExtDetectorList::Undefined ) - exitcode = TrkExtExitCode::UndefinedVolume; - else if ( r1.momentum().mag() > _maxMomentum ) - exitcode = TrkExtExitCode::MaximumMomentum; - else if ( checkOutofReflectionLimit(direction, r1.position(), r1.momentum()) ) - exitcode = TrkExtExitCode::ReflectionLimit; - else if ( int(_traj.size()) >= _maxNBack-1) - exitcode = TrkExtExitCode::MaximumPoints; - else if ( fabs(dds) > _recordingStep - || r0.volumeId() != r1.volumeId() - || r0.volumeId() == TrkExtDetectorList::ProtonAbsorber - || r0.volumeId() == TrkExtDetectorList::StoppingTarget - || r0.pz() * r1.pz() <=0 ) - exitcode = TrkExtExitCode::WriteData; - else - exitcode = TrkExtExitCode::DoNotExit; - - if (exitcode == TrkExtExitCode::DoNotExit) { ; } - else if (exitcode == TrkExtExitCode::Undefined) { ; } - else if (exitcode == TrkExtExitCode::WriteData) { - _traj.push_back(r1); - dds = 0; - } - else { - _traj.push_back(r1); - break; - } - - // update start point - r0 = r1; - - } // end of stepping - - // book track-wide variable - _traj.setExitCode(exitcode); - _traj.setHepid(instance.hepid); - _traj.makePASTHitTable(); - return nsteps; - } - - ///////// Covariance //////////// - - HepMatrix TrkExt::getCovarianceTransport(TrkExtTrajPoint & r0, double ds, double deltapp, int charge) { - const HepMatrix & E = r0.covariance(); - HepMatrix Ep(6,6,0); - if (E.num_row() !=6 || E.num_col() !=6) { - if (_verbosity>=0) cout << "TrkExt Warning : cannot calculate covariance" << endl; - return Ep; - } - HepMatrix J(6,6,0); - double px = r0.px(); - double py = r0.py(); - double pz = r0.pz(); - double p = r0.momentum().mag(); - if (p == 0) { - if (_verbosity>=0) cout << "TrkExt Warning : 0 momentum?" << endl; - return Ep; - } - double pp = p*p; - double ppp = pp*p; - - double Bx; - double By; - double Bz; - double Bxx; - double Bxy; - double Bxz; - double Byx; - double Byy; - double Byz; - double Bzx; - double Bzy; - double Bzz; - - Hep3Vector B = getBFieldWithGradient (r0.position(), Bxx, Bxy, Bxz, Byx, Byy, Byz, Bzx, Bzy, Bzz) ; - Bx = B.x(); - By = B.y(); - Bz = B.z(); - - double kqds = ds * RUNGE_KUTTA_KQ * double(charge); - - J[0][0] = 1; - J[0][1] = 0; - J[0][2] = 0; - J[0][3] = ds*(py*py+pz*pz)/ppp; - J[0][4] = -ds*px*py/ppp; - J[0][5] = -ds*px*pz/ppp; - - J[1][0] = 0; - J[1][1] = 1; - J[1][2] = 0; - J[1][3] = -ds*py*px/ppp; - J[1][4] = ds*(pz*pz+px*px)/ppp; - J[1][5] = -ds*py*pz/ppp; - - J[2][0] = 0; - J[2][1] = 0; - J[2][2] = 1; - J[2][3] = -ds*pz*px; - J[2][4] = -ds*pz*py; - J[2][5] = ds*(px*px+py*py)/ppp; - - J[3][0] = kqds /p *(py*Bzx - pz*Byx); - J[3][1] = kqds /p *(py*Bzy - pz*Byy); - J[3][2] = kqds /p *(py*Bzz - pz*Byz); - J[3][3] = 1+deltapp-kqds/ppp*px*(py*Bz-pz*By); - J[3][4] = kqds/ppp *( Bz*pp - py*(py*Bz-pz*By)); - J[3][5] = kqds/ppp *(-By*pp - pz*(py*Bz-pz*By)); - - J[4][0] = kqds /p *(pz*Bxx - px*Bzx); - J[4][1] = kqds /p *(pz*Bxy - px*Bzy); - J[4][2] = kqds /p *(pz*Bxz - px*Bzz); - J[4][3] = kqds/ppp *(-Bz*pp - px*(pz*Bx-px*Bz)); - J[4][4] = 1+deltapp-kqds/ppp*py*(pz*Bx-px*Bz); - J[4][5] = kqds/ppp *( Bx*pp - pz*(pz*Bx-px*Bz)); - - J[5][0] = kqds /p *(px*Byx - py*Bxx); - J[5][1] = kqds /p *(px*Byy - py*Bxy); - J[5][2] = kqds /p *(px*Byz - py*Bxz); - J[5][3] = kqds/ppp *( By*pp - px*(px*By-py*Bx)); - J[5][4] = kqds/ppp *(-Bx*pp - py*(px*By-py*Bx)); - J[5][5] = 1+deltapp-kqds/ppp*pz*(px*By-py*Bx); - - HepMatrix JT = J.T(); - - Ep = J*E*JT; - - return Ep; - } - - HepMatrix TrkExt::getCovarianceMultipleScattering(TrkExtTrajPoint & r0, double ds) { - Hep3Vector e = r0.momentum().unit(); - double costh1 = e.x(); - double costh2 = e.y(); - double costh3 = e.z(); - double sinth12 = 1. - costh1*costh1; - double sinth22 = 1. - costh2*costh2; - double sinth32 = 1. - costh3*costh3; - - HepMatrix R(3,3,0); - R[0][0] = sinth12; - R[0][1] = -costh1*costh2; - R[0][2] = -costh1*costh3; - R[1][0] = R[0][1]; - R[1][1] = sinth22; - R[1][2] = -costh2*costh3; - R[2][0] = R[0][2]; - R[2][1] = R[1][2]; - R[2][2] = sinth32; - - double th = _mydet.scatteringAngle(r0.momentum(), ds, TrkExtDetectorList::Enum(r0.volumeId())); - double p = r0.momentum().mag(); - double m11 = 0.3333*th*th*ds*ds; - double m12 = 0.5*th*th*ds*p; - double m22 = th*th*p*p; - - HepMatrix Em(6,6,0); - - for (int i = 0 ; i < 3 ; ++i) { - for (int j = 0 ; j <3 ; ++j) { - Em[i][j] = m11 * R[i][j]; - Em[i+3][j] = Em[i][j+3] = m12 * R[i][j]; - Em[i+3][j+3] = m22 * R[i][j]; - } - } - - return Em; - } - - ///////// Functions for Runge-Kutta method //////////// - - TrkExtTrajPoint TrkExt::calculateNextPosition (TrkExtTrajPoint r00, double ds, double mass2, int charge) { - HepVector r0(6), re(6); - r0 = r00.vector(); - HepVector dr1_ds = _runge_kutta_newpar_f(r0, getBField(r0), charge); HepVector r1 = r0+0.5*ds*dr1_ds; - HepVector dr2_ds = _runge_kutta_newpar_f(r1, getBField(r1), charge); HepVector r2 = r0+0.5*ds*dr2_ds; - HepVector dr3_ds = _runge_kutta_newpar_f(r2, getBField(r2), charge); HepVector r3 = r0+ds*dr3_ds; - HepVector dr4_ds = _runge_kutta_newpar_f(r3, getBField(r3), charge); - - re = r0 + (dr1_ds/6. + dr2_ds/3. + dr3_ds/3. + dr4_ds/6.)*ds; - - Hep3Vector x(re[0], re[1], re[2]); - int volid = _mydet.volumeId(x); - - double p = r00.momentum().mag(); - double v = p/safeSqrt(p*p+mass2)*VELOCITY_OF_LIGHT; - double ft = ds / v * 1.e6; - - return TrkExtTrajPoint(r00.trajPointId()+1, re, volid, r00.flightLength()+ds, r00.flightTime()+ft); - } - - HepVector TrkExt::_runge_kutta_newpar_5th (HepVector r0, double ds, bool mode, int charge) { - - // static double a2 = 0.2; - // static double a3 = 0.3; - // static double a4 = 0.6; - // static double a5 = 1.; - // static double a6 = 0.825; - static double b21 = 0.2; - static double b31 = 0.075; - static double b32 = 0.225; - static double b41 = 0.3; - static double b42 = -0.9; - static double b43 = 1.2; - static double b51 = -11./54.; - static double b52 = 2.5; - static double b53 = -70./27.; - static double b54 = 35./27.; - static double b61 = 1631./55296.; - static double b62 = 175./512.; - static double b63 = 575./13824.; - static double b64 = 44275./110592.; - static double b65 = 253./4096.; - static double c1 = 37./378.; - static double c2 = 0.; - static double c3 = 250./621.; - static double c4 = 125./594.; - static double c5 = 0.; - static double c6 = 512./1771.; - static double c1s = 2825./27648.; - static double c2s = 0.; - static double c3s = 18575./48384.; - static double c4s = 13525./55296.; - static double c5s = 277./14336.; - static double c6s = 0.25; - - HepVector k1 = ds*_runge_kutta_newpar_f(r0, getBField(r0), charge); HepVector r1 = r0 + b21*k1; - HepVector k2 = ds*_runge_kutta_newpar_f(r1, getBField(r1), charge); HepVector r2 = r0 + b31*k1 + b32*k2; - HepVector k3 = ds*_runge_kutta_newpar_f(r2, getBField(r2), charge); HepVector r3 = r0 + b41*k1 + b42*k2 + b43*k3; - HepVector k4 = ds*_runge_kutta_newpar_f(r3, getBField(r3), charge); HepVector r4 = r0 + b51*k1 + b52*k2 + b53*k3 + b54*k4; - HepVector k5 = ds*_runge_kutta_newpar_f(r4, getBField(r4), charge); HepVector r5 = r0 + b61*k1 + b62*k2 + b63*k3 + b64*k4 + b65*k5; - HepVector k6 = ds*_runge_kutta_newpar_f(r5, getBField(r5), charge); - - if (mode) { - return r0 + c1*k1 + c2*k2 + c3*k3 + c4*k4 + c5*k5 + c6*k6; - }else { - return r0 + c1s*k1 + c2s*k2 + c3s*k3 + c4s*k4 + c5s*k5 + c6s*k6; - } - } - - HepVector TrkExt::_runge_kutta_newpar_f (HepVector r, Hep3Vector B, int charge) { - HepVector ret(6); - Hep3Vector p(r[3], r[4], r[5]); - Hep3Vector e = p.unit(); - Hep3Vector p_ = double(charge) * RUNGE_KUTTA_KQ* (e.cross(B)); - ret[0] = e.x(); - ret[1] = e.y(); - ret[2] = e.z(); - ret[3] = p_.x(); - ret[4] = p_.y(); - ret[5] = p_.z(); - return ret; - } - -} // end namespace mu2e - -using mu2e::TrkExt; -DEFINE_ART_MODULE(TrkExt) diff --git a/TrkExt/test/TrkExt.fcl b/TrkExt/test/TrkExt.fcl deleted file mode 100644 index a826d669b0..0000000000 --- a/TrkExt/test/TrkExt.fcl +++ /dev/null @@ -1,156 +0,0 @@ -# Configuration file for TrkPatRec01 -# - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -# Give this job a name. -process_name : TrkExt - -source : -{ - module_type : EmptyEvent - maxEvents : 100 -} - -services : -{ - message : @local::default_message - - TFileService : { fileName : "result-TrkExt.root" } - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - - BTrkHelper : @local::BTrkHelperDefault - - Mu2eG4Helper : { } - - SeedService : @local::automaticSeeds - -} - -physics : -{ - producers : - { - # Generate the event - generate: @local::generate - - # Run G4 and add hits to the event - g4run : @local::g4run - - # Form StrawHits (SH). - makeSH : @local::makeSH - FSHPreStereo : @local::FSHPreStereo - MakeStereoHits : @local::MakeStereoHits - FlagStrawHits :@local::FlagStrawHits - FlagBkgHits : @local::FlagBkgHits - tprDem : @local::TrkPatRecDeM - tprDep : @local::TrkPatRecDeP - tprUem : @local::TrkPatRecUeM - tprUep : @local::TrkPatRecUeP - - - # extrapolation producer module - # all configurations are recommanded to be kept as they are - trkext : - { - module_type : TrkExt - # Following three lines are for instances to be processed in the extrapolation - # Note that their order should be consistent - fitterModuleLabelArray : ["tprDem", "tprDep", "tprUem", "tprUep"] - fitparticleArray : [11, -11, 11, -11] - fitdirectionArray : [0, 0, 1, 1] - g4ModuleLabel : g4run - makerModuleLabel : makeSH - maxMomentum : 110.0 - turnOnMaterialEffect : true - useStoppingPower : false - maxNBack : 10000 - extrapolationStep : 0.1 - recordingStep : 5.0 - mcFlag : true - useVirtualDetector : false - bFieldGradientMode : 0 - turnOnMultipleScattering : true - debugLevel : 1 - verbosity : 2 - } - - - } - - - analyzers : - { - - # analyzer module for extrapolation - extRec : - { - module_type : ReadTrkExt - # for following three lines, see the comments at producer module - fitterModuleLabelArray : ["tprDem", "tprDep", "tprUem", "tprUep"] - fitparticleArray : [11, -11, 11, -11] - fitdirectionArray : [0, 0, 1, 1] - trkextModuleLabel : trkext - recordKalFit : true - verbosity : 1 - maxPrint :10 - processEmpty : false - KalFirMC : { - } - TrkExt : { - g4ModuleLabel : g4run - makerModuleLabel : makeSH - } - } - - eventdisplay: - { - module_type : EventDisplay - g4ModuleLabel : g4run - } - - readTprDem : - { - module_type : ReadKalFits - fitterModuleLabel : tprDem - KalFitMC : - { - } - } - - } - - - p1 : [generate, g4run, makeSH, FSHPreStereo, MakeStereoHits, FlagStrawHits, FlagBkgHits, tprUem, tprUep, tprDem, tprDep, trkext] - e1 : [extRec] - e2 : [extRec, readTprDem, eventdisplay, outfile] - - trigger_paths : [p1] - end_paths : [e1] - -} - -outputs: { - - outfile : { - module_type : RootOutput - fileName : "alloutput-TrkExt.root" - - } - -} - - -physics.producers.generate.inputfile : "Offline/Mu2eG4/test/genconfig_01.txt" -physics.producers.makeSH.diagLevel : 0 -physics.producers.makeSH.maxFullPrint : 0 -services.SeedService.baseSeed : 8 -services.SeedService.maxUniqueEngines : 20 diff --git a/TrkFilters/fcl/TTDigis.fcl b/TrkFilters/fcl/TTDigis.fcl index 51b983b8d5..5c2855af51 100644 --- a/TrkFilters/fcl/TTDigis.fcl +++ b/TrkFilters/fcl/TTDigis.fcl @@ -31,7 +31,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } - BTrkHelper : @local::BTrkHelperDefault SeedService : { @table::automaticSeeds baseSeed : 8 maxUniqueEngines : 20 diff --git a/TrkFilters/src/SConscript b/TrkFilters/src/SConscript index 3e41a97cbd..96e835cb69 100644 --- a/TrkFilters/src/SConscript +++ b/TrkFilters/src/SConscript @@ -16,7 +16,6 @@ babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [] ) # Fixme: split into link lists for each module. helper.make_plugins( [ mainlib, - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_SeedService', 'mu2e_ConditionsService', diff --git a/TrkPatRec/CMakeLists.txt b/TrkPatRec/CMakeLists.txt index 5bd366383e..8c233580f4 100644 --- a/TrkPatRec/CMakeLists.txt +++ b/TrkPatRec/CMakeLists.txt @@ -7,51 +7,12 @@ cet_make_library(INTERFACE INSTALLED_PATH_BASE Offline inc/TimeAndPhiClusterFinder_types.hh inc/TrkHitFilter.hh LIBRARIES INTERFACE - ) -#cet_build_plugin(KalFinalFit art::module -# REG_SOURCE src/KalFinalFit_module.cc -# LIBRARIES REG -# Offline::TrkPatRec -# -# Offline::BTrkData -# Offline::CalorimeterGeom -# Offline::DataProducts -# Offline::GeneralUtilities -# Offline::GeometryService -# Offline::Mu2eUtilities -# Offline::ProditionsService -# Offline::RecoDataProducts -# Offline::TrackerConditions -# Offline::TrackerGeom -# Offline::TrkReco -#) - -#cet_build_plugin(KalSeedFit art::module -# REG_SOURCE src/KalSeedFit_module.cc -# LIBRARIES REG -# Offline::TrkPatRec - -# Offline::BFieldGeom -# Offline::BTrkData -# Offline::ConditionsService -# Offline::DataProducts -# Offline::GeneralUtilities -# Offline::GeometryService -# Offline::Mu2eUtilities -# Offline::ProditionsService -# Offline::RecoDataProducts -# Offline::TrackerConditions -# Offline::TrackerGeom -# Offline::TrkReco -#) - cet_build_plugin(RobustHelixFinder art::module REG_SOURCE src/RobustHelixFinder_module.cc LIBRARIES REG Offline::TrkPatRec - Offline::boost_fix Offline::CalorimeterGeom Offline::ConfigTools @@ -69,7 +30,6 @@ cet_build_plugin(RobustMultiHelixFinder art::module REG_SOURCE src/RobustMultiHelixFinder_module.cc LIBRARIES REG Offline::TrkPatRec - Offline::boost_fix Offline::CalorimeterGeom Offline::ConfigTools @@ -87,7 +47,6 @@ cet_build_plugin(TimeAndPhiClusterFinder art::module REG_SOURCE src/TimeAndPhiClusterFinder_module.cc LIBRARIES REG Offline::TrkPatRec - Offline::Mu2eUtilities Offline::RecoDataProducts ) @@ -96,41 +55,16 @@ cet_build_plugin(TimeClusterFinder art::module REG_SOURCE src/TimeClusterFinder_module.cc LIBRARIES REG Offline::TrkPatRec - Offline::GeneralUtilities Offline::Mu2eUtilities Offline::RecoDataProducts Offline::TrkReco ) -#cet_build_plugin(KalFinalFitDiag art::tool -# REG_SOURCE src/KalFinalFitDiag_tool.cc -# LIBRARIES REG -# Offline::TrkPatRec -# -# Offline::BTrkData -# Offline::CalorimeterGeom -# Offline::Mu2eUtilities -# Offline::TrackerGeom -# Offline::TrkReco -#) - -#cet_build_plugin(KalSeedFitDiag art::tool -# REG_SOURCE src/KalSeedFitDiag_tool.cc -# LIBRARIES REG -# Offline::TrkPatRec -# -# Offline::BTrkData -# Offline::Mu2eUtilities -# Offline::TrkReco -#) - cet_build_plugin(RobustHelixFinderDiag art::tool REG_SOURCE src/RobustHelixFinderDiag_tool.cc LIBRARIES REG Offline::TrkPatRec - - Offline::BTrkData Offline::Mu2eUtilities Offline::TrkReco ) @@ -139,8 +73,6 @@ cet_build_plugin(RobustMultiHelixFinderDiag art::tool REG_SOURCE src/RobustMultiHelixFinderDiag_tool.cc LIBRARIES REG Offline::TrkPatRec - - Offline::BTrkData Offline::Mu2eUtilities Offline::TrkReco ) @@ -149,7 +81,6 @@ cet_build_plugin(TimeAndPhiClusterFinderDiag art::tool REG_SOURCE src/TimeAndPhiClusterFinderDiag_tool.cc LIBRARIES REG Offline::TrkPatRec - Offline::GeometryService Offline::MCDataProducts Offline::Mu2eUtilities diff --git a/TrkPatRec/src/SConscript b/TrkPatRec/src/SConscript index 09863a8945..7af809c0fd 100644 --- a/TrkPatRec/src/SConscript +++ b/TrkPatRec/src/SConscript @@ -16,9 +16,8 @@ rootlibs = env['ROOTLIBS'] helper = mu2e_helper(env) -mainlib = helper.make_mainlib(['mu2e_Mu2eBTrk', +mainlib = helper.make_mainlib([ 'mu2e_TrkReco', - 'mu2e_BTrkData', 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', @@ -50,10 +49,8 @@ mainlib = helper.make_mainlib(['mu2e_Mu2eBTrk', ]) helper.make_plugins([mainlib, - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_TrkReco', - 'mu2e_BTrkData', 'mu2e_ConditionsService', 'mu2e_TrackerConditions', 'mu2e_GeometryService', diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index fd4a9b658d..886d0dfc9b 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -7,15 +7,12 @@ cet_make_library( src/TrkTimeCalculator.cc src/TrkUtilities.cc LIBRARIES PUBLIC - BTrk_difAlgebra Offline::BFieldGeom - Offline::BTrkData Offline::CalorimeterGeom Offline::ConditionsService Offline::DataProducts Offline::GeneralUtilities Offline::GeometryService - Offline::Mu2eBTrk Offline::Mu2eUtilities Offline::ProditionsService Offline::RecoDataProducts @@ -79,25 +76,6 @@ cet_build_plugin(SelectSameTrack art::module Offline::RecoDataProducts ) -#cet_build_plugin(TrkRecoMcUtils art::tool -# REG_SOURCE src/TrkRecoMcUtils_tool.cc -# LIBRARIES REG - #Offline::TrkReco - #Offline::BTrkData - #Offline::ConditionsService - #Offline::MCDataProducts - #Offline::Mu2eUtilities - #Offline::RecoDataProducts - #Offline::TrackerGeom -#) - -#art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults -# CLASSES_DEF_XML ${CMAKE_CURRENT_SOURCE_DIR}/src/classes_def.xml -# CLASSES_H ${CMAKE_CURRENT_SOURCE_DIR}/src/classes.h -# DICTIONARY_LIBRARIES -# Offline::TrkReco -#) - install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) install_fhicl(SUBDIRS fcl SUBDIRNAME Offline/TrkReco/fcl) diff --git a/TrkReco/inc/RobustHelixFinderData.hh b/TrkReco/inc/RobustHelixFinderData.hh index 7282038036..60aa4c062e 100644 --- a/TrkReco/inc/RobustHelixFinderData.hh +++ b/TrkReco/inc/RobustHelixFinderData.hh @@ -160,7 +160,6 @@ namespace mu2e { // double _helixChi2; - // TrkParticle _tpart; // TrkFitDirection _fdir; const ComboHitCollection* _chcol; diff --git a/TrkReco/inc/TrkUtilities.hh b/TrkReco/inc/TrkUtilities.hh index d04e47d5ad..fb0ac5243d 100644 --- a/TrkReco/inc/TrkUtilities.hh +++ b/TrkReco/inc/TrkUtilities.hh @@ -10,9 +10,6 @@ #include "Offline/RecoDataProducts/inc/StrawHitIndex.hh" #include -class HelixTraj; -class BbrVectorErr; -class KalRep; class TrkDifPieceTraj; namespace mu2e { class RobustHelix; @@ -27,28 +24,14 @@ namespace mu2e { class ComboHitCollection; typedef std::vector SHIV; namespace TrkUtilities { - // convert the robust helix format into the BaBar format HelixTraj. This requires - // the sign of the angular momentum about the z axis, as the BaBar rep os semi-kinematic - bool RobustHelix2Traj (RobustHelix const& helix, CLHEP::HepVector& hpvec, float amsign); // create a robust helix from raw particle informaiton. This is useful for MC comparison void RobustHelixFromMom(CLHEP::Hep3Vector const& pos, CLHEP::Hep3Vector const& mom, double charge, double Bz, RobustHelix& helix); - // create a KalSegment (helix segment) from a HelixTraj - //void fillSegment(HelixTraj const& htraj, double locflt, double globflt, TrkT0 t0, double mass, int charge, BField const& bfield, KalSegment& kseg); - // create HitSeeds from the TrkStrawHits in a KalRep - void fillStrawHitSeeds(const KalRep* krep, ComboHitCollection const& chits, std::vector& hitseeds); - void fillCaloHitSeed(const TrkCaloHit* chit, CLHEP::Hep3Vector const& tmom, TrkCaloHitSeed& caloseed); - void fillStraws(const KalRep* krep, std::vector& straws); // compute overlap between 2 time clusters double overlap(TimeCluster const& tc1, TimeCluster const& tc2); double overlap(KalSeed const& ks1, KalSeed const& ks2); double overlap(KalSeed const& ks, HelixSeed const& hs); double overlap(HelixSeed const& hs,TimeCluster const& tc); double overlap(SHIV const& shiv1, SHIV const& shiv2); - // compute the flightlength for a given z position - // double zFlight(TrkDifPieceTraj const& ptraj, double pz); - double chisqConsistency(const KalRep* krep); - unsigned countBends(const KalRep* krep); - const TrkCaloHit* findTrkCaloHit(const KalRep* krep); // simple kinematic utilities double energy(double mass, double momentum); double beta(double mass, double momentum); diff --git a/TrkReco/src/SConscript b/TrkReco/src/SConscript index 5b8933e4fa..747a438fd2 100644 --- a/TrkReco/src/SConscript +++ b/TrkReco/src/SConscript @@ -14,8 +14,6 @@ rootlibs = env['ROOTLIBS'] babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_ConditionsService', 'mu2e_GeometryService', @@ -54,7 +52,6 @@ mainlib = helper.make_mainlib ( [ # Fixme: split into link lists for each module. helper.make_plugins( [ mainlib, - 'mu2e_BTrkData', 'mu2e_Mu2eUtilities', 'mu2e_SeedService', 'mu2e_ConditionsService', diff --git a/TrkReco/src/TrkUtilities.cc b/TrkReco/src/TrkUtilities.cc index f0255ebcd4..6c93eeeff5 100644 --- a/TrkReco/src/TrkUtilities.cc +++ b/TrkReco/src/TrkUtilities.cc @@ -28,36 +28,6 @@ using CLHEP::HepSymMatrix; using CLHEP::HepVector; namespace mu2e { namespace TrkUtilities { -/* - bool RobustHelix2Traj (RobustHelix const& helix, HepVector& hpvec, float amsign) { - bool retval(false); - // compare the input with this configuration's helicity: these must be the same - // radius = 0 or lambda=0 are degenerate cases that this representation can't handle - if(helix.radius() > 0.0 && helix.lambda() != 0.0 && hpvec.num_row() == HelixTraj::NHLXPRM) { - // radius and omega have inverse magnitude, omega is signed by the angular momentum - hpvec[HelixTraj::omegaIndex] = amsign/helix.radius(); - // phi0 is the azimuthal angle of the particle velocity vector at the point - // of closest approach to the origin. It's sign also depends on the angular - // momentum. To translate from the center, we need to reverse coordinates - hpvec[HelixTraj::phi0Index] = atan2(-amsign*helix.centerx(),amsign*helix.centery()); - // d0 describes the distance to the origin at closest approach. - // It is signed by the particle angular momentum WRT the origin. - // The Helix fit radial bias is anti-correlated with d0; correct for it here. - hpvec[HelixTraj::d0Index] = amsign*(helix.rcent() - helix.radius()); - // the dip angle is measured WRT the perpendicular, signed by the z component of linear momentum - hpvec[HelixTraj::tanDipIndex] = amsign*helix.lambda()/helix.radius(); - // must change conventions here: fz0 is the phi at z=0, z0 is defined at the point of closest approach - // resolve the loop ambiguity such that the POCA is closest to z=0. - double refphi = helix.fz0()+amsign*M_PI_2; - double phi = hpvec[HelixTraj::phi0Index]; - double dphi = Angles::deltaPhi(phi,refphi); - // choose z0 (which loop) so that f=0 is as close to z=0 as possible - hpvec[HelixTraj::z0Index] = dphi*hpvec[HelixTraj::tanDipIndex]/hpvec[HelixTraj::omegaIndex]; - retval = true; - } - return retval; - } - */ void RobustHelixFromMom(Hep3Vector const& pos, Hep3Vector const& mom, double charge, double Bz, RobustHelix& helix){ double momToRad = 1000.0/(charge*Bz*CLHEP::c_light); // compute some simple useful parameters @@ -76,108 +46,7 @@ namespace mu2e { Angles::deltaPhi(phi); helix._fz0 = phi; } - /* - // legacy function - void fillSegment(HelixTraj const& htraj, double locflt, double globflt, TrkT0 t0, double mass, int charge, BField const& bfield, KalSegment& kseg) { - // compute the kinematics; this is external to htraj - double radToMom = charge*bfield.bFieldNominal()*CLHEP::c_light/1000.0; - double mom = fabs(radToMom/(htraj.omega()*htraj.cosDip())); - double energy = sqrt(mom*mom + mass*mass); - double v = CLHEP::c_light*mom/energy; - double vz = v*htraj.sinDip(); - // translate BTrk t0 to CentralHelix t0 (different convention) - double ct0 = t0.t0() + htraj.z0()/vz; - // translate htraj (3D) flight range to time ranges - double tmin = ct0 + htraj.lowRange()/v; - double tmax = ct0 + htraj.hiRange()/v; - double tref = ct0 + locflt/v; - // conver the helix content to a CentralHelix. Note the t0 value supplied is in the BTrk convention (time at z=0). - KinKal::DVEC chpars; - KinKal::DMAT cov; - for(unsigned ipar=0; ipar<5; ipar++){ - chpars(ipar) = htraj.parameters()->parameter()[ipar]; - for(unsigned jpar=0; jpar<5; jpar++){ - cov(ipar,jpar) = htraj.parameters()->covariance().fast(ipar+1,jpar+1); - } - } - // insert t0 by hand - chpars(KinKal::CentralHelix::t0_) = ct0; - cov(KinKal::CentralHelix::t0_,KinKal::CentralHelix::t0_) = t0.t0Err()*t0.t0Err(); - KinKal::Parameters params(chpars,cov); - // create the CentralHelix from these - KinKal::CentralHelix chelix(params,mass,charge,bfield.bFieldNominal(),KinKal::TimeRange(tmin,tmax)); - kseg = KalSegment(chelix, tref, globflt-locflt); - } - - void fillStraws(const KalRep* krep, std::vector& tstraws) { - tstraws.clear(); -// disabled: not compatible with KinKal - - // get material sites from the KalRep -// for(auto isite : krep->siteList()){ -// if(isite->kalMaterial() != 0) { -// const KalMaterial* kmat = isite->kalMaterial(); -// const DetStrawElem* detstraw = dynamic_cast(kmat->detElem()); -// if(detstraw != 0){ -// // found a straw: create a TrkStraw object from it -// // i must recompute POCA since the KalMaterial doesn't cache the hit flight FIXME! -// TrkPoca poca(krep->traj(),kmat->detIntersection().pathlen,*detstraw->wireTraj(),0); -// TrkStraw tstraw(detstraw->straw()->id(), -// kmat->detIntersection().dist, //poca.doca(), -// kmat->detIntersection().pathlen, // poca.flt1(), -// poca.flt2(), // not stored in KalMaterial, FIXME! -// kmat->detIntersection().pathLength(), -// detstraw->radiationFraction(kmat->detIntersection()), -// kmat->momFraction(), -// isite->isActive() ); -// tstraws.push_back(tstraw); -// } -// } -// } - } - - void fillStrawHitSeeds(const KalRep* krep,ComboHitCollection const& chits, std::vector& hitseeds) { - // extract the TkrStrawHits from the KalRep - TrkStrawHitVector tshv; - convert(krep->hitVector(),tshv); - // loop over the TrkStrawHits and convert them - for(auto tsh : tshv ) { - // find the associated ComboHit - auto const& chit = chits.at(tsh->index()); - // set the flag according to the status of this hit - StrawHitFlag hflag = chit.flag(); - if(tsh->isActive())hflag.merge(StrawHitFlag::active); - if(tsh->poca().status().success())hflag.merge(StrawHitFlag::doca); - int state = tsh->ambig(); - if(!tsh->isActive())state = -2; - CLHEP::Hep3Vector hpos = tsh->hitTraj()->position(tsh->hitLen()); - float upos = (hpos-tsh->straw().wirePosition(0.0)).dot(tsh->straw().wireDirection()); - float dt = tsh->signalTime() - tsh->driftTime()-tsh->hitT0()._t0; - hitseeds.emplace_back(tsh->index(), - tsh->hitT0(), tsh->fltLen(), tsh->hitLen(), - tsh->driftRadius(), tsh->signalTime(), upos, dt, - tsh->poca().doca(), state, tsh->driftRadiusErr(), hflag, chit); - } - } - - - void fillCaloHitSeed(const TrkCaloHit* tch, CLHEP::Hep3Vector const& tmom, TrkCaloHitSeed& caloseed) { - // set the flag according to the status of this hit - StrawHitFlag hflag; - if(tch->isActive())hflag.merge(StrawHitFlag::active); - if(tch->poca().status().success())hflag.merge(StrawHitFlag::doca); - Hep3Vector hpos; - tch->hitPosition(hpos); - caloseed = TrkCaloHitSeed(tch->hitT0(), tch->fltLen(), tch->hitLen(), - tch->poca().doca(), tch->hitErr(), tch->time() + tch->timeOffset(), tch->timeErr(), - XYZVectorF(hpos), - XYZVectorF(tmom), - hflag); - } - // DNB: the timeOffset() should NOT be added to time(), it is a double correction. - // I'm leaving for now as the production was run with this error FIXME! -*/ - // compute the overlap between 2 clusters + // compute the overlap between 2 clusters double overlap(SHIV const& shiv1, SHIV const& shiv2) { double over(0.0); double norm = std::min(shiv1.size(),shiv2.size()); diff --git a/TrkReco/src/classes.h b/TrkReco/src/classes.h deleted file mode 100644 index 9cd10d8771..0000000000 --- a/TrkReco/src/classes.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// Original author Rob Kutschke -// - -#include "canvas/Persistency/Common/Wrapper.h" - -#include "BTrk/KalmanTrack/KalRep.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -//#include "Offline/TrkReco/inc/PanelAmbigStructs.hh" diff --git a/Validation/CMakeLists.txt b/Validation/CMakeLists.txt index e341a22355..b7674e093c 100644 --- a/Validation/CMakeLists.txt +++ b/Validation/CMakeLists.txt @@ -37,7 +37,7 @@ cet_make_library( src/ValTriggerInfo.cc src/ValTriggerResults.cc LIBRARIES PUBLIC - + Offline::DataProducts Offline::GeometryService Offline::KinKalGeom @@ -58,7 +58,6 @@ cet_make_library(LIBRARY_NAME Validation_Root root/TValHist2.cc root/TValPar.cc LIBRARIES PUBLIC - BTrk_difAlgebra Offline::Validation ROOT::Postscript ROOT::Core @@ -71,7 +70,7 @@ cet_make_exec(NAME valCompare LIBRARIES Offline::Validation_Root Offline::Validation_dict - + ) cet_build_plugin(Validation art::module @@ -79,7 +78,7 @@ cet_build_plugin(Validation art::module LIBRARIES REG Offline::Validation_Root Offline::Validation_dict - + ) art_dictionary( NO_CHECK_CLASS_VERSION diff --git a/ups/product_deps b/ups/product_deps index 6b04a16739..92fd8d315c 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -246,7 +246,6 @@ gallery v1_22_03 s128 geant4 v4_11_1_p02d s128 xerces_c v3_2_3e artdaq_core_mu2e v3_00_00 -BTrk v1_02_46 s128 KinKal v03_00_01 s128 cry v1_7q gsl v2_7 @@ -305,7 +304,7 @@ end_product_list # *required* unless the only_for_build flag is specified, in which # case it is optional. # -qualifier art_root_io gallery geant4 xerces_c artdaq_core_mu2e BTrk KinKal cry gsl +qualifier art_root_io gallery geant4 xerces_c artdaq_core_mu2e KinKal cry gsl e28:s128:trig:debug e28:debug e28:debug - e28 e28:s128:debug e28:p3915:debug e28:p3915:debug - -nq- e28:s128:trig:prof e28:prof e28:prof - e28 e28:s128:prof e28:p3915:prof e28:p3915:prof - -nq- From 75be538ac682ae8242c5f12612094e3248e8e8f4 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 09:33:00 -0800 Subject: [PATCH 094/174] more removal; compiles --- CalPatRec/inc/HlPrint.hh | 1 - EventDisplay/src/ContentSelector.cc | 9 -- EventDisplay/src/ContentSelector.h | 2 - EventDisplay/src/DataInterface.cc | 42 -------- Print/inc/TrackClusterMatchPrinter.hh | 42 -------- Print/src/PrintModule_module.cc | 5 - Print/src/TrackClusterMatchPrinter.cc | 114 ---------------------- RecoDataProducts/CMakeLists.txt | 1 - RecoDataProducts/inc/TrackClusterMatch.hh | 109 --------------------- RecoDataProducts/src/TrackClusterMatch.cc | 64 ------------ RecoDataProducts/src/classes.h | 1 - RecoDataProducts/src/classes_def.xml | 4 - Validation/CMakeLists.txt | 1 - Validation/inc/ValTrackClusterMatch.hh | 36 ------- Validation/src/ValTrackClusterMatch.cc | 42 -------- Validation/src/Validation_module.cc | 4 - 16 files changed, 477 deletions(-) delete mode 100644 Print/inc/TrackClusterMatchPrinter.hh delete mode 100644 Print/src/TrackClusterMatchPrinter.cc delete mode 100644 RecoDataProducts/inc/TrackClusterMatch.hh delete mode 100644 RecoDataProducts/src/TrackClusterMatch.cc delete mode 100644 Validation/inc/ValTrackClusterMatch.hh delete mode 100644 Validation/src/ValTrackClusterMatch.cc diff --git a/CalPatRec/inc/HlPrint.hh b/CalPatRec/inc/HlPrint.hh index 6b1a82b0a5..2c63d5c3d1 100644 --- a/CalPatRec/inc/HlPrint.hh +++ b/CalPatRec/inc/HlPrint.hh @@ -30,7 +30,6 @@ namespace mu2e { class StepPointMC; class StrawDigiMC; class StrawGasStep; - class TrackClusterMatch; class TrkCaloHit; class TrkStrawHit; class TrkPrintUtils; diff --git a/EventDisplay/src/ContentSelector.cc b/EventDisplay/src/ContentSelector.cc index 3c8cad09ad..be3ecdbd11 100644 --- a/EventDisplay/src/ContentSelector.cc +++ b/EventDisplay/src/ContentSelector.cc @@ -26,8 +26,6 @@ void ContentSelector::firstLoop() //This is useful for now, but may be changed entry=_caloHitBox->FindEntry("CaloHit:CaloHitsMaker:"); if(entry!=nullptr) _caloHitBox->Select(entry->EntryId()); - entry=_trackBox->FindEntry("TrkExtTraj:TrkExt:"); - if(entry!=nullptr) _trackBox->Select(entry->EntryId()); entry=_trackBox->FindEntry("SimParticle:g4run:"); if(entry!=nullptr) _trackBox->Select(entry->EntryId()); @@ -368,12 +366,6 @@ std::vector ContentSelector::getSelectedTrackCollection(s t.productId=_simParticleVector[index].id(); v.push_back(t); break; - case 3 : if(typeid(CollectionType)!=typeid(mu2e::TrkExtTrajCollection)) break; - if(index>=static_cast(_trkExtTrajVector.size())) break; - to_return.push_back(reinterpret_cast(_trkExtTrajVector[index].product())); - t.productId=_trkExtTrajVector[index].id(); - v.push_back(t); - break; case 4 : if(typeid(CollectionType)!=typeid(mu2e::KalSeedCollection)) break; if(index>=static_cast(_kalSeedTrkVector.size())) break; to_return.push_back(reinterpret_cast(_kalSeedTrkVector[index].product())); @@ -385,7 +377,6 @@ std::vector ContentSelector::getSelectedTrackCollection(s return(to_return); } template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; -template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; template std::vector ContentSelector::getSelectedTrackCollection(std::vector &v) const; const mu2e::PhysicalVolumeInfoMultiCollection* ContentSelector::getPhysicalVolumeInfoMultiCollection() const diff --git a/EventDisplay/src/ContentSelector.h b/EventDisplay/src/ContentSelector.h index 1d69320e04..5d17eb71bc 100644 --- a/EventDisplay/src/ContentSelector.h +++ b/EventDisplay/src/ContentSelector.h @@ -28,7 +28,6 @@ #include using namespace CLHEP; -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" namespace mu2e_eventdisplay { @@ -51,7 +50,6 @@ class ContentSelector std::vector > _mcTrajectoryVector; std::vector > _kalSeedTrkVector; std::vector > _kalSeedHitVector; - std::vector > _trkExtTrajVector; art::Handle _physicalVolumesMulti; art::Handle _protonBunchTime; bool _hasPhysicalVolumesMulti; diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index ef3d24113f..45dc3f34ba 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -35,7 +35,6 @@ using namespace std; #include "Offline/RecoDataProducts/inc/CaloHit.hh" #include "Offline/RecoDataProducts/inc/StrawHit.hh" #include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" #include "Offline/StoppingTargetGeom/inc/StoppingTarget.hh" #include "Offline/StoppingTargetGeom/inc/TargetFoil.hh" #include "Offline/TrkReco/inc/TrkUtilities.hh" @@ -1303,47 +1302,6 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS // TrkExt track trackInfos.clear(); - std::vector trkExtTrajCollectionVector=contentSelector->getSelectedTrackCollection(trackInfos); - for(unsigned int i=0; iparticle(particleid).name(); - boost::shared_ptr info(new ComponentInfo()); - std::string c=Form("TrkExt Trajectory %i %s (%s)", trkExtTraj.id(), particlename.c_str(),trackcollection.c_str()); - info->setName(c.c_str()); - info->setText(0,c.c_str()); - - double p1 = trkExtTraj.front().momentum().mag(); - double x1 = trkExtTraj.front().x(); - double y1 = trkExtTraj.front().y(); - double z1 = trkExtTraj.front().z(); - double x2 = trkExtTraj.back().x(); - double y2 = trkExtTraj.back().y(); - double z2 = trkExtTraj.back().z(); - double t1 = 0; - double t2 = 0; - boost::shared_ptr track(new Track(x1,y1,z1,t1, x2,y2,z2,t2, - particleid, trackclass, trackclassindex, p1, - _geometrymanager, _topvolume, _mainframe, info, false)); - _components.push_back(track); - _tracks.push_back(track); - - for (unsigned int k = 0 ; k < trkExtTraj.size() ; k+=10) { - const mu2e::TrkExtTrajPoint & trkExtTrajPoint = trkExtTraj[k]; - track->addTrajectoryPoint(trkExtTrajPoint.x(), trkExtTrajPoint.y(), trkExtTrajPoint.z(), 0); - } - } - } } void DataInterface::findTrajectory(boost::shared_ptr const &contentSelector, diff --git a/Print/inc/TrackClusterMatchPrinter.hh b/Print/inc/TrackClusterMatchPrinter.hh deleted file mode 100644 index 48e3a2f1fd..0000000000 --- a/Print/inc/TrackClusterMatchPrinter.hh +++ /dev/null @@ -1,42 +0,0 @@ -// -// Utility class to print TrackClusterMatch -// -#ifndef Print_inc_TrackClusterMatchPrinter_hh -#define Print_inc_TrackClusterMatchPrinter_hh - -#include -#include - -#include "CLHEP/Vector/ThreeVector.h" - -#include "Offline/Print/inc/ProductPrinter.hh" -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" -#include "art/Framework/Principal/Handle.h" -#include "canvas/Persistency/Common/Ptr.h" - -namespace mu2e { - -class TrackClusterMatchPrinter : public ProductPrinter { - public: - TrackClusterMatchPrinter() {} - TrackClusterMatchPrinter(const Config& conf) : ProductPrinter(conf) {} - - // all the ways to request a printout - void Print(art::Event const& event, std::ostream& os = std::cout) override; - void Print(const art::Handle& handle, - std::ostream& os = std::cout); - void Print(const art::ValidHandle& handle, - std::ostream& os = std::cout); - void Print(const TrackClusterMatchCollection& coll, - std::ostream& os = std::cout); - void Print(const art::Ptr& ptr, int ind = -1, - std::ostream& os = std::cout); - void Print(const mu2e::TrackClusterMatch& obj, int ind = -1, - std::ostream& os = std::cout); - - void PrintHeader(const std::string& tag, std::ostream& os = std::cout); - void PrintListHeader(std::ostream& os = std::cout); -}; - -} // namespace mu2e -#endif diff --git a/Print/src/PrintModule_module.cc b/Print/src/PrintModule_module.cc index 9d23064e3e..6911d2cf59 100644 --- a/Print/src/PrintModule_module.cc +++ b/Print/src/PrintModule_module.cc @@ -48,7 +48,6 @@ #include "Offline/Print/inc/TimeClusterPrinter.hh" #include "Offline/Print/inc/HelixSeedPrinter.hh" #include "Offline/Print/inc/CosmicTrackSeedPrinter.hh" -#include "Offline/Print/inc/TrackClusterMatchPrinter.hh" #include "Offline/Print/inc/TrackSummaryPrinter.hh" #include "Offline/Print/inc/TriggerInfoPrinter.hh" #include "Offline/Print/inc/TriggerResultsPrinter.hh" @@ -129,8 +128,6 @@ class PrintModule : public art::EDAnalyzer { fhicl::Name("bkgClusterPrinter")}; fhicl::Table bkgQualPrinter{ fhicl::Name("bkgQualPrinter")}; - fhicl::Table trackClusterMatchPrinter{ - fhicl::Name("trackClusterMatchPrinter")}; fhicl::Table trkCaloIntersectPrinter{ fhicl::Name("trkCaloIntersectPrinter")}; fhicl::Table trackSummaryPrinter{ @@ -233,8 +230,6 @@ mu2e::PrintModule::PrintModule(const Parameters& conf) : art::EDAnalyzer(conf), _printers.push_back( make_unique(conf().bkgClusterPrinter())); _printers.push_back(make_unique(conf().bkgQualPrinter())); - _printers.push_back( - make_unique(conf().trackClusterMatchPrinter())); _printers.push_back( make_unique(conf().trackSummaryPrinter())); _printers.push_back(make_unique(conf().comboHitPrinter())); diff --git a/Print/src/TrackClusterMatchPrinter.cc b/Print/src/TrackClusterMatchPrinter.cc deleted file mode 100644 index d14f34a129..0000000000 --- a/Print/src/TrackClusterMatchPrinter.cc +++ /dev/null @@ -1,114 +0,0 @@ - -#include "Offline/Print/inc/TrackClusterMatchPrinter.hh" -#include "art/Framework/Principal/Provenance.h" -#include -#include - -void mu2e::TrackClusterMatchPrinter::Print(art::Event const& event, - std::ostream& os) { - if (verbose() < 1) return; - if (tags().empty()) { - // if a list of instances not specified, print all instances - std::vector > vah = - event.getMany(); - for (auto const& ah : vah) Print(ah); - } else { - // print requested instances - for (const auto& tag : tags()) { - auto ih = event.getValidHandle(tag); - Print(ih); - } - } -} - -void mu2e::TrackClusterMatchPrinter::Print( - const art::Handle& handle, std::ostream& os) { - if (verbose() < 1) return; - // the product tags with all four fields, with underscores - std::string tag = handle.provenance()->productDescription().branchName(); - tag.pop_back(); // remove trailing dot - PrintHeader(tag, os); - Print(*handle); -} - -void mu2e::TrackClusterMatchPrinter::Print( - const art::ValidHandle& handle, - std::ostream& os) { - if (verbose() < 1) return; - // the product tags with all four fields, with underscores - std::string tag = handle.provenance()->productDescription().branchName(); - tag.pop_back(); // remove trailing dot - PrintHeader(tag, os); - Print(*handle); -} - -void mu2e::TrackClusterMatchPrinter::Print( - const TrackClusterMatchCollection& coll, std::ostream& os) { - if (verbose() < 1) return; - os << "TrackClusterMatchCollection has " << coll.size() << " matches\n"; - if (verbose() == 1) PrintListHeader(); - int i = 0; - for (const auto& obj : coll) Print(obj, i++); -} - -void mu2e::TrackClusterMatchPrinter::Print( - const art::Ptr& obj, int ind, std::ostream& os) { - if (verbose() < 1) return; - Print(*obj, ind); -} - -void mu2e::TrackClusterMatchPrinter::Print(const mu2e::TrackClusterMatch& obj, - int ind, std::ostream& os) { - if (verbose() < 1) return; - - os << std::setiosflags(std::ios::fixed | std::ios::right); - if (ind >= 0) os << std::setw(4) << ind; - - if (verbose() == 1) { - os << " " << std::setw(8) << std::setprecision(1) << obj.du() << " " - << std::setw(8) << std::setprecision(1) << obj.dv() << " " - << std::setw(8) << std::setprecision(3) << obj.ep() << " " - << std::setw(8) << std::setprecision(3) << obj.chi2() << " " - << std::setw(8) << std::setprecision(3) << obj.chi2_time() << std::endl; - } else if (verbose() == 2) { - os << " icl: " << std::setw(4) << obj.icl() << " iex: " << std::setw(4) - << obj.iex() << " trk: " - << " " << std::setw(8) << std::setprecision(1) << obj.xtrk() << " " - << std::setw(8) << std::setprecision(1) << obj.ytrk() << " " - << std::setw(8) << std::setprecision(1) << obj.ztrk() << " " - << std::setw(8) << std::setprecision(1) << obj.ttrk() << "\n"; - os << " nvec: " - << " " << std::setw(8) << std::setprecision(1) << obj.nx() << " " - << std::setw(8) << std::setprecision(1) << obj.ny() << " " - << std::setw(8) << std::setprecision(1) << obj.nz() << " dx,y,z: " - << " " << std::setw(8) << std::setprecision(1) << obj.dx() << " " - << std::setw(8) << std::setprecision(1) << obj.dy() << " " - << std::setw(8) << std::setprecision(1) << obj.dz() << "\n"; - os << " du,v: " - << " " << std::setw(8) << std::setprecision(1) << obj.du() << " " - << std::setw(8) << std::setprecision(1) << obj.dv() << " dt: " - << " " << std::setw(8) << std::setprecision(1) << obj.dt() << "\n"; - os << " e/p: " << std::setw(8) << std::setprecision(3) << obj.ep() - << " chi2: " << std::setw(8) << std::setprecision(3) << obj.chi2() - << " chi2_time: " << std::setw(8) << std::setprecision(3) - << obj.chi2_time() << "\n"; - os << " int_depth: " << std::setw(8) << std::setprecision(1) - << obj.int_depth() << " ds: " << std::setw(8) << std::setprecision(1) - << obj.ds() << " dr: " << std::setw(8) << std::setprecision(1) - << obj.dr() << " sint: " << std::setw(8) << std::setprecision(4) - << obj.sint() << std::endl; - // printf("debug %f drdebug\n",obj.dr()); - // printf("debug %f sidebug\n",obj.sint()); - } -} - -void mu2e::TrackClusterMatchPrinter::PrintHeader(const std::string& tag, - std::ostream& os) { - if (verbose() < 1) return; - os << "\nProductPrint " << tag << "\n"; -} - -void mu2e::TrackClusterMatchPrinter::PrintListHeader(std::ostream& os) { - if (verbose() < 1) return; - os << "ind du dv e/p chi2 chi2_time\n"; -} diff --git a/RecoDataProducts/CMakeLists.txt b/RecoDataProducts/CMakeLists.txt index 433cf0de7b..c4df9d0ff0 100644 --- a/RecoDataProducts/CMakeLists.txt +++ b/RecoDataProducts/CMakeLists.txt @@ -26,7 +26,6 @@ cet_make_library( src/StrawHit.cc src/StrawHitFlag.cc src/StrawFlag.cc - src/TrackClusterMatch.cc src/TrackSummary.cc src/TrkCaloHitPID.cc src/TrkExtTraj.cc diff --git a/RecoDataProducts/inc/TrackClusterMatch.hh b/RecoDataProducts/inc/TrackClusterMatch.hh deleted file mode 100644 index 6f386fb2b2..0000000000 --- a/RecoDataProducts/inc/TrackClusterMatch.hh +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef TrackCaloMatching_TrackClusterMatch_hh -#define TrackCaloMatching_TrackClusterMatch_hh - -// Original author Gianantonio Pezzullo -#include - -#include "canvas/Persistency/Common/Ptr.h" -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -namespace mu2e { - - typedef art::Ptr TrkCaloIntersectPtr ; - typedef art::Ptr CaloClusterPtr ; - - class TrackClusterMatch { - public: - - struct Data_t { - int icl; // cluster index - int iex; // extrapolated track index - double xtrk; // track coordinates - double ytrk; - double ztrk; - double ttrk; // track time - double nx; // track direction in the "interaction point" - double ny; - double nz; - double dx; - double dy; - double dz; - double du; - double dv; - double dt; - double ep; - double chi2; - double chi2_time; - double int_depth; - double ds; // path length inside the disk - double dr; // R(cluster)-R(track) - double sint; // "interaction length" - }; - - protected: - int _icl; // cluster index - int _iex; // extrapolated track index - TrkCaloIntersectPtr _textrapol; - CaloClusterPtr _cluster; - double _xtrk; // track coordinates - double _ytrk; - double _ztrk; - double _ttrk; - double _nx; // track direction - double _ny; - double _nz; - double _dx; - double _dy; - double _dz; - double _du; - double _dv; - double _dt; - double _ep; - double _chi2; - double _chi2_time; - double _int_depth; - double _ds; - double _dr; - double _sint; - - public: - TrackClusterMatch(); - TrackClusterMatch(TrkCaloIntersectPtr& Textrapol, CaloClusterPtr & Cluster, Data_t* Data); - - int icl () const { return _icl; } - int iex () const { return _iex; } - const TrkCaloIntersect* textrapol () const { return _textrapol.get(); } - const CaloCluster* caloCluster() const { return _cluster.get(); } - double xtrk () const { return _xtrk; } - double ytrk () const { return _ytrk; } - double ztrk () const { return _ztrk; } - double ttrk () const { return _ttrk; } - double nx () const { return _nx; } - double ny () const { return _ny; } - double nz () const { return _nz; } - double dx () const { return _dx; } - double dy () const { return _dy; } - double dz () const { return _dz; } - double dt () const { return _dt; } - double du () const { return _du; } - double dv () const { return _dv; } - double ep () const { return _ep; } - double chi2 () const { return _chi2; } - double chi2_time () const { return _chi2_time; } - double int_depth () const { return _int_depth; } - double ds () const { return _ds; } - double dr () const { return _dr; } - double sint () const { return _sint; } - - void print(const char* Option) const ; - }; - - typedef std::vector TrackClusterMatchCollection; - -} - - -#endif/*TrackCaloMatching_TrackClusterMatch_hh*/ - - diff --git a/RecoDataProducts/src/TrackClusterMatch.cc b/RecoDataProducts/src/TrackClusterMatch.cc deleted file mode 100644 index a443ea5e0c..0000000000 --- a/RecoDataProducts/src/TrackClusterMatch.cc +++ /dev/null @@ -1,64 +0,0 @@ -// -// -// Original author Ivan Logashenko -// - -// C++ includes -#include - -// Framework includes. -#include "cetlib_except/exception.h" - -// Mu2e includes -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - -using namespace std; - -namespace mu2e { - - TrackClusterMatch::TrackClusterMatch() { - } - - TrackClusterMatch::TrackClusterMatch(TrkCaloIntersectPtr& Tex, CaloClusterPtr& Cluster, Data_t* Data) - { - _icl = Data->icl; - _iex = Data->iex; - - _textrapol = Tex; - _cluster = Cluster; - - _xtrk = Data->xtrk; - _ytrk = Data->ytrk; - _ztrk = Data->ztrk; - _ttrk = Data->ttrk; - - _nx = Data->nx; - _ny = Data->ny; - _nz = Data->nz; - - _dx = Data->dx; - _dy = Data->dy; - _dz = Data->dz; - - _du = Data->du; - _dv = Data->dv; - - _dt = Data->dt; - _ep = Data->ep; - - _chi2 = Data->chi2; - _chi2_time = Data->chi2_time; - - _int_depth = Data->int_depth; - _ds = Data->ds; - _dr = Data->dr; - _sint = Data->sint; - } - - -//----------------------------------------------------------------------------- - void TrackClusterMatch::print(const char* Option) const { - printf(" >>> WARNING: TrackClusterMatch::print not implemented yet\n"); - } - -} // namespace mu2e diff --git a/RecoDataProducts/src/classes.h b/RecoDataProducts/src/classes.h index 9bbaf3c409..d4f8ec91a1 100644 --- a/RecoDataProducts/src/classes.h +++ b/RecoDataProducts/src/classes.h @@ -63,7 +63,6 @@ // extrapolation and PID #include "Offline/RecoDataProducts/inc/PIDProduct.hh" -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" // CRV #include "Offline/RecoDataProducts/inc/CrvDigi.hh" diff --git a/RecoDataProducts/src/classes_def.xml b/RecoDataProducts/src/classes_def.xml index 59fc1d2c43..9bbc448f49 100644 --- a/RecoDataProducts/src/classes_def.xml +++ b/RecoDataProducts/src/classes_def.xml @@ -301,10 +301,6 @@ - - - - diff --git a/Validation/CMakeLists.txt b/Validation/CMakeLists.txt index b7674e093c..57e26401d6 100644 --- a/Validation/CMakeLists.txt +++ b/Validation/CMakeLists.txt @@ -32,7 +32,6 @@ cet_make_library( src/ValStrawHit.cc src/ValStrawHitFlag.cc src/ValTimeCluster.cc - src/ValTrackClusterMatch.cc src/ValTrackSummary.cc src/ValTriggerInfo.cc src/ValTriggerResults.cc diff --git a/Validation/inc/ValTrackClusterMatch.hh b/Validation/inc/ValTrackClusterMatch.hh deleted file mode 100644 index 280d020b0e..0000000000 --- a/Validation/inc/ValTrackClusterMatch.hh +++ /dev/null @@ -1,36 +0,0 @@ - -#ifndef ValTrackClusterMatch_HH_ -#define ValTrackClusterMatch_HH_ - -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" -#include "art/Framework/Principal/Event.h" -#include "art_root_io/TFileDirectory.h" -#include "TH1D.h" -#include - -namespace mu2e { - -class ValTrackClusterMatch { - public: - ValTrackClusterMatch(std::string name) : _name(name) {} - int declare(const art::TFileDirectory& tfs); - int fill(const TrackClusterMatchCollection& coll, art::Event const& event); - double mcTrkP(art::Event const& event); - std::string& name() { return _name; } - - private: - std::string _name; - - TH1D* _hVer; - TH1D* _hNMatch; - TH1D* _hdu; - TH1D* _hdv; - TH1D* _hdt; - TH1D* _hep; - TH1D* _hchi2; - TH1D* _hchi2t; - TH1D* _hchi2t2; -}; -} // namespace mu2e - -#endif diff --git a/Validation/src/ValTrackClusterMatch.cc b/Validation/src/ValTrackClusterMatch.cc deleted file mode 100644 index 145d8d0bb0..0000000000 --- a/Validation/src/ValTrackClusterMatch.cc +++ /dev/null @@ -1,42 +0,0 @@ - -#include "Offline/Validation/inc/ValTrackClusterMatch.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "art_root_io/TFileDirectory.h" -#include "TMath.h" - -int mu2e::ValTrackClusterMatch::declare(const art::TFileDirectory& tfs) { - _hVer = tfs.make("Ver", "Version Number", 101, -0.5, 100.0); - - _hNMatch = tfs.make("NMatch", "N Matches", 11, -0.5, 10.5); - _hdu = tfs.make("du", "du", 100, -1000., 1000.); - _hdv = tfs.make("dv", "dv", 100, -1000., 1000.); - _hdt = tfs.make("dt", "dt", 100, -15., 15.); - _hep = tfs.make("ep", "E/p", 100, 0., 1.6); - _hchi2 = tfs.make("Chi2", "Chi2", 100, 0.0, 10.0); - _hchi2t = tfs.make("Chi2t", "Chi2 time", 100, 0.0, 10.0); - _hchi2t2 = tfs.make("Chi2t2", "Chi2 time", 100, 0.0, 100.0); - - return 0; -} - -int mu2e::ValTrackClusterMatch::fill( - const mu2e::TrackClusterMatchCollection& coll, 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(1.0); - - _hNMatch->Fill(coll.size()); - for (auto match : coll) { - _hdu->Fill(match.du()); - _hdv->Fill(match.dv()); - _hdv->Fill(match.dv()); - _hdt->Fill(match.dt()); - _hep->Fill(match.ep()); - _hchi2->Fill(match.chi2()); - _hchi2t->Fill(match.chi2_time()); - _hchi2t2->Fill(match.chi2_time()); - } - - return 0; -} diff --git a/Validation/src/Validation_module.cc b/Validation/src/Validation_module.cc index 3e4fb5de1e..28ed9472be 100644 --- a/Validation/src/Validation_module.cc +++ b/Validation/src/Validation_module.cc @@ -37,7 +37,6 @@ #include "Offline/Validation/inc/ValStrawHit.hh" #include "Offline/Validation/inc/ValStrawHitFlag.hh" #include "Offline/Validation/inc/ValTimeCluster.hh" -#include "Offline/Validation/inc/ValTrackClusterMatch.hh" #include "Offline/Validation/inc/ValTrackSummary.hh" #include "Offline/Validation/inc/ValTriggerInfo.hh" #include "Offline/Validation/inc/ValTriggerResults.hh" @@ -99,7 +98,6 @@ class Validation : public art::EDAnalyzer { std::vector> _bgcl; std::vector> _bgql; std::vector> _trks; - std::vector> _mtch; std::vector> _hxsd; std::vector> _klsd; std::vector> _shfl; @@ -160,8 +158,6 @@ void mu2e::Validation::analyze(art::Event const& event) { analyzeProduct(_hxsd, event); analyzeProduct(_klsd, event); analyzeProduct(_trks, event); - analyzeProduct(_mtch, - event); analyzeProduct(_stmw, event); analyzeProduct(_trrs, event); analyzeProduct(_tris, event); From 84016d467b435e64b34df57f92775f6f52b01288 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 09:51:16 -0800 Subject: [PATCH 095/174] Small fix --- Print/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Print/CMakeLists.txt b/Print/CMakeLists.txt index 93c4fff74d..14afabb9bb 100644 --- a/Print/CMakeLists.txt +++ b/Print/CMakeLists.txt @@ -40,7 +40,6 @@ cet_make_library( src/StrawHitPrinter.cc src/SurfaceStepPrinter.cc src/TimeClusterPrinter.cc - src/TrackClusterMatchPrinter.cc src/TrackSummaryPrinter.cc src/TriggerInfoPrinter.cc src/TriggerResultsPrinter.cc From f376c67de8854bee0ad467f75890cbb523f636aa Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sat, 31 Jan 2026 14:12:03 -0600 Subject: [PATCH 096/174] move files out of ConditionsData --- ConditionsService/CMakeLists.txt | 17 +---------------- EventGenerator/CMakeLists.txt | 18 ++++++++++++++++++ .../data/Micheltbl.tbl | 0 .../data/Mu2eX/mu2eX_PRD84113010.tbl | 0 .../data/Mu2eX/mu2eX_S0_PRD102095007.tbl | 0 .../data/Mu2eX/mu2eX_S1_PRD102095007.tbl | 0 .../data/Mu2eX/mu2eX_V1_PRD102095007.tbl | 0 .../data/PlettNeutronSpectrum.txt | 0 .../data/SchroederNeutronSpectrum.txt | 0 .../data/StoppedMuons.txt | 0 .../data/acDipoleTransmissionFunction.txt | 0 .../data/czarnecki_Al.tbl | 0 .../data/czarnecki_Ti.tbl | 0 .../data/czarnecki_szafron_Al_2016.tbl | 0 .../data/czarnecki_szafron_Al_2016_tail.tbl | 0 ...finer_binning_2016_szafron-scaled-to-1H.tbl | 0 ...finer_binning_2016_szafron-scaled-to-6C.tbl | 0 .../data/heeck_finer_binning_2016_szafron.tbl | 0 .../data/neutSpectrumDocdb1619.txt | 0 .../data/neutronSpectrum.txt | 0 .../data/photonSpectrumMuonicAlCapture_v1.txt | 0 .../data/szafron_mu2e_7615.tbl | 0 .../data/timeDelayDist.txt | 0 .../data/watanabe.tbl | 0 EventGenerator/fcl/prolog.fcl | 4 ++-- EventGenerator/test/Pileup.fcl | 2 +- Mu2eUtilities/src/ShankerWatanabeSpectrum.cc | 2 +- TrkDiag/fcl/prolog.fcl | 2 +- TrkDiag/test/PlotNeutronEnergy.C | 2 +- 29 files changed, 25 insertions(+), 22 deletions(-) rename {ConditionsService => EventGenerator}/data/Micheltbl.tbl (100%) rename {ConditionsService => EventGenerator}/data/Mu2eX/mu2eX_PRD84113010.tbl (100%) rename {ConditionsService => EventGenerator}/data/Mu2eX/mu2eX_S0_PRD102095007.tbl (100%) rename {ConditionsService => EventGenerator}/data/Mu2eX/mu2eX_S1_PRD102095007.tbl (100%) rename {ConditionsService => EventGenerator}/data/Mu2eX/mu2eX_V1_PRD102095007.tbl (100%) rename {ConditionsService => EventGenerator}/data/PlettNeutronSpectrum.txt (100%) rename {ConditionsService => EventGenerator}/data/SchroederNeutronSpectrum.txt (100%) rename {ConditionsService => EventGenerator}/data/StoppedMuons.txt (100%) rename {ConditionsService => EventGenerator}/data/acDipoleTransmissionFunction.txt (100%) rename {ConditionsService => EventGenerator}/data/czarnecki_Al.tbl (100%) rename {ConditionsService => EventGenerator}/data/czarnecki_Ti.tbl (100%) rename {ConditionsService => EventGenerator}/data/czarnecki_szafron_Al_2016.tbl (100%) rename {ConditionsService => EventGenerator}/data/czarnecki_szafron_Al_2016_tail.tbl (100%) rename {ConditionsService => EventGenerator}/data/heeck_finer_binning_2016_szafron-scaled-to-1H.tbl (100%) rename {ConditionsService => EventGenerator}/data/heeck_finer_binning_2016_szafron-scaled-to-6C.tbl (100%) rename {ConditionsService => EventGenerator}/data/heeck_finer_binning_2016_szafron.tbl (100%) rename {ConditionsService => EventGenerator}/data/neutSpectrumDocdb1619.txt (100%) rename {ConditionsService => EventGenerator}/data/neutronSpectrum.txt (100%) rename {ConditionsService => EventGenerator}/data/photonSpectrumMuonicAlCapture_v1.txt (100%) rename {ConditionsService => EventGenerator}/data/szafron_mu2e_7615.tbl (100%) rename {ConditionsService => EventGenerator}/data/timeDelayDist.txt (100%) rename {ConditionsService => EventGenerator}/data/watanabe.tbl (100%) diff --git a/ConditionsService/CMakeLists.txt b/ConditionsService/CMakeLists.txt index 274b485939..37e05d7522 100644 --- a/ConditionsService/CMakeLists.txt +++ b/ConditionsService/CMakeLists.txt @@ -17,29 +17,14 @@ cet_build_plugin(ConditionsService art::service ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/acDipoleTransmissionFunction.txt ${CURRENT_BINARY_DIR} data/acDipoleTransmissionFunction.txt ) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/conditions_01.txt ${CURRENT_BINARY_DIR} data/conditions_01.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_Al.tbl ${CURRENT_BINARY_DIR} data/czarnecki_Al.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_szafron_Al_2016_tail.tbl ${CURRENT_BINARY_DIR} data/czarnecki_szafron_Al_2016_tail.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_szafron_Al_2016.tbl ${CURRENT_BINARY_DIR} data/czarnecki_szafron_Al_2016.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_Ti.tbl ${CURRENT_BINARY_DIR} data/czarnecki_Ti.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/heeck_finer_binning_2016_szafron.tbl ${CURRENT_BINARY_DIR} data/heeck_finer_binning_2016_szafron.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/Micheltbl.tbl ${CURRENT_BINARY_DIR} data/Micheltbl.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/neutronSpectrum.txt ${CURRENT_BINARY_DIR} data/neutronSpectrum.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/neutSpectrumDocdb1619.txt ${CURRENT_BINARY_DIR} data/neutSpectrumDocdb1619.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/photonSpectrumMuonicAlCapture_v1.txt ${CURRENT_BINARY_DIR} data/photonSpectrumMuonicAlCapture_v1.txt ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_dt_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_dt_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_ep_vs_path_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_ep_vs_path_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_xs_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_xs_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_muo_dt_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_muo_dt_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_muo_ep_vs_path_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_muo_ep_vs_path_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_muo_xs_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_muo_xs_v4_2_4.tab ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/PlettNeutronSpectrum.txt ${CURRENT_BINARY_DIR} data/PlettNeutronSpectrum.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/SchroederNeutronSpectrum.txt ${CURRENT_BINARY_DIR} data/SchroederNeutronSpectrum.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/StoppedMuons.txt ${CURRENT_BINARY_DIR} data/StoppedMuons.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/szafron_mu2e_7615.tbl ${CURRENT_BINARY_DIR} data/szafron_mu2e_7615.tbl ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/timeDelayDist.txt ${CURRENT_BINARY_DIR} data/timeDelayDist.txt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/watanabe.tbl ${CURRENT_BINARY_DIR} data/watanabe.tbl) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/v5_7_9/pid_ele_dedx.rtbl ${CURRENT_BINARY_DIR} data/v5_7_9/pid_ele_dedx.rtbl ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/v5_7_9/pid_ele_dt.tbl ${CURRENT_BINARY_DIR} data/v5_7_9/pid_ele_dt.tbl ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/v5_7_9/pid_ele_ep_vs_path.tbl ${CURRENT_BINARY_DIR} data/v5_7_9/pid_ele_ep_vs_path.tbl ) diff --git a/EventGenerator/CMakeLists.txt b/EventGenerator/CMakeLists.txt index 7d1dfcd345..7a7de35da0 100644 --- a/EventGenerator/CMakeLists.txt +++ b/EventGenerator/CMakeLists.txt @@ -652,6 +652,24 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/defaultConfigs/particleGun.txt configure_file(${CMAKE_CURRENT_SOURCE_DIR}/defaultConfigs/primaryProtonGun.txt ${CURRENT_BINARY_DIR} defaultConfigs/primaryProtonGun.txt ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/defaultConfigs/surfaceCheck.txt ${CURRENT_BINARY_DIR} defaultConfigs/surfaceCheck.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/acDipoleTransmissionFunction.txt ${CURRENT_BINARY_DIR} data/acDipoleTransmissionFunction.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_Al.tbl ${CURRENT_BINARY_DIR} data/czarnecki_Al.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_szafron_Al_2016_tail.tbl ${CURRENT_BINARY_DIR} data/czarnecki_szafron_Al_2016_tail.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_szafron_Al_2016.tbl ${CURRENT_BINARY_DIR} data/czarnecki_szafron_Al_2016.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/czarnecki_Ti.tbl ${CURRENT_BINARY_DIR} data/czarnecki_Ti.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/heeck_finer_binning_2016_szafron.tbl ${CURRENT_BINARY_DIR} data/heeck_finer_binning_2016_szafron.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/Micheltbl.tbl ${CURRENT_BINARY_DIR} data/Micheltbl.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/neutronSpectrum.txt ${CURRENT_BINARY_DIR} data/neutronSpectrum.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/neutSpectrumDocdb1619.txt ${CURRENT_BINARY_DIR} data/neutSpectrumDocdb1619.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/photonSpectrumMuonicAlCapture_v1.txt ${CURRENT_BINARY_DIR} data/photonSpectrumMuonicAlCapture_v1.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/PlettNeutronSpectrum.txt ${CURRENT_BINARY_DIR} data/PlettNeutronSpectrum.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/SchroederNeutronSpectrum.txt ${CURRENT_BINARY_DIR} data/SchroederNeutronSpectrum.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/StoppedMuons.txt ${CURRENT_BINARY_DIR} data/StoppedMuons.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/szafron_mu2e_7615.tbl ${CURRENT_BINARY_DIR} data/szafron_mu2e_7615.tbl ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/timeDelayDist.txt ${CURRENT_BINARY_DIR} data/timeDelayDist.txt ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/watanabe.tbl ${CURRENT_BINARY_DIR} data/watanabe.tbl ) + +install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Offline/EventGenerator) install(DIRECTORY defaultConfigs DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Offline/EventGenerator) install_source(SUBDIRS src) install_headers(USE_PROJECT_NAME SUBDIRS inc) diff --git a/ConditionsService/data/Micheltbl.tbl b/EventGenerator/data/Micheltbl.tbl similarity index 100% rename from ConditionsService/data/Micheltbl.tbl rename to EventGenerator/data/Micheltbl.tbl diff --git a/ConditionsService/data/Mu2eX/mu2eX_PRD84113010.tbl b/EventGenerator/data/Mu2eX/mu2eX_PRD84113010.tbl similarity index 100% rename from ConditionsService/data/Mu2eX/mu2eX_PRD84113010.tbl rename to EventGenerator/data/Mu2eX/mu2eX_PRD84113010.tbl diff --git a/ConditionsService/data/Mu2eX/mu2eX_S0_PRD102095007.tbl b/EventGenerator/data/Mu2eX/mu2eX_S0_PRD102095007.tbl similarity index 100% rename from ConditionsService/data/Mu2eX/mu2eX_S0_PRD102095007.tbl rename to EventGenerator/data/Mu2eX/mu2eX_S0_PRD102095007.tbl diff --git a/ConditionsService/data/Mu2eX/mu2eX_S1_PRD102095007.tbl b/EventGenerator/data/Mu2eX/mu2eX_S1_PRD102095007.tbl similarity index 100% rename from ConditionsService/data/Mu2eX/mu2eX_S1_PRD102095007.tbl rename to EventGenerator/data/Mu2eX/mu2eX_S1_PRD102095007.tbl diff --git a/ConditionsService/data/Mu2eX/mu2eX_V1_PRD102095007.tbl b/EventGenerator/data/Mu2eX/mu2eX_V1_PRD102095007.tbl similarity index 100% rename from ConditionsService/data/Mu2eX/mu2eX_V1_PRD102095007.tbl rename to EventGenerator/data/Mu2eX/mu2eX_V1_PRD102095007.tbl diff --git a/ConditionsService/data/PlettNeutronSpectrum.txt b/EventGenerator/data/PlettNeutronSpectrum.txt similarity index 100% rename from ConditionsService/data/PlettNeutronSpectrum.txt rename to EventGenerator/data/PlettNeutronSpectrum.txt diff --git a/ConditionsService/data/SchroederNeutronSpectrum.txt b/EventGenerator/data/SchroederNeutronSpectrum.txt similarity index 100% rename from ConditionsService/data/SchroederNeutronSpectrum.txt rename to EventGenerator/data/SchroederNeutronSpectrum.txt diff --git a/ConditionsService/data/StoppedMuons.txt b/EventGenerator/data/StoppedMuons.txt similarity index 100% rename from ConditionsService/data/StoppedMuons.txt rename to EventGenerator/data/StoppedMuons.txt diff --git a/ConditionsService/data/acDipoleTransmissionFunction.txt b/EventGenerator/data/acDipoleTransmissionFunction.txt similarity index 100% rename from ConditionsService/data/acDipoleTransmissionFunction.txt rename to EventGenerator/data/acDipoleTransmissionFunction.txt diff --git a/ConditionsService/data/czarnecki_Al.tbl b/EventGenerator/data/czarnecki_Al.tbl similarity index 100% rename from ConditionsService/data/czarnecki_Al.tbl rename to EventGenerator/data/czarnecki_Al.tbl diff --git a/ConditionsService/data/czarnecki_Ti.tbl b/EventGenerator/data/czarnecki_Ti.tbl similarity index 100% rename from ConditionsService/data/czarnecki_Ti.tbl rename to EventGenerator/data/czarnecki_Ti.tbl diff --git a/ConditionsService/data/czarnecki_szafron_Al_2016.tbl b/EventGenerator/data/czarnecki_szafron_Al_2016.tbl similarity index 100% rename from ConditionsService/data/czarnecki_szafron_Al_2016.tbl rename to EventGenerator/data/czarnecki_szafron_Al_2016.tbl diff --git a/ConditionsService/data/czarnecki_szafron_Al_2016_tail.tbl b/EventGenerator/data/czarnecki_szafron_Al_2016_tail.tbl similarity index 100% rename from ConditionsService/data/czarnecki_szafron_Al_2016_tail.tbl rename to EventGenerator/data/czarnecki_szafron_Al_2016_tail.tbl diff --git a/ConditionsService/data/heeck_finer_binning_2016_szafron-scaled-to-1H.tbl b/EventGenerator/data/heeck_finer_binning_2016_szafron-scaled-to-1H.tbl similarity index 100% rename from ConditionsService/data/heeck_finer_binning_2016_szafron-scaled-to-1H.tbl rename to EventGenerator/data/heeck_finer_binning_2016_szafron-scaled-to-1H.tbl diff --git a/ConditionsService/data/heeck_finer_binning_2016_szafron-scaled-to-6C.tbl b/EventGenerator/data/heeck_finer_binning_2016_szafron-scaled-to-6C.tbl similarity index 100% rename from ConditionsService/data/heeck_finer_binning_2016_szafron-scaled-to-6C.tbl rename to EventGenerator/data/heeck_finer_binning_2016_szafron-scaled-to-6C.tbl diff --git a/ConditionsService/data/heeck_finer_binning_2016_szafron.tbl b/EventGenerator/data/heeck_finer_binning_2016_szafron.tbl similarity index 100% rename from ConditionsService/data/heeck_finer_binning_2016_szafron.tbl rename to EventGenerator/data/heeck_finer_binning_2016_szafron.tbl diff --git a/ConditionsService/data/neutSpectrumDocdb1619.txt b/EventGenerator/data/neutSpectrumDocdb1619.txt similarity index 100% rename from ConditionsService/data/neutSpectrumDocdb1619.txt rename to EventGenerator/data/neutSpectrumDocdb1619.txt diff --git a/ConditionsService/data/neutronSpectrum.txt b/EventGenerator/data/neutronSpectrum.txt similarity index 100% rename from ConditionsService/data/neutronSpectrum.txt rename to EventGenerator/data/neutronSpectrum.txt diff --git a/ConditionsService/data/photonSpectrumMuonicAlCapture_v1.txt b/EventGenerator/data/photonSpectrumMuonicAlCapture_v1.txt similarity index 100% rename from ConditionsService/data/photonSpectrumMuonicAlCapture_v1.txt rename to EventGenerator/data/photonSpectrumMuonicAlCapture_v1.txt diff --git a/ConditionsService/data/szafron_mu2e_7615.tbl b/EventGenerator/data/szafron_mu2e_7615.tbl similarity index 100% rename from ConditionsService/data/szafron_mu2e_7615.tbl rename to EventGenerator/data/szafron_mu2e_7615.tbl diff --git a/ConditionsService/data/timeDelayDist.txt b/EventGenerator/data/timeDelayDist.txt similarity index 100% rename from ConditionsService/data/timeDelayDist.txt rename to EventGenerator/data/timeDelayDist.txt diff --git a/ConditionsService/data/watanabe.tbl b/EventGenerator/data/watanabe.tbl similarity index 100% rename from ConditionsService/data/watanabe.tbl rename to EventGenerator/data/watanabe.tbl diff --git a/EventGenerator/fcl/prolog.fcl b/EventGenerator/fcl/prolog.fcl index 9838bfc032..6a2c646825 100644 --- a/EventGenerator/fcl/prolog.fcl +++ b/EventGenerator/fcl/prolog.fcl @@ -293,7 +293,7 @@ EventGenerator : { @table::EventGenerator pdgId : 11 spectrumVariable : "totalEnergy" spectrumShape : "tabulated" - spectrumFileName : "Offline/ConditionsService/data/czarnecki_Al.tbl" + spectrumFileName : "Offline/EventGenerator/data/czarnecki_Al.tbl" } } #------------------------------------------------------------------------------ @@ -305,7 +305,7 @@ EventGenerator : { @table::EventGenerator pdgId : 11 spectrumVariable : "totalEnergy" spectrumShape : "tabulated" - spectrumFileName : "Offline/ConditionsService/data/czarnecki_szafron_Al_2016.tbl" + spectrumFileName : "Offline/EventGenerator/data/czarnecki_szafron_Al_2016.tbl" } } #------------------------------------------------------------------------------ diff --git a/EventGenerator/test/Pileup.fcl b/EventGenerator/test/Pileup.fcl index 7657a0d0c5..b7c4541919 100644 --- a/EventGenerator/test/Pileup.fcl +++ b/EventGenerator/test/Pileup.fcl @@ -39,7 +39,7 @@ physics : { }, { spectrum: { - spectrumFileName: "Offline/ConditionsService/data/neutronSpectrum.txt" + spectrumFileName: "Offline/EventGenerator/data/neutronSpectrum.txt" spectrumShape: "tabulated" } spectrumVariable: "kineticEnergy" diff --git a/Mu2eUtilities/src/ShankerWatanabeSpectrum.cc b/Mu2eUtilities/src/ShankerWatanabeSpectrum.cc index 3ad2b5d0e7..612acd508b 100644 --- a/Mu2eUtilities/src/ShankerWatanabeSpectrum.cc +++ b/Mu2eUtilities/src/ShankerWatanabeSpectrum.cc @@ -29,7 +29,7 @@ using namespace std; namespace mu2e { ShankerWatanabeSpectrum::ShankerWatanabeSpectrum() : - _table ( loadTable<2,false>( ConfigFileLookupPolicy()("Offline/ConditionsService/data/watanabe.tbl" ) ) ) + _table ( loadTable<2,false>( ConfigFileLookupPolicy()("Offline/EventGenerator/data/watanabe.tbl" ) ) ) { _wanaEndPoint = _table(0,0); _wanaEndPointVal = _table(0,1); diff --git a/TrkDiag/fcl/prolog.fcl b/TrkDiag/fcl/prolog.fcl index 3d088bdbdc..99c7de28d3 100644 --- a/TrkDiag/fcl/prolog.fcl +++ b/TrkDiag/fcl/prolog.fcl @@ -112,7 +112,7 @@ dioLLWeight : { genParticleTag : "compressDigiMCs" genParticlePdgId : 11 genParticleGenId : dioTail - spectrumFileName : "Offline/ConditionsService/data/czarnecki_szafron_Al_2016.tbl" + spectrumFileName : "Offline/EventGenerator/data/czarnecki_szafron_Al_2016.tbl" BinCenter : false } genCountLogger: { module_type: GenEventCountReader } diff --git a/TrkDiag/test/PlotNeutronEnergy.C b/TrkDiag/test/PlotNeutronEnergy.C index 1e49349a48..60c1533c70 100644 --- a/TrkDiag/test/PlotNeutronEnergy.C +++ b/TrkDiag/test/PlotNeutronEnergy.C @@ -38,7 +38,7 @@ void neutrons(TTree* sh) { sh->Project("npscat","sqrt(mcpopos.x^2+mcpopos.y^2):mcpopos.z",pneutscat); sh->Project("npother","sqrt(mcpopos.x^2+mcpopos.y^2):mcpopos.z",pneutother); - TGraph* ngen = new TGraph("Offline/ConditionsService/data/neutronSpectrum.txt"); + TGraph* ngen = new TGraph("Offline/EventGenerator/data/neutronSpectrum.txt"); ngen->SetMarkerStyle(20); ngen->SetMarkerColor(kCyan); ngen->SetMarkerSize(1); From 9918d3c402c9fc46ce4abf98ee3c0f6c4364f1af Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Sat, 31 Jan 2026 15:49:58 -0600 Subject: [PATCH 097/174] fix directory reference --- Mu2eUtilities/src/CzarneckiSpectrum.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mu2eUtilities/src/CzarneckiSpectrum.cc b/Mu2eUtilities/src/CzarneckiSpectrum.cc index 3917d33e7d..99aa59ad09 100644 --- a/Mu2eUtilities/src/CzarneckiSpectrum.cc +++ b/Mu2eUtilities/src/CzarneckiSpectrum.cc @@ -23,7 +23,7 @@ namespace mu2e { CzarneckiSpectrum::CzarneckiSpectrum() : - _table ( loadTable<2>( ConfigFileLookupPolicy()( "Offline/ConditionsService/data/czarnecki_"+ + _table ( loadTable<2>( ConfigFileLookupPolicy()( "Offline/EventGenerator/data/czarnecki_"+ GlobalConstantsHandle()->getStoppingTargetMaterial()+".tbl" ) ) ) { _halfBinWidth = (_table.getRow(1).first - _table.getRow(0).first)/2.; From a15966d247050abb89fbde6268e759de4c0a2b92 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 16:54:36 -0800 Subject: [PATCH 098/174] More fixes. Really compiles now --- BTrkLegacy/CMakeLists.txt | 1 + BTrkLegacy/inc/TrkErrCode.hh | 36 +- BTrkLegacy/inc/TrkParticle.hh | 1 - BTrkLegacy/src/TrkErrCode.cc | 123 +++++++ BTrkLegacy/src/TrkParticle.cc | 9 - CalPatRec/CMakeLists.txt | 1 + RecoDataProducts/CMakeLists.txt | 2 - RecoDataProducts/inc/TrkExtTrajPoint.hh | 89 ----- RecoDataProducts/src/TrkExtTraj.cc | 348 ------------------ RecoDataProducts/src/TrkExtTrajPoint.cc | 114 ------ RecoDataProducts/src/classes.h | 3 - RecoDataProducts/src/classes_def.xml | 11 - TEveEventDisplay/CMakeLists.txt | 1 + TEveEventDisplay/fcl/prolog.fcl | 5 - TEveEventDisplay/src/Collection_Filler.cc | 6 - TEveEventDisplay/src/TEveMu2eCustomHelix.cc | 23 ++ TEveEventDisplay/src/TEveMu2eDataInterface.cc | 1 - .../TEveMu2eCustomHelix.h | 6 - .../TEveMu2eDataInterface.h | 2 - .../src/dict_classes/Collection_Filler.h | 8 +- .../src/dict_classes/Data_Collections.h | 3 - TrackerMC/src/MakeStrawGasSteps_module.cc | 4 +- 22 files changed, 171 insertions(+), 626 deletions(-) create mode 100644 BTrkLegacy/src/TrkErrCode.cc delete mode 100644 RecoDataProducts/inc/TrkExtTrajPoint.hh delete mode 100644 RecoDataProducts/src/TrkExtTraj.cc delete mode 100644 RecoDataProducts/src/TrkExtTrajPoint.cc create mode 100644 TEveEventDisplay/src/TEveMu2eCustomHelix.cc diff --git a/BTrkLegacy/CMakeLists.txt b/BTrkLegacy/CMakeLists.txt index 416e71bc4a..4094b18a60 100644 --- a/BTrkLegacy/CMakeLists.txt +++ b/BTrkLegacy/CMakeLists.txt @@ -1,6 +1,7 @@ cet_make_library( SOURCE src/TrkParticle.cc + src/TrkErrCode.cc LIBRARIES PUBLIC Offline::DataProducts Offline::GeneralUtilities diff --git a/BTrkLegacy/inc/TrkErrCode.hh b/BTrkLegacy/inc/TrkErrCode.hh index 5dbda4bdbf..48ed822520 100644 --- a/BTrkLegacy/inc/TrkErrCode.hh +++ b/BTrkLegacy/inc/TrkErrCode.hh @@ -3,25 +3,25 @@ // $Id: TrkErrCode.hh,v 1.13 2004/08/06 06:31:40 bartoldu Exp $ // // Description: -// Encapsulate error/success status of tracking operations. -// Either failure() or success() will be non-zero, but not both. -// Failure => no valid answer available. -// Success => a valid answer has been -// provided, even if it wasn't exactly what you asked for. The -// value of failure() or success() distinguishes different -// failure/success modes. A string describing the success/failure -// mode can also be provided, and printed by the user. -// -// Note that if this string is provided by the called function, -// it _must_ be a pointer to a statically stored string (which includes -// string literals). E.g. +// Encapsulate error/success status of tracking operations. +// Either failure() or success() will be non-zero, but not both. +// Failure => no valid answer available. +// Success => a valid answer has been +// provided, even if it wasn't exactly what you asked for. The +// value of failure() or success() distinguishes different +// failure/success modes. A string describing the success/failure +// mode can also be provided, and printed by the user. +// +// Note that if this string is provided by the called function, +// it _must_ be a pointer to a statically stored string (which includes +// string literals). E.g. // TrkErrCode err; // err.setFailure(10,"Forgot to tie my shoelaces."); // return err; // is valid. // -// Several codes have predefined meanings and strings; strings -// supplied for them will be ignored. Strings for codes >= 10 +// Several codes have predefined meanings and strings; strings +// supplied for them will be ignored. Strings for codes >= 10 // can be supplied by users. Predefined: // failure = 1 -- "Arithmetic error." // = 2 -- "Failed to converge." @@ -57,12 +57,12 @@ public: TrkErrCode(const TrkErrCode&); TrkErrCode& operator=(const TrkErrCode&); - // access + // access int failure() const {return _failure;} int success() const {return _success;} - const std::string& message() const + const std::string& message() const { - return (_string != 0) ? *_string : _nullStr; + return (_string != 0) ? *_string : _nullStr; } void print(std::ostream& ostr) const; @@ -71,7 +71,7 @@ public: if (_string != 0) delete _string; if (str != 0) { _string= new std::string(str); - } + } else { _string = 0; } diff --git a/BTrkLegacy/inc/TrkParticle.hh b/BTrkLegacy/inc/TrkParticle.hh index f164441cbd..67ed8a8305 100644 --- a/BTrkLegacy/inc/TrkParticle.hh +++ b/BTrkLegacy/inc/TrkParticle.hh @@ -33,7 +33,6 @@ class TrkParticle { type particleType() const { return _type; } bool operator == (TrkParticle const& other) const { return _type == other._type; } bool operator != (TrkParticle const& other) const { return ! this->operator==(other); } - TrkParticle & operator =(TrkParticle const& other); // return basic information double mass() const; double charge() const; diff --git a/BTrkLegacy/src/TrkErrCode.cc b/BTrkLegacy/src/TrkErrCode.cc new file mode 100644 index 0000000000..d6b033a25f --- /dev/null +++ b/BTrkLegacy/src/TrkErrCode.cc @@ -0,0 +1,123 @@ +//-------------------------------------------------------------------------- +//// File and Version Information: +//// $Id: TrkErrCode.cc,v 1.13 2004/08/06 06:31:40 bartoldu Exp $ +//// +//// Description: +//// +//// +//// Environment: +//// Software developed for the BaBar Detector at the SLAC B-Factory. +//// +//// Author(s): Steve Schaffner +//// +//// Revision History: +//// 20000420 M. Kelsey -- Remove terminating endl in print(). +////------------------------------------------------------------------------ +#include +#include +#include "Offline/BTrkLegacy/inc/TrkErrCode.hh" + +using std::ostream; + +std::string TrkErrCode::_nullStr(""); + +TrkErrCode::TrkErrCode(TrkSuccess succ, int code, const char* str) + : _string(0) +{ + setMessage(str); + if (succ) { + _failure = 0; _success = code; + } else { + _success = 0; _failure = code; + } +} + + +TrkErrCode::TrkErrCode(const TrkErrCode& theCode) + : _failure(theCode._failure) + , _success(theCode._success) +{ + if (theCode._string != 0) { + _string = new std::string(*theCode._string); + } + else { + _string = 0; + } +} + + +TrkErrCode::~TrkErrCode() { + if (_string != 0) { + delete _string; + _string = 0; + } +} + + TrkErrCode& +TrkErrCode::operator =(const TrkErrCode& theCode) +{ + _failure = theCode._failure; + _success = theCode._success; + + if (theCode._string != 0) { + if (_string != 0) { + *_string = *theCode._string; + } + else { + _string = new std::string(*theCode._string); + } + } + else { + if (_string != 0) delete _string; + _string = 0; + } + + return *this; +} + + +void +TrkErrCode::print(ostream& ostr) const +{ + const char* pstatus = 0; + int code; + if (success()) { + pstatus = "succeeded"; + code = success(); + } else { + pstatus = "failed"; + code = failure(); + } + std::string pstring; + static const std::string failed[4] = { "Arithmetic error.", + "Failed to converge.", + "Failed because parallel.", + "Undefined error." }; + + static const std::string succeeded[4] = { "Normal completion.", + "Didn't converge.", + "Parallel.", + "Undefined success state."}; + + if (code > 0 && code < 10) { + if (failure()) { + pstring = failed[std::min(code-1,3) ]; + } else if (success()) { + pstring = succeeded[std::min(code-1,3) ]; + } + } else if (_string == 0 ) { + pstring = "Unknown error."; + } else { + pstring = *_string; + } + + ostr << "TrkErrCode: " << pstatus << ", code " << code + << ". Status: " << pstring.c_str(); +} + + ostream& +operator<<(ostream& os, const TrkErrCode& trkerr) +{ + trkerr.print(os); + return os; +} diff --git a/BTrkLegacy/src/TrkParticle.cc b/BTrkLegacy/src/TrkParticle.cc index 148c6b8859..546a3394aa 100644 --- a/BTrkLegacy/src/TrkParticle.cc +++ b/BTrkLegacy/src/TrkParticle.cc @@ -16,15 +16,6 @@ TrkParticle::TrkParticle(TrkParticle const& other) : _type(other._type) TrkParticle::~TrkParticle() {} -TrkParticle& -TrkParticle::operator =(TrkParticle const& other) { - if(this != &other){ - _type = other._type; - } - return *this; -} - - using mu2e::PDGCodeDetail; using mu2e::ParticleDataList; using mu2e::GlobalConstantsHandle; diff --git a/CalPatRec/CMakeLists.txt b/CalPatRec/CMakeLists.txt index f178a86cd1..3237322e65 100644 --- a/CalPatRec/CMakeLists.txt +++ b/CalPatRec/CMakeLists.txt @@ -23,6 +23,7 @@ cet_make_library( Offline::RecoDataProducts Offline::TrackerGeom Offline::TrkReco + Offline::BTrkLegacy ROOT::Physics ) diff --git a/RecoDataProducts/CMakeLists.txt b/RecoDataProducts/CMakeLists.txt index c4df9d0ff0..6f25504615 100644 --- a/RecoDataProducts/CMakeLists.txt +++ b/RecoDataProducts/CMakeLists.txt @@ -28,8 +28,6 @@ cet_make_library( src/StrawFlag.cc src/TrackSummary.cc src/TrkCaloHitPID.cc - src/TrkExtTraj.cc - src/TrkExtTrajPoint.cc src/TrkFitDirection.cc src/TrkFitFlag.cc src/TrkQual.cc diff --git a/RecoDataProducts/inc/TrkExtTrajPoint.hh b/RecoDataProducts/inc/TrkExtTrajPoint.hh deleted file mode 100644 index c4ee38a106..0000000000 --- a/RecoDataProducts/inc/TrkExtTrajPoint.hh +++ /dev/null @@ -1,89 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// -#ifndef TrkExtTrajPoint_HH -#define TrkExtTrajPoint_HH - -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "CLHEP/Matrix/Vector.h" -#include "Offline/GeneralUtilities/inc/safeSqrt.hh" - -namespace mu2e { - - - - class TrkExtTrajPoint { - - public: - - TrkExtTrajPoint() ; - TrkExtTrajPoint(int id, CLHEP::Hep3Vector & x, CLHEP::Hep3Vector & p, CLHEP::HepMatrix & cov, int volid, double fl, double ft) ; - TrkExtTrajPoint(int id, CLHEP::HepVector & r, int volid, double fl, double ft); - ~TrkExtTrajPoint() ; - TrkExtTrajPoint (const TrkExtTrajPoint & dt); - TrkExtTrajPoint & operator = (const TrkExtTrajPoint & dt); - - CLHEP::Hep3Vector const & position () const { return _x; } - CLHEP::Hep3Vector const & momentum () const { return _p; } - CLHEP::HepMatrix const & covariance () const { return _cov; } - CLHEP::Hep3Vector positionError () ; - CLHEP::Hep3Vector momentumError () ; - double x() const { return _x.x(); } - double y() const { return _x.y(); } - double z() const { return _x.z(); } - double rho() const { return _x.rho(); } - double px() const { return _p.x(); } - double py() const { return _p.y(); } - double pz() const { return _p.z(); } - double p() const { return _p.mag(); } - double ex() const { return safeSqrt(_cov[0][0]); } - double ey() const { return safeSqrt(_cov[1][1]); } - double ez() const { return safeSqrt(_cov[2][2]); } - double epx() const { return safeSqrt(_cov[3][3]); } - double epy() const { return safeSqrt(_cov[4][4]); } - double epz() const { return safeSqrt(_cov[5][5]); } - double covxx() const { return _cov[0][0]; } - double covxy() const { return _cov[0][1]; } - double covxz() const { return _cov[0][2]; } - double covyy() const { return _cov[1][1]; } - double covyz() const { return _cov[1][2]; } - double covzz() const { return _cov[2][2]; } - double covpxpx() const { return _cov[3][3]; } - double covpxpy() const { return _cov[3][4]; } - double covpxpz() const { return _cov[3][5]; } - double covpypy() const { return _cov[4][4]; } - double covpypz() const { return _cov[4][5]; } - double covpzpz() const { return _cov[5][5]; } - int volumeId() const { return _volid; } - int trajPointId() const {return _trajPtId;} - double flightLength() const {return _fl;} - double flightTime() const { return _ft; } - - CLHEP::HepVector vector() ; - void setCovariance(CLHEP::HepMatrix & c) ; - void setTrajPointId(int i) { _trajPtId = i; } - void scaleMomentum(double sf) { _p *= sf; } - - private: - void calculateHelixParameter(); - - private: - CLHEP::Hep3Vector _x; - CLHEP::Hep3Vector _p; - CLHEP::HepMatrix _cov; - int _volid; - int _trajPtId; - double _fl; // flight length in mm - double _ft; // flight time in ns - - }; - - - -} // end namespace mu2e - - -#endif diff --git a/RecoDataProducts/src/TrkExtTraj.cc b/RecoDataProducts/src/TrkExtTraj.cc deleted file mode 100644 index dba033f7f1..0000000000 --- a/RecoDataProducts/src/TrkExtTraj.cc +++ /dev/null @@ -1,348 +0,0 @@ -// -// -// Original author MyeongJae Lee -// - -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTrajPoint.hh" -#include "CLHEP/Vector/ThreeVector.h" -#include "cetlib_except/exception.h" -#include -#include - -using namespace CLHEP; -using namespace std; - -namespace mu2e { - - // Constructors - TrkExtTraj::TrkExtTraj() { - _pt.clear(); - _pahitidx.clear(); - _sthitidx.clear(); - _ptidx_pa.clear(); - _ptidx_st.clear(); - _deltap_pa.clear(); - _deltap_st.clear(); - _ret = -1; - _hepid = 0; - } - - TrkExtTraj::TrkExtTraj(const TrkExtTrajPoint & trajPoint) { - _pt.clear(); - _pt.push_back(trajPoint); - _pahitidx.clear(); - _sthitidx.clear(); - _ptidx_pa.clear(); - _ptidx_st.clear(); - _deltap_pa.clear(); - _deltap_st.clear(); - _ret = -1; - _hepid = 0; - } - - TrkExtTraj::TrkExtTraj(const TrkExtTraj & dt) { - _pt = dt._pt; - _ret = dt._ret; - _hepid = dt._hepid; - _pahitidx = dt._pahitidx; - _sthitidx = dt._sthitidx; - _ptidx_pa = dt._ptidx_pa; - _ptidx_st = dt._ptidx_st;; - _deltap_pa = dt._deltap_pa; - _deltap_st = dt._deltap_st; - } - - // operator overloading - TrkExtTraj & TrkExtTraj::operator= (const TrkExtTraj & dt) { - _pt = dt._pt; - _ret = dt._ret; - _hepid = dt._hepid; - _pahitidx = dt._pahitidx; - _sthitidx = dt._sthitidx; - _ptidx_pa = dt._ptidx_pa; - _ptidx_st = dt._ptidx_st;; - _deltap_pa = dt._deltap_pa; - _deltap_st = dt._deltap_st; - return (*this); - } - - TrkExtTrajPoint & TrkExtTraj::operator[] (int i) { - static TrkExtTrajPoint dummy; - if (i <0 || i >= int(size())) return dummy; - return _pt[i]; - } - - TrkExtTrajPoint TrkExtTraj::operator[] (int i) const { - if (i <0 || i >= int(size())) return TrkExtTrajPoint(); - return _pt[i]; - } - - //vector-like accessor - void TrkExtTraj::push_back (const TrkExtTrajPoint & trajPoint) { - _pt.push_back(trajPoint); - } - - void TrkExtTraj::clear () { - _pt.clear(); - _pahitidx.clear(); - _sthitidx.clear(); - _ptidx_pa.clear(); - _ptidx_st.clear(); - _deltap_pa.clear(); - _deltap_st.clear(); - _hepid = 0; - _ret = -1; - } - - // PA/ST related - void TrkExtTraj::makePASTHitTable () { - // see the note at header file for convention of first and second - _ptidx_pa.clear(); - _ptidx_st.clear(); - _deltap_pa.clear(); - _deltap_st.clear(); - unsigned int ret = 0, first, second; - double esum = 0; - if (_pahitidx.size() >0) { - for (unsigned int i = 0 ; i < _pahitidx.size() ; ++i) { - ret = findPASTHit(_pahitidx[i].first, ret); - first = ret; - ret = findPASTHit(_pahitidx[i].second, ret+1); - second = ret; - _ptidx_pa.push_back(make_pair(first, second)); - esum = 0; - if (second > first) esum = _pt[second].momentum().mag() - _pt[first].momentum().mag(); - _deltap_pa.push_back(esum); - } - } - if (_sthitidx.size() >0) { - for (unsigned int i = 0 ; i < _sthitidx.size() ; ++i) { - ret = findPASTHit(_sthitidx[i].first, ret); - first = ret; - ret = findPASTHit(_sthitidx[i].second, ret+1); - second = ret; - _ptidx_st.push_back(make_pair(first, second)); - esum = 0; - if (second > first) esum = _pt[second].momentum().mag() - _pt[first].momentum().mag(); - _deltap_st.push_back(esum); - } - } - } - - unsigned int TrkExtTraj::findPASTHit (unsigned int idx, unsigned int start) { - int iidx = (int)idx; - for (unsigned int i = start ; i < _pt.size() ; ++i) { - if (_pt[i].trajPointId() == iidx) return i; - } - for (unsigned int i = 0 ; i < start ; ++i) { - if (_pt[i].trajPointId() == iidx) return i; - } - throw cet::exception("DATAPRODUCT") - << "TrkExtTraj Error: Cannot find matching entry " << idx << ". PA/ST data now invalid. Report this problem to original author with reproducible example." << endl; - return 0; - } - - double TrkExtTraj::getDeltapPA () const{ - double esum = 0; - for (unsigned int i = 0 ; i < _deltap_pa.size() ; ++i) { - esum += _deltap_pa[i]; - } - return esum; - } - - double TrkExtTraj::getDeltapST () const { - double esum = 0; - for (unsigned int i = 0 ; i < _deltap_st.size() ; ++i) { - esum += _deltap_st[i]; - } - return esum; - } - - - // interpolation related - unsigned int TrkExtTraj::findNeighborsZ (double z, std::vector & idx, unsigned int idx1, unsigned int idx2) const{ - idx.clear(); - if (size() <=2) return 0; // no interpolation when N(ext data) <=2 - bool p; - unsigned int scanmin, scanmax; - if (idx1 < idx2) { - scanmin = idx1; - scanmax = idx2; - } - else if (idx1 > idx2) { - scanmin = idx2; - scanmax = idx1; - } - else { - scanmin = 1; - scanmax = size()-1; - } - p = ( (_pt[scanmin].z() > z) ? true : false); - for (unsigned int i = scanmin+1 ; i <=scanmax ; ++i) { - bool n = ( (_pt[i].z() > z) ? true : false); - if (n != p) { - if ( fabs(_pt[i-1].z() - z) < fabs(_pt[i].z() - z) ) idx.push_back(i-1); - else idx.push_back(i); - p = n; - } - } - if (idx.size()<=0) return 0; - else return idx.size(); - } - - - std::vector TrkExtTraj::getPointsAtZ (double z, unsigned int idx1, unsigned int idx2) const { - std::vector points; - points.clear(); - vector idx; - unsigned int ret = findNeighborsZ (z, idx, idx1, idx2); - - if (ret <=0) { ; } -/* two point interpolation - else if (ret == 0) { - unsigned int id = idx[0]; - double x = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].x(), _pt[id+1].x()); - double y = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].y(), _pt[id+1].y()); - double px = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].px(), _pt[id+1].px()); - double py = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].py(), _pt[id+1].py()); - double pz = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].pz(), _pt[id+1].pz()); - double fl = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].flightLength(), _pt[id+1].flightLength()); - double ft = interpolate2(z, _pt[id].z(), _pt[id+1].z(), _pt[id].flightTime(), _pt[id+1].flightTime()); - int volid; - if (fabs(_pt[id].z() - z) < fabs(_pt[id+1].z() - z)) volid = _pt[id].volumeId(); - else volid = _pt[id+1].volumeId(); - Hep3Vector pos(x, y, z); - Hep3Vector mom(px,py,pz); - HepMatrix cov; - TrkExtTrajPoint point(idx[0], pos, mom, cov, volid, fl, ft); - points.push_back(point); - } -*/ - else { - for (unsigned int i = 0 ; i < idx.size() ; ++i) { - unsigned int id = idx[i]; - double x = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].x(), _pt[id].x(), _pt[id+1].x()); - double y = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].y(), _pt[id].y(), _pt[id+1].y()); - double px = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].px(), _pt[id].px(), _pt[id+1].px()); - double py = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].py(), _pt[id].py(), _pt[id+1].py()); - double pz = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].pz(), _pt[id].pz(), _pt[id+1].pz()); - double fl = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].flightLength(), _pt[id].flightLength(), _pt[id+1].flightLength()); - double ft = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), _pt[id-1].flightTime(), _pt[id].flightTime(), _pt[id+1].flightTime()); - int volid = _pt[id].volumeId(); - Hep3Vector pos(x, y, z); - Hep3Vector mom(px,py,pz); - HepMatrix cov(6,6,0); - HepMatrix const & cov1 = _pt[id-1].covariance(); - HepMatrix const & cov2 = _pt[id].covariance(); - HepMatrix const & cov3 = _pt[id+1].covariance(); - for (unsigned int j = 1 ; j <=6 ; ++j) { - for (unsigned int k = j ; k <=6 ; ++k) { - cov(j,k) = cov(k,j) = interpolate3(z, _pt[id-1].z(), _pt[id].z(), _pt[id+1].z(), cov1(j,k), cov2(j,k), cov3(j,k)); - } - } - TrkExtTrajPoint point(idx[i], pos, mom, cov, volid, fl, ft); - points.push_back(point); - } - } - return points; - } - -/* double TrkExtTraj::interpolate2 (double z, double x1, double x2, double y1, double y2) const { - if (x2 != x1) { - return (y2-y1)/(x2-x1)*(z-x1)+y1; - } - else { - return 0; - } - }*/ - - double TrkExtTraj::interpolate3 (double z, double x1, double x2, double x3, double y1, double y2, double y3) const { - double x1_x2 = x1 - x2; - double x2_x3 = x2 - x3; - double x3_x1 = x3 - x1; - if (x1_x2 !=0 && x2_x3 != 0 && x3_x1 != 0) { - return y1*(z-x2)*(x3-z)/x1_x2/x3_x1 + y2*(x1-z)*(z-x3)/x1_x2/x2_x3 + y3*(z-x1)*(x2-z)/x3_x1/x2_x3; - } - else { - return 0; - } - } - - - const TrkExtTrajPoint & TrkExtTraj::getFirstPAHit (unsigned int i) const { - // always returns final hit inside PA in time - int first = _ptidx_pa[i].first; - int second = _ptidx_pa[i].second; - - int nsteps = std::abs(second - first); - if (nsteps ==0) { - return _pt[first]; - } - else { - if (_pt[first].flightTime() > _pt[second].flightTime()) - return _pt[first]; - else - return _pt[second]; - } - } - - const TrkExtTrajPoint & TrkExtTraj::getFirstSTHit (unsigned int i) const { - // always returns final hit inside ST in time - int first = _ptidx_st[i].first; - int second = _ptidx_st[i].second; - - int nsteps = std::abs(second - first); - if (nsteps ==0) { - return _pt[first]; - } - else { - if (_pt[first].flightTime() > _pt[second].flightTime()) - return _pt[first]; - else - return _pt[second]; - } - } - - - TrkExtTrajPoint TrkExtTraj::getMeanPAHit (unsigned int i) const { - // returns interpolated center inside PA in z - unsigned int first = _ptidx_pa[i].first; - unsigned int second = _ptidx_pa[i].second; - - if (first == second) return _pt[first]; - - double zc = (_pt[first].z() + _pt[second].z()) * 0.5; - - vector points = getPointsAtZ(zc, first, second); - if (points.size() <=0) { - throw cet::exception("DATAPRODUCT") - << "TrkExtTraj Error : cannot find getMeanPaHit. Error in interpolation! Report to the author." << endl; - TrkExtTrajPoint point; - return point; - } - return points[0]; - } - - TrkExtTrajPoint TrkExtTraj::getMeanSTHit (unsigned int i) const { - // returns interpolated center inside ST in z - unsigned int first = _ptidx_st[i].first; - unsigned int second = _ptidx_st[i].second; - - if (first == second) return _pt[first]; - - double zc = (_pt[first].z() + _pt[second].z()) * 0.5; - - vector points = getPointsAtZ(zc, first, second); - if (points.size() <=0) { - throw cet::exception("DATAPRODUCT") - << "TrkExtTraj Error : cannot find getMeanPaHit. Error in interpolation! Report to the author." << endl; - TrkExtTrajPoint point; - return point; - } - return points[0]; - } - - - -} // end namespace mu2e diff --git a/RecoDataProducts/src/TrkExtTrajPoint.cc b/RecoDataProducts/src/TrkExtTrajPoint.cc deleted file mode 100644 index 1c04ce7a91..0000000000 --- a/RecoDataProducts/src/TrkExtTrajPoint.cc +++ /dev/null @@ -1,114 +0,0 @@ -// -// -// Original author MyeongJae Lee -// -// - -// C++ includes. -#include -#include -//#include -#include - -// Framework includes. -#include "cetlib_except/exception.h" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "Offline/RecoDataProducts/inc/TrkExtTrajPoint.hh" - -using namespace CLHEP; - -using namespace std; - -namespace mu2e { - - TrkExtTrajPoint::TrkExtTrajPoint() : - _x(0), - _p(0), - _volid(0), - _trajPtId(-1), - _fl(0), - _ft(0) - { - _cov = HepMatrix(6,6,0); - } - - TrkExtTrajPoint::~TrkExtTrajPoint() - { - } - - TrkExtTrajPoint::TrkExtTrajPoint(int id, Hep3Vector & x, Hep3Vector & p, HepMatrix & cov, int volid, double fl, double ft) : - _x(x), - _p(p), - _volid(volid), - _trajPtId(id), - _fl(fl), - _ft(ft) - { - if (cov.num_row() !=6 ||cov.num_col() !=6) { - throw cet::exception("ARGUMENT") << "TrkExtTrajPoint Error: invalid dimension for cov matrix" << endl; - } - else { - _cov = cov; - } - } - - TrkExtTrajPoint::TrkExtTrajPoint (const TrkExtTrajPoint & dt) { - _x = dt._x; - _p = dt._p; - _cov = dt._cov; - _volid = dt._volid; - _trajPtId = dt._trajPtId; - _fl = dt._fl; - _ft = dt._ft; - } - - TrkExtTrajPoint & TrkExtTrajPoint::operator= (const TrkExtTrajPoint & dt) { - _x = dt._x; - _p = dt._p; - _cov = dt._cov; - _volid = dt._volid; - _trajPtId = dt._trajPtId; - _fl = dt._fl; - _ft = dt._ft; - return (*this); - } - - TrkExtTrajPoint::TrkExtTrajPoint(int id, CLHEP::HepVector & r, int volid, double fl, double ft) { - _x.set(r[0], r[1], r[2]); - _p.set(r[3], r[4], r[5]); - _volid = volid; - _trajPtId = id; - _fl = fl; - _ft = ft; - } - - HepVector TrkExtTrajPoint::vector() { - HepVector xp(6,0); - xp[0] = x(); - xp[1] = y(); - xp[2] = z(); - xp[3] = px(); - xp[4] = py(); - xp[5] = pz(); - return xp; - } - - void TrkExtTrajPoint::setCovariance(CLHEP::HepMatrix & c) { - _cov = c; - } - - CLHEP::Hep3Vector TrkExtTrajPoint::positionError () { - Hep3Vector error(ex(), ey(), ez()); - return error; - } - - CLHEP::Hep3Vector TrkExtTrajPoint::momentumError () { - Hep3Vector error(epx(), epy(), epz()); - return error; - } - - -} // end namespace mu2e - - diff --git a/RecoDataProducts/src/classes.h b/RecoDataProducts/src/classes.h index d4f8ec91a1..b95d8f6cd4 100644 --- a/RecoDataProducts/src/classes.h +++ b/RecoDataProducts/src/classes.h @@ -48,9 +48,6 @@ #include "Offline/RecoDataProducts/inc/TrkFitFlag.hh" #include "Offline/RecoDataProducts/inc/KKLoopHelix.hh" #include "Offline/RecoDataProducts/inc/KKCentralHelix.hh" -#include "Offline/RecoDataProducts/inc/TrackSummaryRecoMap.hh" -#include "Offline/RecoDataProducts/inc/TrackSummary.hh" -#include "Offline/RecoDataProducts/inc/TrackCaloAssns.hh" #include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "Offline/RecoDataProducts/inc/KalIntersection.hh" #include "Offline/RecoDataProducts/inc/KalSeedAssns.hh" diff --git a/RecoDataProducts/src/classes_def.xml b/RecoDataProducts/src/classes_def.xml index 9bbc448f49..7e239ba0be 100644 --- a/RecoDataProducts/src/classes_def.xml +++ b/RecoDataProducts/src/classes_def.xml @@ -191,14 +191,6 @@ - - - - - - - - @@ -298,9 +290,6 @@ - - - diff --git a/TEveEventDisplay/CMakeLists.txt b/TEveEventDisplay/CMakeLists.txt index e2f7c8936f..9e3486a899 100644 --- a/TEveEventDisplay/CMakeLists.txt +++ b/TEveEventDisplay/CMakeLists.txt @@ -14,6 +14,7 @@ cet_make_library( src/TEveMu2eProjectionInterface.cc src/TEveMu2eStraightTrack.cc src/TEveMu2eTracker.cc + src/TEveMu2eCustomHelix.cc LIBRARIES PUBLIC Offline::ConfigTools Offline::GeometryService diff --git a/TEveEventDisplay/fcl/prolog.fcl b/TEveEventDisplay/fcl/prolog.fcl index 5c4c247f5a..6a915606e6 100644 --- a/TEveEventDisplay/fcl/prolog.fcl +++ b/TEveEventDisplay/fcl/prolog.fcl @@ -22,7 +22,6 @@ TEveEventDisplayBase : { CaloHitCollection : NULL HelixSeedCollection : "HelixFinderDe:Negative" KalSeedCollection : ["KFFDeM"] - TrkExtTrajCollection : NULL MCTrajectoryCollection : "compressRecoMCs" addHits : true addTrkHits : true @@ -31,7 +30,6 @@ TEveEventDisplayBase : { addCrvHits : true addCosmicSeedFit : false addClusters : true - addTrkExtTrajs : false addMCTraj : true addKKTracks : false } @@ -63,7 +61,6 @@ TEveEventDisplayUpstream : { MCTrajectoryCollection : "g4run" HelixSeedCollection : NULL KalSeedCollection : [NULL] - TrkExtTrajCollection : NULL addHits : false addTrkHits : false addTimeClusters : false @@ -90,7 +87,6 @@ TEveEventDisplayCosmics : { # for stright cosmic for alignment (ordinary cosmics CaloHitCollection : NULL HelixSeedCollection : NULL KalSeedCollection : [] - TrkExtTrajCollection : NULL MCTrajectoryCollection : NULL #"compressDigiMCs" addHits : false addTrkHits : false @@ -99,7 +95,6 @@ TEveEventDisplayCosmics : { # for stright cosmic for alignment (ordinary cosmics addCrvHits : true addCosmicSeedFit : false addClusters : false - addTrkExtTrajs : false addMCTraj : false } show :{ diff --git a/TEveEventDisplay/src/Collection_Filler.cc b/TEveEventDisplay/src/Collection_Filler.cc index cd99f08b1c..a4dfd66d71 100644 --- a/TEveEventDisplay/src/Collection_Filler.cc +++ b/TEveEventDisplay/src/Collection_Filler.cc @@ -11,7 +11,6 @@ namespace mu2e{ cryHitTag_(conf.cryHitTag()), hseedTag_(conf.hseedTag()), kalseedTag_(conf.kalseedTag()), - trkexttrajTag_(conf.trkexttrajTag()), mctrajTag_(conf.mctrajTag()), addHits_(conf.addHits()), addTimeClusters_(conf.addTimeClusters()), @@ -20,7 +19,6 @@ namespace mu2e{ addClusters_(conf.addClusters()), addCrvHits_(conf.addCrvHits()), addCosmicSeedFit_(conf.addCosmicSeedFit()), - addTrkExtTrajs_(conf.addTrkExtTrajs()), RecoOnly_(conf.RecoOnly()), FillAll_(conf.FillAll()), addMCTraj_(conf.addMCTraj()), @@ -87,10 +85,6 @@ namespace mu2e{ auto chH = evt.getValidHandle(crvcoinTag_); data.crvcoincol = chH.product(); } - if(FillAll_ or RecoOnly_ or (addTrkExtTrajs_ and CollectionName==TrkExtTrajectories)){ - auto chH = evt.getValidHandle(trkexttrajTag_); - data.trkextcol = chH.product(); - } } /*------------Function to fill MCDataProduct lists:-------------*/ diff --git a/TEveEventDisplay/src/TEveMu2eCustomHelix.cc b/TEveEventDisplay/src/TEveMu2eCustomHelix.cc new file mode 100644 index 0000000000..5bc71b9c63 --- /dev/null +++ b/TEveEventDisplay/src/TEveMu2eCustomHelix.cc @@ -0,0 +1,23 @@ +#include "Offline/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eCustomHelix.h" +#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" +#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" + +using namespace mu2e; +namespace mu2e{ + + TEveMu2eCustomHelix::TEveMu2eCustomHelix(){} + + /*------------Function to build Infor after contruction:-------------*/ + void TEveMu2eCustomHelix::SetSeedInfo(KalSeed seed) { + fKalSeed_ = seed; + auto const& fseg = fKalSeed_.segments().front(); + this->Momentum_ = fseg.mom(); + this->PDGcode_ = fKalSeed_.particle(); + auto const& ptable = mu2e::GlobalConstantsHandle(); + this->Charge_ = ptable->particle(fKalSeed_.particle()).charge(); + this->Mass_ = ptable->particle(fKalSeed_.particle()).mass(); + this->Radius_ = fabs(1.0/fseg.helix().omega()); + this->Time_ = fKalSeed_.t0().t0(); + } + +} diff --git a/TEveEventDisplay/src/TEveMu2eDataInterface.cc b/TEveEventDisplay/src/TEveMu2eDataInterface.cc index 05ce2ebd3c..6f75c03259 100644 --- a/TEveEventDisplay/src/TEveMu2eDataInterface.cc +++ b/TEveEventDisplay/src/TEveMu2eDataInterface.cc @@ -666,7 +666,6 @@ void TEveMu2eDataInterface::FillKinKalTrajectory(bool firstloop, std::tupletoMu2e(p); -// line->SetPostionAndDirectionFromKalRep((InMu2e.z())); line->SetNextPoint(pointmmTocm(InMu2e.x()), pointmmTocm(InMu2e.y()), pointmmTocm(InMu2e.z())); line_twoDXY->SetNextPoint(pointmmTocm(p.x()), pointmmTocm(p.y()), pointmmTocm(p.z())); line_twoDXZ->SetNextPoint(pointmmTocm(p.x()), pointmmTocm(p.y()), pointmmTocm(p.z())); diff --git a/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eCustomHelix.h b/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eCustomHelix.h index 3d6bbd9b8e..6a7ce3a19b 100644 --- a/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eCustomHelix.h +++ b/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eCustomHelix.h @@ -6,7 +6,6 @@ #include #include "Offline/RecoDataProducts/inc/HelixSeed.hh" #include "Offline/RecoDataProducts/inc/KalSeed.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" using namespace mu2e; @@ -21,16 +20,11 @@ namespace mu2e { KalSeed fKalSeed_; HelixSeed fHelixSeed_; - TrkExtTraj fTrkExtTraj_; void DrawHelixTrack(); void Draw2DProjection(); void SetSeedInfo(KalSeed seed); - void SetPostionAndDirectionFromHelixSeed(double zpos); - void SetPostionAndDirectionFromKalRep(double zpos); - void SetMomentumExt(); - void SetParticleExt(); XYZVectorF Direction_; XYZVectorF Position_; diff --git a/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eDataInterface.h b/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eDataInterface.h index 5ef604ec42..79655b2c28 100644 --- a/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eDataInterface.h +++ b/TEveEventDisplay/src/TEveMu2e_base_classes/TEveMu2eDataInterface.h @@ -85,8 +85,6 @@ namespace mu2e{ void AddHelixPieceWise2D(bool firstloop, std::tuple, std::vector> track_tuple, TEveMu2e2DProjection *tracker2Dproj, double min_time, double max_time, bool Redraw, bool accumulate, TEveProjectionManager *TXYMgr, TEveProjectionManager *TRZMgr, TEveScene *scene1, TEveScene *scene2); - void AddTrackExitTrajectories(bool firstloop, const TrkExtTrajCollection *trkextcol, double min_time, double max_time, bool Redraw, bool accumulate); - ClassDef(TEveMu2eDataInterface,0); }; //end class def diff --git a/TEveEventDisplay/src/dict_classes/Collection_Filler.h b/TEveEventDisplay/src/dict_classes/Collection_Filler.h index 8cc484d27f..cfce485ca0 100644 --- a/TEveEventDisplay/src/dict_classes/Collection_Filler.h +++ b/TEveEventDisplay/src/dict_classes/Collection_Filler.h @@ -19,8 +19,6 @@ //Kalman Tracks #include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" //Tracker Hits: #include "Offline/RecoDataProducts/inc/ComboHit.hh" //CRV: @@ -42,7 +40,7 @@ using namespace CLHEP; namespace mu2e{ - enum RecoDataProductName {ComboHits, TimeClusters, CaloCrystalHits, CaloClusters, CosmicTracks, HelixSeeds, KalSeeds, CRVRecoPulses, TrkExtTrajectories}; + enum RecoDataProductName {ComboHits, TimeClusters, CaloCrystalHits, CaloClusters, CosmicTracks, HelixSeeds, KalSeeds, CRVRecoPulses}; enum MCDataProductName {MCTrajectories}; class Collection_Filler @@ -63,7 +61,6 @@ namespace mu2e{ fhicl::AtomcryHitTag{Name("CaloHitCollection"),Comment("cryHitTag")}; fhicl::AtomhseedTag{Name("HelixSeedCollection"),Comment("hseedTag")}; fhicl::SequencekalseedTag{Name("KalSeedCollection"),Comment("kalseedTag")}; - fhicl::AtomtrkexttrajTag{Name("TrkExtTrajCollection"),Comment("trkexttrajTag")}; //MC Data Products fhicl::AtommctrajTag{Name("MCTrajectoryCollection"),Comment("mctrajTag")}; @@ -76,7 +73,6 @@ namespace mu2e{ fhicl::Atom addCrvHits{Name("addCrvHits"), Comment("set to add crv hits"),false}; fhicl::Atom addCrystallHits{Name("addCrystalHits"), Comment("for calo cry hits"), false}; fhicl::Atom addCosmicSeedFit{Name("addCosmicSeedFit"), Comment("for fitted cosmic track"), false}; - fhicl::Atom addTrkExtTrajs{Name("addTrkExtTrajs"), Comment("set to add track exit trajectories"), false}; fhicl::Atom RecoOnly{Name("RecoOnly"), Comment("set to see only Reco Data Products"), false}; fhicl::Atom FillAll{Name("FillAll"), Comment("to see all available products"), false}; fhicl::Atom addMCTraj{Name("addMCTraj"), Comment("set to add MC trajectories"), false}; @@ -105,7 +101,7 @@ namespace mu2e{ art::Event *_event; art::Run *_run; - bool addHits_, addTimeClusters_, addTrkHits_, addTracks_, addClusters_, addCrvHits_, addCosmicSeedFit_, isCosmic_, addTrkExtTrajs_, RecoOnly_, FillAll_, addMCCaloDigis_, addMCTraj_, addKKTracks_, MCOnly_; + bool addHits_, addTimeClusters_, addTrkHits_, addTracks_, addClusters_, addCrvHits_, addCosmicSeedFit_, isCosmic_, RecoOnly_, FillAll_, addMCCaloDigis_, addMCTraj_, addKKTracks_, MCOnly_; void FillRecoCollections(const art::Event& evt, Data_Collections &data, RecoDataProductName code); void FillMCCollections(const art::Event& evt, Data_Collections &data, MCDataProductName code); virtual ~Collection_Filler(){}; diff --git a/TEveEventDisplay/src/dict_classes/Data_Collections.h b/TEveEventDisplay/src/dict_classes/Data_Collections.h index 2f7c61da3d..03335f49d1 100644 --- a/TEveEventDisplay/src/dict_classes/Data_Collections.h +++ b/TEveEventDisplay/src/dict_classes/Data_Collections.h @@ -10,8 +10,6 @@ //Kalman Tracks #include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkExtTraj.hh" //Tracker Hits: #include "Offline/RecoDataProducts/inc/ComboHit.hh" //CRV: @@ -48,7 +46,6 @@ namespace mu2e{ const CaloHitCollection* cryHitcol = 0; const HelixSeedCollection* hseedcol = 0; const KalSeedCollection* kalseedcol = 0; - const TrkExtTrajCollection* trkextcol = 0; std::vector track_list; std::vector track_labels; std::tuple, std::vector> track_tuple; diff --git a/TrackerMC/src/MakeStrawGasSteps_module.cc b/TrackerMC/src/MakeStrawGasSteps_module.cc index 99e95b8394..3d352ab37a 100644 --- a/TrackerMC/src/MakeStrawGasSteps_module.cc +++ b/TrackerMC/src/MakeStrawGasSteps_module.cc @@ -172,7 +172,7 @@ namespace mu2e { auto bnom = bfmgr->getBField(vpoint_mu2e); _bdir = bnom.unit(); // B in units of mm/MeV/c - _bnom = bnom.mag()*BField::mmTeslaToMeVc; + _bnom = bnom.mag()*CLHEP::c_light/1000.0; // pre-compute momentum thresholds for straight, arc, and curler const Tracker& tracker = *GeomHandle(); _rstraw = tracker.strawProperties()._strawInnerRadius; @@ -319,7 +319,7 @@ namespace mu2e { // determine the width from the sigitta or curl radius auto pdir = first->momentum().unit(); auto pperp = pdir.perp(_bdir); - float bendrms = 0.5*std::min(_rstraw,mom*pperp/_bnom); // bend radius spread. 0.5 factor givs RMS of a circle + float bendrms = 0.5*std::min(_rstraw,mom*pperp/std::max(_bnom,float(1e-6))); // bend radius spread. 0.5 factor givs RMS of a circle. Protect against 0 field // only sigitta perp to the wire counts float sint = (_bdir.cross(pdir).cross(straw.getDirection())).mag(); static const float prms(1.0/(12.0*sqrt(5.0))); // RMS for a parabola. This includes a factor 1/8 for the sagitta calculation too From a00c5fc0c686953dd0fb0c9b60948aea3f7d90f3 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 17:02:22 -0800 Subject: [PATCH 099/174] Fix runtime issue --- ProditionsService/fcl/prolog.fcl | 2 -- ProditionsService/src/ProditionsService.cc | 4 ---- 2 files changed, 6 deletions(-) diff --git a/ProditionsService/fcl/prolog.fcl b/ProditionsService/fcl/prolog.fcl index f093012d36..f533b2088d 100644 --- a/ProditionsService/fcl/prolog.fcl +++ b/ProditionsService/fcl/prolog.fcl @@ -20,8 +20,6 @@ Proditions : { strawResponse : @local::StrawResponse alignedTracker : @local::AlignedTracker alignedTrackerSim : @local::AlignedTrackerSim - mu2eMaterial : @local::Mu2eMaterial - mu2eDetector : @local::Mu2eDetector caloDAQConditions : @local::CaloDAQConditions trkQualCatalog : @local::TrkQualCatalog crvOrdinal : @local::CRVOrdinal diff --git a/ProditionsService/src/ProditionsService.cc b/ProditionsService/src/ProditionsService.cc index 17932ebce9..1e9f8f943f 100644 --- a/ProditionsService/src/ProditionsService.cc +++ b/ProditionsService/src/ProditionsService.cc @@ -85,10 +85,6 @@ ProditionsService::ProditionsService(Parameters const& sTable, auto atcs = std::make_shared(_config.alignedTrackerSim()); _caches[atcs->name()+"Sim"] = atcs; - //auto mmc = std::make_shared(_config.mu2eMaterial()); - //_caches[mmc->name()] = mmc; - //auto mdc = std::make_shared(_config.mu2eDetector()); - //_caches[mdc->name()] = mdc; auto cdc = std::make_shared(_config.caloDAQConditions()); _caches[cdc->name()] = cdc; From 521f458c5e35fb2b4f52860ea85ff4208d6d7007 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 17:51:08 -0800 Subject: [PATCH 100/174] More cleanup --- Analyses/src/SConscript | 2 -- Analyses/test/cosmicFilter.fcl | 1 - Analyses/test/genMixReco.fcl | 1 - Analyses/test/hitDisplay.fcl | 1 - Analyses/test/readCaloDigi.fcl | 1 - Analyses/test/readTrackCluster.fcl | 1 - CalPatRec/src/SConscript | 3 --- CaloConditions/src/SConscript | 3 --- CaloDiag/src/SConscript | 2 -- CaloFilters/src/SConscript | 2 -- Compression/src/SConscript | 1 - ConditionsService/src/SConscript | 1 - CosmicReco/src/SConscript | 3 --- DAQ/src/SConscript | 1 - DAQConditions/src/SConscript | 6 +---- EventDisplay/src/SConscript | 2 -- EventGenerator/test/ceLeadingLog_test.fcl | 1 - EventGenerator/test/ceMEndpoint_test.fcl | 1 - EventGenerator/test/cePEndpoint_test.fcl | 1 - EventGenerator/test/cePLeadingLog_test.fcl | 1 - EventGenerator/test/rpc_int_test.fcl | 1 - Filters/src/SConscript | 2 -- Lumi/src/SConscript | 1 - Mu2eUtilities/inc/toHepPoint.hh | 27 ---------------------- Mu2eUtilities/src/SConscript | 3 --- ParticleID/src/SConscript | 2 -- Print/src/SConscript | 2 -- TEveEventDisplay/src/SConscript | 2 -- Trigger/src/SConscript | 2 -- TrkDiag/src/SConscript | 5 ---- TrkFilters/src/SConscript | 2 -- TrkPatRec/src/SConscript | 3 --- TrkReco/src/SConscript | 16 ------------- Validation/src/SConscript | 2 -- 34 files changed, 1 insertion(+), 104 deletions(-) delete mode 100644 Mu2eUtilities/inc/toHepPoint.hh diff --git a/Analyses/src/SConscript b/Analyses/src/SConscript index f262417679..19db6dbf58 100644 --- a/Analyses/src/SConscript +++ b/Analyses/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] extrarootlibs = [ 'Geom' ] @@ -42,7 +41,6 @@ helper.make_plugins( [ mainlib, 'mu2e_GeneralUtilities', 'mu2e_CaloMC', 'mu2e_DbTables', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/Analyses/test/cosmicFilter.fcl b/Analyses/test/cosmicFilter.fcl index e59a77d93f..c52a9267ab 100644 --- a/Analyses/test/cosmicFilter.fcl +++ b/Analyses/test/cosmicFilter.fcl @@ -38,7 +38,6 @@ services : { } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } } # close of services block diff --git a/Analyses/test/genMixReco.fcl b/Analyses/test/genMixReco.fcl index c5b9b15848..709d8d0891 100644 --- a/Analyses/test/genMixReco.fcl +++ b/Analyses/test/genMixReco.fcl @@ -46,7 +46,6 @@ services : { ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } - BTrkHelper : @local::BTrkHelperDefault SeedService : @local::automaticSeeds } diff --git a/Analyses/test/hitDisplay.fcl b/Analyses/test/hitDisplay.fcl index aedad1d325..3be76e66ea 100644 --- a/Analyses/test/hitDisplay.fcl +++ b/Analyses/test/hitDisplay.fcl @@ -42,7 +42,6 @@ services : } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault } # close of services block diff --git a/Analyses/test/readCaloDigi.fcl b/Analyses/test/readCaloDigi.fcl index 016dd10cbd..c1cf21b2cd 100644 --- a/Analyses/test/readCaloDigi.fcl +++ b/Analyses/test/readCaloDigi.fcl @@ -24,7 +24,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/Analyses/test/readTrackCluster.fcl b/Analyses/test/readTrackCluster.fcl index 6035ad6283..39a134341b 100644 --- a/Analyses/test/readTrackCluster.fcl +++ b/Analyses/test/readTrackCluster.fcl @@ -34,7 +34,6 @@ services : { GeometryService : { inputFile : "Production/JobConfig/TDR/geom_MothersToHits.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/src/SConscript b/CalPatRec/src/SConscript index ec011e367b..3794a590ad 100644 --- a/CalPatRec/src/SConscript +++ b/CalPatRec/src/SConscript @@ -9,7 +9,6 @@ import os Import('env') Import('mu2e_helper') -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] extrarootlibs = ['TMVA' , 'Minuit' , 'XMLIO' ] @@ -32,7 +31,6 @@ mainlib = helper.make_mainlib( [ 'mu2e_CalPatRec_dict', 'mu2e_DataProducts', 'mu2e_GlobalConstantsService_GlobalConstantsService_service', 'mu2e_GlobalConstantsService', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -66,7 +64,6 @@ helper.make_plugins( [ mainlib, 'mu2e_DataProducts', 'mu2e_ConfigTools', 'mu2e_GeneralUtilities', - babarlibs, 'mu2e_GlobalConstantsService_GlobalConstantsService_service', 'mu2e_GlobalConstantsService', 'art_Framework_Core', diff --git a/CaloConditions/src/SConscript b/CaloConditions/src/SConscript index 05a63a6c42..b9b1f2582f 100644 --- a/CaloConditions/src/SConscript +++ b/CaloConditions/src/SConscript @@ -15,10 +15,7 @@ helper=mu2e_helper(env); mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_GeometryService', - #'mu2e_BFieldGeom', - # 'mu2e_Mu2eBTrk', 'mu2e_CalorimeterGeom', - # 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', diff --git a/CaloDiag/src/SConscript b/CaloDiag/src/SConscript index adee66db91..bae9e080a5 100644 --- a/CaloDiag/src/SConscript +++ b/CaloDiag/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] extrarootlibs = [ 'Geom' ] @@ -41,7 +40,6 @@ helper.make_plugins( [ mainlib, 'mu2e_DataProducts', 'mu2e_GeneralUtilities', 'mu2e_CaloMC', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/CaloFilters/src/SConscript b/CaloFilters/src/SConscript index 2652a22825..c227e42f9d 100644 --- a/CaloFilters/src/SConscript +++ b/CaloFilters/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] extrarootlibs = [ 'Geom', 'TMVA' , 'Minuit' , 'XMLIO' ] @@ -37,7 +36,6 @@ helper.make_plugins( [ mainlib, 'mu2e_ConfigTools', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/Compression/src/SConscript b/Compression/src/SConscript index a19b84e892..ac2a89a2eb 100644 --- a/Compression/src/SConscript +++ b/Compression/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] mainlib = helper.make_mainlib ( [ diff --git a/ConditionsService/src/SConscript b/ConditionsService/src/SConscript index f1991e6e9e..bd948985ae 100644 --- a/ConditionsService/src/SConscript +++ b/ConditionsService/src/SConscript @@ -32,7 +32,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_RecoDataProducts', helper.make_plugins( [ mainlib, 'mu2e_TrackerConditions', - 'mu2e_Mu2eBTrk', 'mu2e_ConfigTools', 'art_Framework_Principal', 'art_Persistency_Provenance', diff --git a/CosmicReco/src/SConscript b/CosmicReco/src/SConscript index c81cc92257..51504ff7ef 100644 --- a/CosmicReco/src/SConscript +++ b/CosmicReco/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] extrarootlibs = [ 'TMVA' , 'Minuit' , 'XMLIO', 'Minuit2', 'Geom', 'Geom', 'GeomPainter', 'Ged'] mainlib = helper.make_mainlib ( [ 'mu2e_Mu2eUtilities', @@ -27,7 +26,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_DataProducts', 'mu2e_GeneralUtilities', 'mu2e_GeomPrimitives', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -68,7 +66,6 @@ helper.make_plugins( [ 'mu2e_TrkReco', 'mu2e_GeomPrimitives', 'mu2e_DbTables', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/DAQ/src/SConscript b/DAQ/src/SConscript index b0ea70e9ca..63c24beaa6 100644 --- a/DAQ/src/SConscript +++ b/DAQ/src/SConscript @@ -49,7 +49,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', exclude_files = [ ] helper.make_plugins( [ mainlib, - 'mu2e_Mu2eBTrk', 'mu2e_Mu2eUtilities', 'mu2e_ConditionsService', 'mu2e_TrackerConditions', diff --git a/DAQConditions/src/SConscript b/DAQConditions/src/SConscript index 1e0fb3ab8f..d1d0cc028e 100644 --- a/DAQConditions/src/SConscript +++ b/DAQConditions/src/SConscript @@ -16,7 +16,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_BFieldGeom', - 'mu2e_Mu2eBTrk', 'mu2e_TrackerGeom', 'mu2e_MCDataProducts', @@ -25,10 +24,7 @@ mainlib = helper.make_mainlib ( [ 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - 'BTrk_BaBar', - 'BTrk_MatEnv', - 'BTrk_DetectorModel', - 'art_Framework_Services_Registry', + 'art_Framework_Services_Registry', 'art_root_io_tfile_support', 'art_Utilities', 'canvas', diff --git a/EventDisplay/src/SConscript b/EventDisplay/src/SConscript index 1ca5843bf7..61f1c2498e 100644 --- a/EventDisplay/src/SConscript +++ b/EventDisplay/src/SConscript @@ -9,13 +9,11 @@ Import('mu2e_helper') helper=mu2e_helper(env) -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] extrarootlibs = [ 'Geom', 'Geom', 'GeomPainter', 'Ged' ] userlibs = [ rootlibs, extrarootlibs, - babarlibs, 'mu2e_DataProducts', 'mu2e_TrkReco', 'mu2e_Mu2eUtilities', diff --git a/EventGenerator/test/ceLeadingLog_test.fcl b/EventGenerator/test/ceLeadingLog_test.fcl index 8d6fe9224a..295592346a 100644 --- a/EventGenerator/test/ceLeadingLog_test.fcl +++ b/EventGenerator/test/ceLeadingLog_test.fcl @@ -24,7 +24,6 @@ services : { GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/EventGenerator/test/ceMEndpoint_test.fcl b/EventGenerator/test/ceMEndpoint_test.fcl index 107a060534..1abf6b6a3f 100644 --- a/EventGenerator/test/ceMEndpoint_test.fcl +++ b/EventGenerator/test/ceMEndpoint_test.fcl @@ -21,7 +21,6 @@ services : { GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/EventGenerator/test/cePEndpoint_test.fcl b/EventGenerator/test/cePEndpoint_test.fcl index 30a7c79017..97137762aa 100644 --- a/EventGenerator/test/cePEndpoint_test.fcl +++ b/EventGenerator/test/cePEndpoint_test.fcl @@ -21,7 +21,6 @@ services : { GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/EventGenerator/test/cePLeadingLog_test.fcl b/EventGenerator/test/cePLeadingLog_test.fcl index 011f8d775c..08181f8723 100644 --- a/EventGenerator/test/cePLeadingLog_test.fcl +++ b/EventGenerator/test/cePLeadingLog_test.fcl @@ -21,7 +21,6 @@ services : { GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/EventGenerator/test/rpc_int_test.fcl b/EventGenerator/test/rpc_int_test.fcl index 81d956f118..57fcdfeb47 100644 --- a/EventGenerator/test/rpc_int_test.fcl +++ b/EventGenerator/test/rpc_int_test.fcl @@ -26,7 +26,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - BTrkHelper : @local::BTrkHelperDefault Mu2eG4Helper : { } SeedService : { @table::automaticSeeds baseSeed : 8 diff --git a/Filters/src/SConscript b/Filters/src/SConscript index 07c891848c..fb15098e17 100644 --- a/Filters/src/SConscript +++ b/Filters/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] @@ -34,7 +33,6 @@ helper.make_plugins( [ 'mu2e_DbTables', 'mu2e_TrackerConditions', 'mu2e_ConditionsService', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/Lumi/src/SConscript b/Lumi/src/SConscript index 7399da2bee..70d3db5176 100644 --- a/Lumi/src/SConscript +++ b/Lumi/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] extrarootlibs = [ ] diff --git a/Mu2eUtilities/inc/toHepPoint.hh b/Mu2eUtilities/inc/toHepPoint.hh deleted file mode 100644 index 25d4b8b6bc..0000000000 --- a/Mu2eUtilities/inc/toHepPoint.hh +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef Mu2eUtilities_toHepPoint_hh -#define Mu2eUtilities_toHepPoint_hh -// -// Free functions to convert between HepPoint and CLHEP::Hep3Vector. -// -// -// Original author Rob Kutschke -// - -// Modern CLHEP -#include "CLHEP/Vector/ThreeVector.h" - -// Ancient CLHEP, copied from BaBar -#include "BTrk/BbrGeom/HepPoint.h" - -namespace mu2e { - - inline const HepPoint toHepPoint( const CLHEP::Hep3Vector& v){ - return HepPoint( v.x(), v.y(), v.z()); - } - - inline const CLHEP::Hep3Vector fromHepPoint( const HepPoint& v){ - return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); - } - -} -#endif /* Mu2eUtilities_toHepPoint_hh */ diff --git a/Mu2eUtilities/src/SConscript b/Mu2eUtilities/src/SConscript index f226150ad1..8d9899f0fa 100644 --- a/Mu2eUtilities/src/SConscript +++ b/Mu2eUtilities/src/SConscript @@ -13,7 +13,6 @@ helper=mu2e_helper(env) XERCESC_LIBS = [ 'xerces-c' ] rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_GlobalConstantsService', @@ -25,7 +24,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'mu2e_ConfigTools', 'mu2e_GeneralUtilities', 'mu2e_TrackerGeom', - 'BTrk_BbrGeom', 'gsl', 'art_Persistency_Common', 'art_Persistency_Provenance', @@ -47,7 +45,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', 'cetlib_except', 'hep_concurrency', rootlibs, - babarlibs ] ) # This tells emacs to view this file in python mode. diff --git a/ParticleID/src/SConscript b/ParticleID/src/SConscript index 08773c1616..6297a3b3f2 100644 --- a/ParticleID/src/SConscript +++ b/ParticleID/src/SConscript @@ -9,7 +9,6 @@ import os Import('env') Import('mu2e_helper') -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] helper=mu2e_helper(env); @@ -22,7 +21,6 @@ libs = [ 'mu2e_ConfigTools', 'mu2e_DbTables', 'mu2e_GeneralUtilities', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/Print/src/SConscript b/Print/src/SConscript index 3aaead465b..ba319463cb 100644 --- a/Print/src/SConscript +++ b/Print/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', 'mu2e_ConditionsService', @@ -21,7 +20,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', 'mu2e_GlobalConstantsService', 'mu2e_RecoDataProducts', 'mu2e_DataProducts', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/TEveEventDisplay/src/SConscript b/TEveEventDisplay/src/SConscript index e6f6d72655..512d25daf9 100644 --- a/TEveEventDisplay/src/SConscript +++ b/TEveEventDisplay/src/SConscript @@ -13,13 +13,11 @@ Import('mu2e_helper') helper=mu2e_helper(env) -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] extrarootlibs = [ 'Geom', 'Geom', 'GeomPainter', 'Ged', 'Graf3d', 'Eve','EG', 'RGL','Gui', "Gdml" , "Core", "Rint"] userlibs = [ rootlibs, extrarootlibs, - babarlibs, 'mu2e_DataProducts', 'mu2e_TrkReco', 'mu2e_Mu2eUtilities', diff --git a/Trigger/src/SConscript b/Trigger/src/SConscript index 8fbd563ac5..e987f3848b 100644 --- a/Trigger/src/SConscript +++ b/Trigger/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] extrarootlibs = [ 'Geom', 'TMVA' , 'Minuit' , 'XMLIO' ] @@ -40,7 +39,6 @@ helper.make_plugins( [ mainlib, 'mu2e_DataProducts', 'mu2e_GeneralUtilities', 'mu2e_CaloMC', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/TrkDiag/src/SConscript b/TrkDiag/src/SConscript index 1b5380c0f6..e5eddf114a 100644 --- a/TrkDiag/src/SConscript +++ b/TrkDiag/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'openblas', @@ -29,7 +28,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_GlobalConstantsService', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -79,7 +77,6 @@ helper.make_plugins( [ 'mu2e_GeomPrimitives', 'mu2e_DbService', 'mu2e_DbTables', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -109,10 +106,8 @@ helper.make_plugins( [ 'pthread' ] ) -# Fixme: do I need all of babarlibs below? helper.make_dict_and_map( [ mainlib, - babarlibs, 'art_Persistency_Common', 'art_Utilities', 'canvas', diff --git a/TrkFilters/src/SConscript b/TrkFilters/src/SConscript index 96e835cb69..6e27d8da6d 100644 --- a/TrkFilters/src/SConscript +++ b/TrkFilters/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [] ) # Fixme: split into link lists for each module. @@ -26,7 +25,6 @@ helper.make_plugins( [ mainlib, 'mu2e_GlobalConstantsService', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/TrkPatRec/src/SConscript b/TrkPatRec/src/SConscript index 7af809c0fd..a9d82d857d 100644 --- a/TrkPatRec/src/SConscript +++ b/TrkPatRec/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') extrarootlibs = [ 'TMVA', 'Minuit', 'XMLIO'] -babarlibs = env['BABARLIBS'] rootlibs = env['ROOTLIBS'] helper = mu2e_helper(env) @@ -29,7 +28,6 @@ mainlib = helper.make_mainlib([ 'mu2e_DataProducts', 'mu2e_GeneralUtilities', # 'mu2e_CalPatRec', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -66,7 +64,6 @@ helper.make_plugins([mainlib, 'mu2e_GeomPrimitives', # 'mu2e_CalPatRec', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', diff --git a/TrkReco/src/SConscript b/TrkReco/src/SConscript index 747a438fd2..b247910564 100644 --- a/TrkReco/src/SConscript +++ b/TrkReco/src/SConscript @@ -11,7 +11,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_Mu2eUtilities', @@ -26,7 +25,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_GlobalConstantsService', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -66,7 +64,6 @@ helper.make_plugins( [ 'mu2e_GlobalConstantsService', 'mu2e_DataProducts', 'mu2e_GeneralUtilities', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', @@ -89,19 +86,6 @@ helper.make_plugins( [ 'boost_filesystem', ] ) -# Fixme: do I need all of babarlibs below? -helper.make_dict_and_map( [ - mainlib, - babarlibs, - 'art_Persistency_Common', - 'art_Utilities', - 'canvas', - 'cetlib', - 'cetlib_except', - 'CLHEP', - 'Core', - ] ) - # This tells emacs to view this file in python mode. # Local Variables: diff --git a/Validation/src/SConscript b/Validation/src/SConscript index 5aeb71f3ce..a572a73476 100644 --- a/Validation/src/SConscript +++ b/Validation/src/SConscript @@ -10,7 +10,6 @@ Import('mu2e_helper') helper=mu2e_helper(env) rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] mainlib = helper.make_mainlib ( [ 'mu2e_Validation_root', 'mu2e_Mu2eUtilities', @@ -24,7 +23,6 @@ mainlib = helper.make_mainlib ( [ 'mu2e_Validation_root', 'mu2e_GlobalConstantsService', 'mu2e_GeneralUtilities', 'mu2e_KinKalGeom', - babarlibs, 'art_Framework_Core', 'art_Framework_Principal', 'art_Framework_Services_Registry', From 53bef5d2904cb7c1e29230f7249fe3ac7d9658f7 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 18:04:41 -0800 Subject: [PATCH 101/174] Scons-related fixes --- BTrkLegacy/src/SConscript | 26 ++++++++++++++++++++++++++ CalPatRec/src/SConscript | 2 ++ RecoDataProducts/src/SConscript | 2 ++ 3 files changed, 30 insertions(+) create mode 100644 BTrkLegacy/src/SConscript diff --git a/BTrkLegacy/src/SConscript b/BTrkLegacy/src/SConscript new file mode 100644 index 0000000000..2758478549 --- /dev/null +++ b/BTrkLegacy/src/SConscript @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# +# +# +# Original author Rob Kutschke. +# + +import os, re +Import('env') + +Import('mu2e_helper') + +helper=mu2e_helper(env) + +mainlib = helper.make_mainlib ( [ + ] ) + +helper.make_plugins( [ + mainlib, + ] ) + + +# This tells emacs to view this file in python mode. +# Local Variables: +# mode:python +# End: diff --git a/CalPatRec/src/SConscript b/CalPatRec/src/SConscript index 3794a590ad..108e770ad6 100644 --- a/CalPatRec/src/SConscript +++ b/CalPatRec/src/SConscript @@ -46,6 +46,7 @@ mainlib = helper.make_mainlib( [ 'mu2e_CalPatRec_dict', 'cetlib_except', rootlibs, extrarootlibs, + 'mu2e_BTrkLegacy', 'CLHEP', 'xerces-c', ] ) @@ -81,6 +82,7 @@ helper.make_plugins( [ mainlib, 'fhiclcpp_types', 'cetlib', 'cetlib_except', + 'mu2e_BTrkLegacy', 'CLHEP', rootlibs, extrarootlibs, diff --git a/RecoDataProducts/src/SConscript b/RecoDataProducts/src/SConscript index 2c65258159..62c9fa3b97 100644 --- a/RecoDataProducts/src/SConscript +++ b/RecoDataProducts/src/SConscript @@ -30,6 +30,7 @@ mainlib = helper.make_mainlib ( [ 'mu2e_DataProducts', 'KinKal_General', rootlibs, 'xerces-c', + 'mu2e_BTrkLegacy', 'CLHEP', 'Hist', 'Core', @@ -46,6 +47,7 @@ helper.make_dict_and_map( [ mainlib, 'canvas', 'cetlib', 'cetlib_except', + 'mu2e_BTrkLegacy', 'CLHEP', 'KinKal_Geometry', 'KinKal_Trajectory', From 01d6a0522808802b10550ff78697791c61e11f67 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Sat, 31 Jan 2026 18:16:33 -0800 Subject: [PATCH 102/174] add dependencies --- BTrkLegacy/src/SConscript | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/BTrkLegacy/src/SConscript b/BTrkLegacy/src/SConscript index 2758478549..b5a2aa7065 100644 --- a/BTrkLegacy/src/SConscript +++ b/BTrkLegacy/src/SConscript @@ -12,8 +12,23 @@ Import('mu2e_helper') helper=mu2e_helper(env) +rootlibs = env['ROOTLIBS'] + mainlib = helper.make_mainlib ( [ - ] ) + 'mu2e_GlobalConstantsService', + 'mu2e_DataProducts', + 'art_Framework_Services_Registry', + 'art_Utilities', + 'canvas', + 'fhiclcpp', + 'fhiclcpp_types', + 'tbb', + 'cetlib', + 'cetlib_except', + rootlibs, + 'CLHEP', + + ] ) helper.make_plugins( [ mainlib, From 7ab6dcbad416356090f98e93c682e5d863a5838f Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sun, 1 Feb 2026 13:16:29 -0600 Subject: [PATCH 103/174] Fix min cluster check on calo cluster filter --- .../src/CaloClusterCounterFilter_module.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CaloFilters/src/CaloClusterCounterFilter_module.cc b/CaloFilters/src/CaloClusterCounterFilter_module.cc index 2c3a071c73..c7af5898cf 100644 --- a/CaloFilters/src/CaloClusterCounterFilter_module.cc +++ b/CaloFilters/src/CaloClusterCounterFilter_module.cc @@ -157,13 +157,24 @@ bool CaloClusterCounter::filter(art::Event& event) { (clRadius >= _minClRadius)) { size_t index = std::distance(caloClusters->begin(), icl); triginfo->_caloClusters.push_back(art::Ptr(clH, index)); + if(_diagLevel > 0) std::cout << " --> Accepted cluster\n"; ++nClusterAboveThreshold; - } + } else if(_diagLevel > 1) std::cout << " --> Rejected cluster\n"; + } - if (nClusterAboveThreshold > _minNCl) + if (nClusterAboveThreshold >= _minNCl) { + if(_diagLevel > 0) std::cout << "[CaloClusterCounter::filter] Event " << event.id() + << ": Accepting event, N(accepted clusters) = " << nClusterAboveThreshold + << " from " << caloClusters->size() << " clusters" + << std::endl; retval = true; + } else if(_diagLevel > 1) std::cout << "[CaloClusterCounter::filter] Event " << event.id() + << ": Rejecting event, N(accepted clusters) = " << nClusterAboveThreshold + << " from " << caloClusters->size() << " clusters" + << std::endl; + event.put(std::move(triginfo)); return retval; From 3a9996a6667da9a954c584ce667bd65d801f33af Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Mon, 2 Feb 2026 15:11:55 -0600 Subject: [PATCH 104/174] add CalChannels and CalChannelStatus --- DbService/data/create.sql | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/DbService/data/create.sql b/DbService/data/create.sql index 44b2b52df9..6af1ef1ad2 100644 --- a/DbService/data/create.sql +++ b/DbService/data/create.sql @@ -406,6 +406,29 @@ GRANT INSERT ON crv.time TO crv_role; -- cal schema tables -- +--- reco tables + +CREATE TABLE cal.energycalib + (cid INTEGER, + roid INTEGER, adc2mev NUMERIC, + CONSTRAINT cal_energycalib_pk PRIMARY KEY (cid,roid) ); +GRANT SELECT ON cal.energycalib TO PUBLIC; +GRANT INSERT ON cal.energycalib TO cal_role; + +CREATE TABLE cal.channels + (cid INTEGER, + rawid INTEGER, roid INTEGER, + CONSTRAINT cal_channels_pk PRIMARY KEY (cid,rawid) ); +GRANT SELECT ON cal.channels TO PUBLIC; +GRANT INSERT ON cal.channels TO cal_role; + +CREATE TABLE cal.channelstatus + (cid INTEGER, + roid INTEGER, status TEXT, + CONSTRAINT cal_channelstatus_pk PRIMARY KEY (cid,roid) ); +GRANT SELECT ON cal.channelstatus TO PUBLIC; +GRANT INSERT ON cal.channelstatus TO cal_role; + --- archive and adhoc tables CREATE TABLE cal.cosmicenergycalib @@ -425,10 +448,4 @@ CREATE TABLE cal.cosmicenergycalibinfo GRANT SELECT ON cal.cosmicenergycalibinfo TO PUBLIC; GRANT INSERT ON cal.cosmicenergycalibinfo TO cal_role; -CREATE TABLE cal.energycalib - (cid INTEGER, - roid INTEGER, adc2mev NUMERIC, - CONSTRAINT cal_energycalib_pk PRIMARY KEY (cid,roid) ); -GRANT SELECT ON cal.energycalib TO PUBLIC; -GRANT INSERT ON cal.energycalib TO cal_role; From b3e0fa4005e0377055aab026d2d8a8633848e01b Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Mon, 2 Feb 2026 15:12:12 -0600 Subject: [PATCH 105/174] add CalChannelStatus --- DbTables/src/DbTableFactory.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DbTables/src/DbTableFactory.cc b/DbTables/src/DbTableFactory.cc index b8576e4d2b..f49459c491 100644 --- a/DbTables/src/DbTableFactory.cc +++ b/DbTables/src/DbTableFactory.cc @@ -10,6 +10,7 @@ #include "Offline/DbTables/inc/SimEfficiencies2.hh" #include "Offline/DbTables/inc/CalChannels.hh" +#include "Offline/DbTables/inc/CalChannelStatus.hh" #include "Offline/DbTables/inc/CalSourceEnergyCalib.hh" #include "Offline/DbTables/inc/CalCosmicEnergyCalib.hh" #include "Offline/DbTables/inc/CalCosmicEnergyCalibInfo.hh" @@ -97,6 +98,8 @@ mu2e::DbTable::ptr_t mu2e::DbTableFactory::newTable(std::string const& name) { return std::shared_ptr(new mu2e::CRVTime()); } else if (name=="CalChannels") { return std::shared_ptr(new mu2e::CalChannels()); + } else if (name=="CalChannelStatus") { + return std::shared_ptr(new mu2e::CalChannelStatus()); } else if (name=="CalSourceEnergyCalib") { return std::shared_ptr(new mu2e::CalSourceEnergyCalib()); } else if (name=="CalCosmicEnergyCalib") { From 3fbf2a5592c490d2931dfac5205558329a0b11d8 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 15:29:34 -0800 Subject: [PATCH 106/174] Re-remove deleted files which git conflict resolution put back in --- Analyses/src/ReadCaloDigi_module.cc | 868 ---------------------- Analyses/src/ReadTrkExtrapolMVA_module.cc | 178 ----- Analyses/src/ReadTrkExtrapol_module.cc | 230 ------ 3 files changed, 1276 deletions(-) delete mode 100644 Analyses/src/ReadCaloDigi_module.cc delete mode 100644 Analyses/src/ReadTrkExtrapolMVA_module.cc delete mode 100644 Analyses/src/ReadTrkExtrapol_module.cc diff --git a/Analyses/src/ReadCaloDigi_module.cc b/Analyses/src/ReadCaloDigi_module.cc deleted file mode 100644 index 519dd8fe9d..0000000000 --- a/Analyses/src/ReadCaloDigi_module.cc +++ /dev/null @@ -1,868 +0,0 @@ -// -// An EDAnalyzer module that reads back the hits created by the Calorimeter Digitization chain -// -// Original author - -// ROOT includes -#include "TH1F.h" -#include "TF1.h" -#include "TSpline.h" -#include "TFile.h" -// #include "CalPatRec/inc/THackData.hh" -#include "TROOT.h" -#include "TFolder.h" -#include "TTree.h" -#include "TH2F.h" - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art_root_io/TFileDirectory.h" -#include "messagefacility/MessageLogger/MessageLogger.h" -#include "art/Framework/Services/Optional/RandomNumberGenerator.h" -#include "art/Framework/Services/Registry/ServiceDefinitionMacros.h" - -// Mu2e includes. -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" -#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" -#include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" -#include "Offline/DataProducts/inc/CaloSiPMId.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/SeedService/inc/SeedService.hh" - -#include "Offline/RecoDataProducts/inc/CaloRecoDigi.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StatusG4.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/GenId.hh" -#include "Offline/MCDataProducts/inc/CaloHitMC.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" - -#include "Offline/DataProducts/inc/PDGCode.hh" - -#include "CLHEP/Random/RandPoisson.h" -#include "CLHEP/Random/RandGaussQ.h" - -#include -#include -#include -#include -#include -#include - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkRep.hh" - -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalHit.hh" - -//#include "TrkReco/inc/TrkStrawHit.hh" -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/BbrGeom/TrkLineTraj.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/HelixTraj.hh" - -using namespace std; - -using CLHEP::Hep3Vector; -using CLHEP::keV; - -namespace mu2e { - struct DAQ_t { - TH1F* _hNCaloDigi [10]; - TH1F* _hNSamplesPerDigi [10]; - TH1F* _hNSamplesPerEvent[10]; - - TH2F* _hNSamplesVsRadius[10]; - TH2F* _hNHitsVsRadius [10]; - }; - - class ReadCaloDigi : public art::EDAnalyzer { - - public: - - explicit ReadCaloDigi(fhicl::ParameterSet const& pset); - virtual ~ReadCaloDigi() { } - - virtual void beginRun(art::Run const& ) override; - - virtual void beginJob() override; - virtual void endJob() override ; - - // This is called for each event. - virtual void analyze(const art::Event& e) override; - - private: - - typedef std::vector< art::Handle > StepMCHandleVector; - typedef art::Ptr CaloHitPtr; - - void initVHits (); - - int _diagLevel; - - std::string _caloDigisModuleLabel; - std::string _caloCrystalModuleLabel; - std::string _stepPoints; - std::string _rostepPoints; - std::string _caloClusterModuleLabel; - std::string _vdStepPoints; - std::string _trackModuleLabel; - - std::string _instanceName; - TrkParticle _tpart; - TrkFitDirection _fdir; - - double _mbtime; - double _mbbuffer; - double _blindTime; - - int _fillWaveforms; - double _psdThreshold; - double _caloRmin; - - TTree* _Ntup; - DAQ_t _histDisk0; - DAQ_t _histDisk1; - TH2F* _hNSamplesVsCrysId[10]; - - int _nProcess; - - int _evt,_run,_caloCrystals,_caloDisk0Crystals,_caloDisk1Crystals,_nHits,_nCluster, _nCryRO; - - int _nRecoDigi, _recoDigiSamples[16384]; - float _recoDigiAmp[16384], _recoDigiEnergy[16384], _recoDigiTime[16384]; - - int _recoDigiId[16384]; - float _recoDigiT0[16384]; - float _recoDigiX[16384], _recoDigiY[16384], _recoDigiZ[16384]; - float _recoDigiPulse[10000][350]; - - int _cryId[16384],_crySectionId[16384]; - - int _cluNcrys[204828]; - - float _caloVolume, _crystalVolume; - - float _cryEtot,_cryTime[16384],_cryEdep[16384], _cryAmp[16384], _cryDose[16384]; - float _cryMCTime [16384]; - float _cryMCEdep [16384]; - int _cryNParticles[16384]; - float _cryPsd [16384]; - float _cryIsConv [16384]; - - float _cryPosX[16384],_cryPosY[16384],_cryPosZ[16384], _cryPosR[16384]; - - float _cluEnergy[2048], _cluCrysE[2048], _cluMeanTime[2048],_cluTime[2048], _cluMCTime[2048], _cluMCMeanTime[2048]; - float _cluCogX[2048],_cluCogY[2048],_cluCogZ[2048], _cluCogR[2048]; - - int _cluConv[2048]; - - Int_t _vNHits; - Float_t _vP[2048], _vPx[2048], _vPy[2048], _vPz[2048], _vPt[2048]; - Float_t _vE[2048], _vEKin[2048], _vM[2048]; - Float_t _vT[2048]; - Float_t _vX[2048], _vY[2048], _vZ[2048], _vR[2048]; - Float_t _vCosth[2048], _vRadius[2048]; - Int_t _vId[2048]; - Int_t _vPdgId[2048]; - - Int_t _nTrkGood; - - //some histograms for DAQ analyses purposes - - const Calorimeter* _calorimeter; // cached pointer to the calorimeter geometry - - }; - - void ReadCaloDigi::initVHits(){ - - _vNHits = 0; - - // _vP = 0.; - // _vPx = 0.; - // _vPy = 0.; - // _vPz = 0.; - // _vPt = 0.; - // _vPdgId = 0.; - // _vM = 0.; - // _vE = 0.; - // _vEKin = 0.; - // _vT = 0.; - // _vX = 0.; - // _vY = 0.; - // _vZ = 0.; - // _vR = 0.; - - // _vCosth = 0.; - // _vRadius = 0.; - // _vId = 0.; - } - - ReadCaloDigi::ReadCaloDigi(fhicl::ParameterSet const& pset) : - art::EDAnalyzer(pset), - _diagLevel (pset.get ("diagLevel")), - _caloDigisModuleLabel (pset.get("caloDigisModuleLabel")), - _caloCrystalModuleLabel (pset.get("caloCrystalModuleLabel")), - _stepPoints (pset.get("calorimeterStepPoints")), - _rostepPoints (pset.get("calorimeterROStepPoints")), - _caloClusterModuleLabel (pset.get("caloClusterModuleLabel")), - _vdStepPoints (pset.get("vdStepPoints")), - _trackModuleLabel (pset.get("trackModuleLabel")), - _tpart ((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _mbbuffer (pset.get ("TimeFoldingBuffer")), // ns - _blindTime (pset.get ("blindTime" )), // ns - _fillWaveforms (pset.get ("fillWaveforms" )), - _psdThreshold (pset.get("psdThreshold")), - _caloRmin (pset.get("caloRmin" )), - _Ntup(0),_nProcess(0) - { - _instanceName = _fdir.name() + _tpart.name(); - } - - void ReadCaloDigi::beginRun(art::Run const& ){ - mu2e::GeomHandle ch; - _calorimeter = ch.get(); - } - void ReadCaloDigi::beginJob(){ - - art::ServiceHandle tfs; - art::TFileDirectory tfdir = tfs->mkdir("diag"); - - for (int i=0; i<10; ++i){ - _histDisk0._hNCaloDigi [i] = tfdir.make(Form("hNHitsDisk0%i",i) , - Form("Disk0: N caloDigis @ %i MeV threshold",i+1), 1e4, 0, 1e4); - _histDisk0._hNSamplesPerDigi [i] = tfdir.make(Form("hNSampleHitsDisk0%i",i), - Form("Disk0: N of words per caloDigi @ %i MeV threshold",i+1), - 1e4, 0, 1e4); - _histDisk0._hNSamplesPerEvent [i] = tfdir.make(Form("hNSampleDisk0%i",i), - Form("Disk0: N of words per event @ %i MeV threshold",i+1), - 5e4, 0, 5e4); - _histDisk1._hNCaloDigi [i] = tfdir.make(Form("hNHitsDisk1%i",i) , - Form("Disk1: N caloDigis @ %i MeV threshold",i+1), 1e4, 0, 1e4); - _histDisk1._hNSamplesPerDigi [i] = tfdir.make(Form("hNSampleHitsDisk1%i",i), - Form("Disk1: N of words per caloDigi @ %i MeV threshold",i+1), - 1e4, 0, 1e4); - _histDisk1._hNSamplesPerEvent [i] = tfdir.make(Form("hNSampleDisk1%i",i), - Form("Disk1: N of words per event @ %i MeV threshold",i+1), - 5e4, 0, 5e4); - _hNSamplesVsCrysId [i] = tfdir.make(Form("hNSamplesVsCrysId%i",i), - Form("N of words per event vs crystal Id @ %i MeV threshold",i+1), - 2000, 0, 2e3, 600, 0, 600); - - _histDisk0._hNSamplesVsRadius [i] = tfdir.make(Form("hNSamplesVsRadiusDisk0%i",i), - "N of words per event vs radius on disk 0", - 80, 300, 700, 300, 0, 300); - _histDisk0._hNHitsVsRadius [i] = tfdir.make(Form("hNHitsVsRadiusDisk0%i",i), - "N of hits per event vs radius on disk 0", - 80, 300, 700, 2000, 0, 2000); - - _histDisk1._hNSamplesVsRadius [i] = tfdir.make(Form("hNSamplesVsRadiusDisk1%i", i), - "N of words per event vs radius on disk 0", - 80, 300, 700, 300, 0, 300); - _histDisk1._hNHitsVsRadius [i] = tfdir.make(Form("hNHitsVsRadiusDisk1%i", i), - "N of hits per event vs radius on disk 0", - 80, 300, 700, 2000, 0, 2000); - } - - _Ntup = tfs->make("Calo", "Calo"); - - _Ntup->Branch("evt", &_evt , "evt/I"); - _Ntup->Branch("run", &_run , "run/I"); - _Ntup->Branch("caloCrystals", &_caloCrystals ,"caloCrystals/I"); - _Ntup->Branch("caloDisk0Crystals", &_caloDisk0Crystals ,"caloDisk0Crystals/I"); - _Ntup->Branch("caloDisk1Crystals", &_caloDisk1Crystals ,"caloDisk1Crystals/I"); - - _Ntup->Branch("nRecoDigi", &_nRecoDigi , "nRecoDigi/I"); - _Ntup->Branch("recoDigiEnergy", &_recoDigiEnergy , "recoDigiEnergy[nRecoDigi]/F"); - _Ntup->Branch("recoDigiAmp", &_recoDigiAmp, "recoDigiAmp[nRecoDigi]/F"); - _Ntup->Branch("recoDigiTime" , &_recoDigiTime, "recoDigiTime[nRecoDigi]/F"); - _Ntup->Branch("recoDigiSamples", &_recoDigiSamples, "recoDigiSamples[nRecoDigi]/I"); - _Ntup->Branch("recoDigiId" , &_recoDigiId , "recoDigiId[nRecoDigi]/I"); - _Ntup->Branch("recoDigiT0" , &_recoDigiT0 , "recoDigiT0[nRecoDigi]/F"); - _Ntup->Branch("recoDigiX" , &_recoDigiX , "recoDigiX[nRecoDigi]/F"); - _Ntup->Branch("recoDigiY" , &_recoDigiY , "recoDigiY[nRecoDigi]/F"); - _Ntup->Branch("recoDigiZ" , &_recoDigiZ , "recoDigiZ[nRecoDigi]/F"); - _Ntup->Branch("recoDigiPulse" , &_recoDigiPulse , "recoDigiPulse[nRecoDigi][350]/F"); - - _Ntup->Branch("cryEtot", &_cryEtot , "cryEtot/F"); - - _Ntup->Branch("nCry", &_nHits , "nCry/I"); - _Ntup->Branch("cryId", &_cryId , "cryId[nCry]/I"); - _Ntup->Branch("crySectionId", &_crySectionId, "crySectionId[nCry]/I"); - _Ntup->Branch("cryPosX", &_cryPosX , "cryPosX[nCry]/F"); - _Ntup->Branch("cryPosY", &_cryPosY , "cryPosY[nCry]/F"); - _Ntup->Branch("cryPosZ", &_cryPosZ , "cryPosZ[nCry]/F"); - _Ntup->Branch("cryPosR", &_cryPosR , "cryPosR[nCry]/F"); - _Ntup->Branch("cryEdep", &_cryEdep , "cryEdep[nCry]/F"); - _Ntup->Branch("cryAmp", &_cryAmp , "cryAmp[nCry]/F"); - _Ntup->Branch("cryTime", &_cryTime , "cryTime[nCry]/F"); - _Ntup->Branch("cryMCTime", &_cryMCTime ,"cryMCTime[nCry]/F"); - _Ntup->Branch("cryMCEdep", &_cryMCEdep ,"cryMCEdep[nCry]/F"); - _Ntup->Branch("cryNParticles",&_cryNParticles,"cryNParticles[nCry]/I"); - _Ntup->Branch("cryPsd", &_cryPsd ,"cryPsd[nCry]/F"); - _Ntup->Branch("cryIsConv", &_cryIsConv ,"cryIsConv[nCry]/I"); - _Ntup->Branch("nCluster", &_nCluster , "nCluster/I"); - _Ntup->Branch("cluEnergy", &_cluEnergy , "cluEnergy[nCluster]/F"); - _Ntup->Branch("cluCrysE", &_cluCrysE , "cluCrysE[nCluster]/F"); - _Ntup->Branch("cluTime", &_cluTime , "cluTime[nCluster]/F"); - _Ntup->Branch("cluMeanTime", &_cluMeanTime , "cluMeanTime[nCluster]/F"); - _Ntup->Branch("cluMCTime", &_cluMCTime , "cluMCTime[nCluster]/F"); - _Ntup->Branch("cluMCMeanTime", &_cluMCMeanTime , "cluMCMeanTime[nCluster]/F"); - _Ntup->Branch("cluCogX", &_cluCogX , "cluCogX[nCluster]/F"); - _Ntup->Branch("cluCogY", &_cluCogY , "cluCogY[nCluster]/F"); - _Ntup->Branch("cluCogZ", &_cluCogZ , "cluCogZ[nCluster]/F"); - _Ntup->Branch("cluCogR", &_cluCogR , "cluCogR[nCluster]/F"); - _Ntup->Branch("cluNcrys", &_cluNcrys , "cluNCrys[nCluster]/I"); - _Ntup->Branch("cluConv", &_cluConv , "cluConv[nCluster]/I"); - - _Ntup->Branch("vNHits", &_vNHits , "vNHits/I"); - _Ntup->Branch("vId" , &_vId , "vId[vNHits]/I"); - _Ntup->Branch("vPdgId", &_vPdgId , "vPdgId[vNHits]/I"); - _Ntup->Branch("vP" , &_vP , "vP[vNHits]/F"); - _Ntup->Branch("vPx", &_vPx , "vPx[vNHits]/F"); - _Ntup->Branch("vPy", &_vPy , "vPy[vNHits]/F"); - _Ntup->Branch("vPz", &_vPz , "vPz[vNHits]/F"); - _Ntup->Branch("vE" , &_vE , "vE[vNHits]/F"); - _Ntup->Branch("vEKin", &_vEKin , "vEKin[vNHits]/F"); - _Ntup->Branch("vM", &_vM , "vM[vNHits]/F"); - _Ntup->Branch("vT", &_vT , "vT[vNHits]/F"); - _Ntup->Branch("vX", &_vX , "vX[vNHits]/F"); - _Ntup->Branch("vY", &_vY , "vY[vNHits]/F"); - _Ntup->Branch("vZ", &_vZ , "vZ[vNHits]/F"); - _Ntup->Branch("vR", &_vR , "vR[vNHits]/F"); - _Ntup->Branch("vCosth", &_vCosth , "vCosth[vNHits]/F"); - _Ntup->Branch("vRadius", &_vRadius, "vRadius[vNHits]/F"); - - _Ntup->Branch("nTrkGood",&_nTrkGood , "nTrkGood/I"); - - } - - void ReadCaloDigi::endJob(){ - } - - void ReadCaloDigi::analyze(const art::Event& event) { - // if (_nProcess == 0){ - mu2e::GeomHandle ch; - _calorimeter = ch.get(); - // } - - ++_nProcess; - - //load the timeoffset - _mbtime = GlobalConstantsHandle()->getNominalDRPeriod(); - - //data about hits in the calorimeter crystals - art::Handle caloDigiMCHandle; - event.getByLabel(_caloDigisModuleLabel, caloDigiMCHandle); - - const CaloHitMCCollection* caloDigiMCCol(0); - int nCaloHitMC(0); - if (caloDigiMCHandle.isValid()){ - caloDigiMCCol = caloDigiMCHandle.product(); - nCaloHitMC = caloDigiMCCol->size(); - } - - art::Handle recoCaloDigiHandle; - event.getByLabel(_caloDigisModuleLabel, recoCaloDigiHandle); - - const CaloRecoDigiCollection* recoCaloDigiCol(0); - int nCaloRecoDigi(0); - if (recoCaloDigiHandle.isValid()){ - recoCaloDigiCol = recoCaloDigiHandle.product(); - nCaloRecoDigi = recoCaloDigiCol->size(); - } - - int nCaloCrystals(0); - const CaloHitCollection* CaloHits(0); - art::Handle CaloHitsHandle; - event.getByLabel(_caloCrystalModuleLabel, CaloHitsHandle); - if (!CaloHitsHandle.isValid()){ - // printf("[ReadCaloDigi::analyze] no CaloHitCollection: BAILS OUT \n"); - nCaloCrystals = 0; - }else { - CaloHits = CaloHitsHandle.product(); - nCaloCrystals = CaloHits->size(); - } - - //data about clusters - art::Handle caloClustersHandle; - const CaloClusterCollection* caloClusters(0); - int nCaloClusters(0); - event.getByLabel(_caloClusterModuleLabel, caloClustersHandle); - if (caloClustersHandle.isValid()){ - caloClusters = caloClustersHandle.product(); - nCaloClusters = caloClusters->size(); - } - - //Handle to VD steps - art::ProductInstanceNameSelector selector_vdhits("virtualdetector"); - art::Handle *vdStepsHandle; - const StepPointMCCollection *vdHits; - StepMCHandleVector vdStepsHandleVec = event.getMany(selector_vdhits); - - //Handle to tracks collection - art::Handle dem_handle; - // art::Selector s_dem(art::ProcessNameSelector("") && - // art::ModuleLabelSelector(_trackModuleLabel) ); - // art::Selector s_dem (art::ProductInstanceNameSelector("") && - // art::ProcessNameSelector("") && - // art::ModuleLabelSelector(_trackModuleLabel) ); - // fEvent->get(selector,krepsHandle); - event.getByLabel(_trackModuleLabel, _instanceName, dem_handle); - // event.get(s_dem,dem_handle); - - int nTraks(0); - const mu2e::KalRepCollection* list_of_ele_tracks = nullptr; - - if (dem_handle.isValid()) { - list_of_ele_tracks = dem_handle.product(); - nTraks = list_of_ele_tracks->size(); - } - - GlobalConstantsHandle pdt; - - _evt = event.id().event(); - _run = event.run(); - _caloCrystals = _calorimeter->nCrystals(); - _caloDisk0Crystals = _calorimeter->disk(0).nCrystals(); - _caloDisk1Crystals = _calorimeter->disk(1).nCrystals(); - _nTrkGood = 0; - - //-------------------------------------------------------------------------------- - if (nTraks>0){ - double fMinFitCons = 2.e-3; - double fMinNActive = 25; - double fMaxT0Err = 0.9; // in ns - double fMaxFitMomErr = 0.25; // in MeV - double fMinTanDip = tan(M_PI/6.); // 0.5773 - double fMaxTanDip = 1.0; - double fMinD1 = -80.; // in mm - double fMaxD1 = 105.; - double fTrkMomCut = 100.; //MeV/c - - KalRep *trk; - - trk = (KalRep*) &list_of_ele_tracks->at(0); - CLHEP::Hep3Vector mom = trk->momentum(0); - - BbrVectorErr momerr = trk->momentumErr(0); - - CLHEP::Hep3Vector momdir = trk->momentum(0).unit(); - CLHEP::HepVector momvec(3); - for (int i=0; i<3; i++) momvec[i] = momdir[i]; - - double fitmom_err = sqrt(momerr.covMatrix().similarity(momvec)); - - if ( (trk->chisqConsistency().consistency() > fMinFitCons ) && - (trk->nActive() > fMinNActive ) && - (trk->t0().t0Err() < fMaxT0Err ) && - (fitmom_err < fMaxFitMomErr) && - (trk->helix(0).tanDip() > fMinTanDip ) && - (trk->helix(0).tanDip() < fMaxTanDip ) && - (trk->helix(0).d0() < fMaxD1 ) && - (trk->helix(0).d0() > fMinD1 ) && - (mom.mag() > fTrkMomCut )){ - - _nTrkGood = 1; - } - } - //-------------------------------------------------------------------------------- - - int vdVecSize = vdStepsHandleVec.size(); - initVHits(); - - // double timeLastHit(1e10); - // double timeLastHit(0); - - for (int j=0; j< vdVecSize; ++j){ - vdStepsHandle = & vdStepsHandleVec[j]; - if (vdStepsHandle->isValid()) { - vdHits = vdStepsHandle->operator->(); - - for (size_t i=0; isize(); ++i) { - StepPointMC hit = vdHits->at(i); - - if (hit.simParticle()->fromGenerator()) { - int id = hit.volumeId(); - - if (id == VirtualDetectorId::EMC_Disk_0_SurfIn || - id == VirtualDetectorId::EMC_Disk_1_SurfIn || - id == VirtualDetectorId::EMC_Disk_0_EdgeIn || - id == VirtualDetectorId::EMC_Disk_1_EdgeIn ) { - - art::Ptr const& simptr = hit.simParticle(); - //2016-01-10 G. PEzzullo temporary comment for using - // a custom made gen particle - - SimParticle const& sim = *simptr; - - if ( sim.fromGenerator() ){ - - GenParticle* gen = (GenParticle*) &(*sim.genParticle()); - if ( gen->generatorId().isConversion() ){ - continue; - } - } - if ( !sim.fromGenerator() ) continue; - - double hitTime = fmod(hit.time(), _mbtime); - if (hitTime < _mbbuffer) { - if (hitTime+_mbtime > _blindTime) { - hitTime = hitTime + _mbtime; - } - } - else { - if (hitTime > (_mbtime - _mbbuffer)) { - if (hitTime - _mbtime > _blindTime) { - hitTime = hitTime - _mbtime; - } - } - } - - // if (hitTime > timeLastHit) continue; - // if (hitTime < timeLastHit) continue; - - // timeLastHit = hitTime; - - _vT [_vNHits] = hitTime; - - _vP [_vNHits] = hit.momentum().mag(); - _vPx [_vNHits] = hit.momentum().x(); - _vPy [_vNHits] = hit.momentum().y(); - _vPz [_vNHits] = hit.momentum().z(); - _vPt [_vNHits] = std::sqrt( std::pow(_vPx[_vNHits],2.)+std::pow(_vPy[_vNHits],2.) ); - _vPdgId[_vNHits] = hit.simParticle()->pdgId(); - _vM [_vNHits] = pdt->particle(_vPdgId[_vNHits]).mass(); - _vE [_vNHits] = sqrt(_vP[_vNHits]*_vP[_vNHits] + _vM[_vNHits]*_vM[_vNHits]); - _vEKin [_vNHits] = _vE[_vNHits] - _vM[_vNHits]; - - _vX [_vNHits] = hit.position().x()+3904.; - _vY [_vNHits] = hit.position().y(); - _vZ [_vNHits] = hit.position().z(); - _vR [_vNHits] = sqrt(_vX[_vNHits]*_vX[_vNHits] + _vY[_vNHits]*_vY[_vNHits]); - - _vCosth [_vNHits] = _vPz[_vNHits]/_vP[_vNHits]; - _vRadius[_vNHits] = std::sqrt(_vX[_vNHits]*_vX[_vNHits]+_vY[_vNHits]*_vY[_vNHits]); - _vId [_vNHits] = id; - - ++_vNHits; - } - } - } - } - } - - _nHits = 0; - _cryEtot = 0.0; - - //some helper variables - const CaloCluster *cluster; - const std::vector *crystals; - const CaloHit *crystalHit; - const CaloRecoDigi *recoDigi; - // const CaloDigi *caloDigi; - const CaloHitMC *caloDigiMC(0); - const SimParticle *sim; - - //fill DAQ histograms - double amplitude(0); - int roId(0), crystalID(0), diskId(0); - - int nThresholds(10), nWords(0); - int disk0NCaloDigi [10] = {0}; - int disk1NCaloDigi [10] = {0}; - int disk0NSamplesPerEvent[10] = {0}; - int disk1NSamplesPerEvent[10] = {0}; - double thresholds [10] = {1., 2., 3, 4., 5., 6, 7, 8, 9, 10}; - // double ADC2mV = 2000./pow(2.,12); - double radius(0); - - //2016-01-27 G. Pezzullo conversion from thresholds given in MeV to mV - double p1(21.65);//for the pulse wfInput =2 - // double p1(14.76);//for the pulse wfInput =3 - - for(int i=0; i nWordsCrystals(ncrystals,0); - - std::vector pulse; - CLHEP::Hep3Vector crystalPos(0); - int nROs = _caloCrystals*2; - - double nWorsRO [10][4000]; - double radiusRO [10][4000]; - double diskIdRO [10][4000]; - int nHitsRO [10][4000]; - for (int i=0;iat(i); - //amplitude = recoDigi->amplitude()*ADC2mV; - roId = recoDigi->SiPMID(); - crystalID = CaloSiPMId(roId).crystal().id(); - diskId = _calorimeter->crystal(crystalID).diskID(); - - crystalPos = _calorimeter->geomUtil().mu2eToDiskFF(diskId,_calorimeter->crystal(crystalID).position()); - radius = sqrt(crystalPos.x()*crystalPos.x() + crystalPos.y()*crystalPos.y()); - - if (radius < _caloRmin) continue; - - _recoDigiEnergy[i] = recoDigi->energyDep(); - - const CaloDigi& caloDigi = *recoDigi->caloDigiPtr(); - - pulse = caloDigi.waveform(); - nWords = pulse.size(); - //get the amplitude - for (int j=0; j amplitude) amplitude = content; - } - _recoDigiAmp [i] = amplitude; - - _recoDigiSamples [i] = nWords; - _recoDigiId [i] = roId; - _recoDigiT0 [i] = caloDigi.t0(); - _recoDigiX [i] = crystalPos.x(); - _recoDigiY [i] = crystalPos.y(); - _recoDigiZ [i] = diskId; - _recoDigiTime [i] = recoDigi->time(); - - if (_fillWaveforms == 1){ - for (int j=0; j thresholds[k]){ - nWorsRO [k][roId] += nWords; - radiusRO [k][roId] = radius; - diskIdRO [k][roId] = diskId; - nHitsRO [k][roId] += 1; - - if (diskId ==0){ - disk0NCaloDigi[k] = disk0NCaloDigi[k] + 1; - disk0NSamplesPerEvent[k] = disk0NSamplesPerEvent[k] + nWords ; - _histDisk0._hNSamplesPerDigi [k]->Fill(nWords); - }else if (diskId == 1){ - disk1NCaloDigi[k] = disk1NCaloDigi[k] + 1; - disk1NSamplesPerEvent[k] = disk1NSamplesPerEvent[k] + nWords ; - _histDisk1._hNSamplesPerDigi [k]->Fill(nWords); - } - } - }//end loop on the thresholds - - } - - for (int k=0; kFill(disk0NCaloDigi [k]); - _histDisk0._hNSamplesPerEvent[k]->Fill(disk0NSamplesPerEvent[k]); - - _histDisk1._hNCaloDigi [k]->Fill(disk1NCaloDigi [k]); - _histDisk1._hNSamplesPerEvent[k]->Fill(disk1NSamplesPerEvent[k]); - - double content(0); - - for (int i=0; i 0){ - if ( diskIdRO[k][i] == 0){ - _histDisk0._hNSamplesVsRadius[k]->Fill(radius, content); - _histDisk0._hNHitsVsRadius [k]->Fill(radius, nHitsRO[k][i]); - }else { - _histDisk1._hNSamplesVsRadius[k]->Fill(radius, content); - _histDisk1._hNHitsVsRadius [k]->Fill(radius, nHitsRO[k][i]); - } - } - } - - for (int j=0; j 0){ - _hNSamplesVsCrysId[k]->Fill(j, nWordsCrystals[j]); - } - } - - } - - for (int ic=0; icat(ic); - CLHEP::Hep3Vector crystalPos = _calorimeter->geomUtil().mu2eToDiskFF(diskId,_calorimeter->crystal(crystalID).position()); - - _cryEtot += hit.energyDep(); - _cryTime[_nHits] = hit.time(); - _cryEdep[_nHits] = hit.energyDep(); - - _cryPosX[_nHits] = crystalPos.x(); - _cryPosY[_nHits] = crystalPos.y(); - _cryPosZ[_nHits] = crystalPos.z(); - _cryPosR[_nHits] = sqrt( _cryPosX[_nHits]*_cryPosX[_nHits] + crystalPos.y()*crystalPos.y() ); - _cryId[_nHits] = hit.crystalID(); - _crySectionId[_nHits] = _calorimeter->crystal(hit.crystalID()).diskID(); - - int indexMC, nParticles(0); - int isConversion(0); - - recoDigi = hit.recoCaloDigis().at(0).operator ->(); - //_cryAmp [_nHits] = recoDigi->amplitude(); - - indexMC = 0;//caloDigi.index(); - - if (nCaloHitMC > 0) { - caloDigiMC = &caloDigiMCCol->at(indexMC); - - for (unsigned k=0; knParticles(); ++k){ - sim = caloDigiMC->energyDeposit(k).sim().operator ->(); - // if ( sim->fromGenerator() ){ - const CLHEP::Hep3Vector genPos = sim->startPosition(); - - // if (!_calorimeter->isInsideCalorimeter(genPos)){ - // ++nParticles; - - // int pdgId = sim->pdgId(); - // double ceEnergy = 104.9; - // double startEnergy = sim->startMomentum().e(); - // if ( (pdgId == 11) && (startEnergy>ceEnergy)) - // { - // isConversion = 1; - // } - // } - }//end loop on the particles inside the crystalHit - - _cryMCTime [_nHits] = caloDigiMC->time(); - _cryMCEdep [_nHits] = caloDigiMC->totalEnergyDep(); - } else { - _cryMCTime [_nHits] = 0; - _cryMCEdep [_nHits] = 0; - } - _cryNParticles[_nHits] = nParticles; - //_cryPsd [_nHits] = recoDigi->psd(); - _cryIsConv [_nHits] = isConversion; - - ++_nHits; - } - - _nCluster = nCaloClusters;//caloClusters->size(); - - for (int i=0; i<_nCluster; ++i){ - cluster = &caloClusters->at(i); - - crystals = &cluster->caloHitsPtrVector(); - - int nCrystals = crystals->size(); - int indexMC; - int isConversion(0); - - double energyMax(0), eMeanTot(0), clusterTime(0), clusterMCMeanTime(0), clusterMeanTime(0), clusterMCTime(0), eDep, psd, crystalTime(0); - - for (int j=0; jat(j).operator ->(); - recoDigi = crystalHit->recoCaloDigis().at(0).operator ->(); - - indexMC = 0;//caloDigi.index(); - - eDep = crystalHit->energyDep(); - psd = 0;//recoDigi ->psd(); - - if (psd >= _psdThreshold){ - crystalTime = crystalHit->time(); - - if (eDep> 10.){ - eMeanTot += eDep; - clusterMeanTime += crystalTime*eDep; - } - - if (eDep > energyMax){ - clusterTime = crystalTime; - energyMax = eDep; - - if (nCaloHitMC > 0) { - caloDigiMC = &caloDigiMCCol->at(indexMC); - clusterMCMeanTime = caloDigiMC->time(); - clusterMCTime = caloDigiMC->time(); - } - } - } - - if (nCaloHitMC > 0) { - - for (unsigned k=0; knParticles(); ++k){ - sim = caloDigiMC->energyDeposit(k).sim().operator ->(); - int pdgId = sim->pdgId(); - double ceEnergy = 104.9; - double startEnergy = sim->startMomentum().e(); - if ( (pdgId == PDGCode::e_minus) && (startEnergy>ceEnergy)) - { - isConversion = 1; - } - // if ( sim->fromGenerator() ){ - // GenParticle* gen = (GenParticle*) &(sim->genParticle()); - // if ( gen->generatorId().isConversion() ){ - // isConversion = 1; - // } - // } - }//end loop on the particles inside the crystalHit - } - } - if (eMeanTot>0){ - clusterMeanTime /= eMeanTot; - } - - _cluEnergy [i] = cluster->energyDep(); - _cluTime [i] = clusterTime; - _cluMeanTime [i] = clusterMeanTime; - _cluMCTime [i] = clusterMCTime; - _cluMCMeanTime[i] = clusterMCMeanTime; - _cluCrysE [i] = energyMax; - _cluNcrys [i] = nCrystals; - _cluCogX [i] = cluster->cog3Vector().x(); - _cluCogY [i] = cluster->cog3Vector().y(); - _cluCogR [i] = sqrt(_cluCogX[i]*_cluCogX[i] + _cluCogY[i]*_cluCogY[i]); - _cluCogZ [i] = cluster->diskID();//cog3Vector().z(); - _cluConv [i] = isConversion; - - }//end filling calo clusters info - - _Ntup->Fill(); - } -} // end namespace mu2e - -DEFINE_ART_MODULE(mu2e::ReadCaloDigi) diff --git a/Analyses/src/ReadTrkExtrapolMVA_module.cc b/Analyses/src/ReadTrkExtrapolMVA_module.cc deleted file mode 100644 index 8ad643e2df..0000000000 --- a/Analyses/src/ReadTrkExtrapolMVA_module.cc +++ /dev/null @@ -1,178 +0,0 @@ -// -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -//root includes -#include "TFile.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" - - -using namespace std; - -namespace mu2e { - - - class ReadTrkExtrapolMVA : public art::EDAnalyzer { - - public: - - explicit ReadTrkExtrapolMVA(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel",0)), - _trkExtrapolModuleLabel(pset.get("trkExtrapolModuleLabel")), - _Ntup(0) - {} - - virtual ~ReadTrkExtrapolMVA() {} - - void beginJob(); - void endJob() {} - - void analyze(art::Event const& event ); - - - - private: - - int _diagLevel; - std::string _trkExtrapolModuleLabel; - - TTree* _Ntup; - Int_t _evt,_ntrks; - Float_t _caloSec[100],_trkId[100],_trkTime[100],_trkTimeErr[100], _trkPathLenghtIn[100], _trkPathLenghtInErr[100], _trkPathLenghtOut[100]; - Float_t _trkMom[100],_trkMomX[100], _trkMomY[100],_trkMomZ[100], _trkPosX[100], _trkPosY[100], _trkPosZ[100]; - - }; - - - - void ReadTrkExtrapolMVA::beginJob( ) { - - - art::ServiceHandle tfs; - _Ntup = tfs->make("trkExt", "Extrapolated track info"); - - _Ntup->Branch("evt" , &_evt , "evt/F"); - _Ntup->Branch("ntrks" , &_ntrks , "ntrks/I"); - _Ntup->Branch("caloSec", &_caloSec, "caloSec[ntrks]/F"); - _Ntup->Branch("trkTime", &_trkTime, "trkTime[ntrks]/F"); - _Ntup->Branch("trkPathLenghtIn", &_trkPathLenghtIn, "trkPathLenghtIn[ntrks]/F"); - _Ntup->Branch("trkPathLenghtInErr", &_trkPathLenghtInErr, "trkPathLenghtInErr[ntrks]/F"); - _Ntup->Branch("trkPathLenghtOut", &_trkPathLenghtOut, "trkPathLenghtOut[ntrks]/F"); - _Ntup->Branch("trkMom", &_trkMom, "trkMom[ntrks]/F"); - _Ntup->Branch("trkMomX", &_trkMomX, "trkMomX[ntrks]/F"); - _Ntup->Branch("trkMomY", &_trkMomY, "trkMomY[ntrks]/F"); - _Ntup->Branch("trkMomZ", &_trkMomZ, "trkMomZ[ntrks]/F"); - _Ntup->Branch("trkPosX", &_trkPosX, "trkPosX[ntrks]/F"); - _Ntup->Branch("trkPosY", &_trkPosY, "trkPosY[ntrks]/F"); - _Ntup->Branch("trkPosZ", &_trkPosZ, "trkPosZ[ntrks]/F"); - - - } - - - - void ReadTrkExtrapolMVA::analyze(art::Event const& event ) - { - - art::Handle trjExtrapolHandle; - event.getByLabel(_trkExtrapolModuleLabel, trjExtrapolHandle); - TrkCaloIntersectCollection const& trkExtrapols(*trjExtrapolHandle); - - _evt = event.id().event(); - _ntrks = trkExtrapols.size(); - - int it(0); - for (auto const& extrapol: trkExtrapols) - { - double pathLength = extrapol.pathLengthEntrance(); - _caloSec[it] = extrapol.diskId(); - _trkTime[it] = extrapol.trk()->arrivalTime(pathLength); - _trkPathLenghtIn[it] = extrapol.pathLengthEntrance(); - _trkPathLenghtInErr[it] = extrapol.pathLenghtEntranceErr(); - _trkPathLenghtOut[it] = extrapol.pathLengthExit(); - _trkMom[it] = extrapol.trk()->momentum(pathLength).mag(); - _trkMomX[it] = extrapol.trk()->momentum(pathLength).x(); - _trkMomY[it] = extrapol.trk()->momentum(pathLength).y(); - _trkMomZ[it] = extrapol.trk()->momentum(pathLength).z(); - _trkPosX[it] = extrapol.trk()->position(pathLength).x(); - _trkPosY[it] = extrapol.trk()->position(pathLength).y(); - _trkPosZ[it] = extrapol.trk()->position(pathLength).z(); - - ++it; - } - - _Ntup->Fill(); - } - - -} - - - -using mu2e::ReadTrkExtrapolMVA; -DEFINE_ART_MODULE(ReadTrkExtrapolMVA) diff --git a/Analyses/src/ReadTrkExtrapol_module.cc b/Analyses/src/ReadTrkExtrapol_module.cc deleted file mode 100644 index 2cf4c2fa9c..0000000000 --- a/Analyses/src/ReadTrkExtrapol_module.cc +++ /dev/null @@ -1,230 +0,0 @@ -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -//root includes -#include "TFile.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" - - -using namespace std; - -namespace mu2e { - - static int ncalls(0); - - class ReadTrkExtrapol : public art::EDAnalyzer { - public: - explicit ReadTrkExtrapol(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel")), - _trkToCaloExtrapolModuleLabel(pset.get("trkToCaloExtrapolModuleLabel")), - _Ntup(0){} - - virtual ~ReadTrkExtrapol() { - } - void beginJob(); - void endJob() {} - - void analyze(art::Event const& e ); - - private: - - void readTrackExtrapolation(art::Event const& evt, bool skip); - - // Diagnostic level - int _diagLevel; - - // Label of the extrapolated impact points - std::string _trkToCaloExtrapolModuleLabel; - - bool _skipEvent; - - TTree* _Ntup;//Ntupla which contains informations about the extrapolation starting from MC - - Int_t _evt,//event Id - _ntrks; - - Float_t _caloSec[100], - _trkId[100], - _trkTime[100], - _trkTimeErr[100], - _trkPathLenghtIn[100], - _trkPathLenghtInErr[100], - _trkPathLenghtOut[100], - _trkPathLenghtOutErr[100], - _trkMom[100], - _trkMomX[100], - _trkMomY[100], - _trkMomZ[100], - _trkPosX[100], - _trkPosY[100], - _trkPosZ[100]; - - }; - - - - void ReadTrkExtrapol::beginJob( ) { - - cout << "start ReadTrkExtrapol..."< tfs; - _Ntup = tfs->make("trkExt", "Extrapolated track info"); - - _Ntup->Branch("evt" , &_evt , "evt/F"); - _Ntup->Branch("ntrks" , &_ntrks , "ntrks/I"); - _Ntup->Branch("caloSec", &_caloSec, "caloSec[ntrks]/F"); - _Ntup->Branch("trkId", &_trkId, "trkId[ntrks]/F"); - _Ntup->Branch("trkTime", &_trkTime, "trkTime[ntrks]/F"); - _Ntup->Branch("trkTimeErr", &_trkTimeErr, "trkTimeErr[ntrks]/F"); - _Ntup->Branch("trkPathLenghtIn", &_trkPathLenghtIn, "trkPathLenghtIn[ntrks]/F"); - _Ntup->Branch("trkPathLenghtInErr", &_trkPathLenghtInErr, "trkPathLenghtInErr[ntrks]/F"); - _Ntup->Branch("trkPathLenghtOut", &_trkPathLenghtOut, "trkPathLenghtOut[ntrks]/F"); - _Ntup->Branch("trkPathLenghtOutErr", &_trkPathLenghtOutErr, "trkPathLenghtOutErr[ntrks]/F"); - _Ntup->Branch("trkMom", &_trkMom, "trkMom[ntrks]/F"); - _Ntup->Branch("trkMomX", &_trkMomX, "trkMomX[ntrks]/F"); - _Ntup->Branch("trkMomY", &_trkMomY, "trkMomY[ntrks]/F"); - _Ntup->Branch("trkMomZ", &_trkMomZ, "trkMomZ[ntrks]/F"); - _Ntup->Branch("trkPosX", &_trkPosX, "trkPosX[ntrks]/F"); - _Ntup->Branch("trkPosY", &_trkPosY, "trkPosY[ntrks]/F"); - _Ntup->Branch("trkPosZ", &_trkPosZ, "trkPosZ[ntrks]/F"); - - } - - - readTrackExtrapolation(evt, _skipEvent); - - } // end of analyze - - - void ReadTrkExtrapol::readTrackExtrapolation(art::Event const& evt, bool skip){ - - art::Handle handle; - evt.getByLabel(_trkToCaloExtrapolModuleLabel, handle); - const TrkToCaloExtrapolCollection* coll; - const TrkToCaloExtrapol *trkExt; - - if (handle.isValid()) { - coll = handle.product(); - } else { - printf(">>> ERROR in readTrackExtrapolation::doExtrapolation: failed to locate collection"); - printf(". BAIL OUT. \n"); - return; - } - - _evt = evt.id().event(); - _ntrks = coll->size(); - - for(int i=0; i<_ntrks; ++i){ - trkExt = &coll->at(i); -// KalRepPtr const& trkPtr = trkExt->trk(); -// const KalRep* trk = trkPtr.get(); - - _caloSec[i] = trkExt->diskId(); - _trkId[i] = trkExt->trackNumber(); - _trkTime[i] = trkExt->time(); - _trkTimeErr[i] = trkExt->timeErr(); - - _trkPathLenghtIn[i] = trkExt->pathLengthEntrance(); - _trkPathLenghtInErr[i] = trkExt->pathLenghtEntranceErr(); - _trkPathLenghtOut[i] = trkExt->pathLengthExit(); - _trkPathLenghtOutErr[i] = trkExt->pathLenghtEntranceErr(); - _trkMom[i] = trkExt->momentum().mag(); - _trkMomX[i] = trkExt->momentum().x(); - _trkMomY[i] = trkExt->momentum().y(); - _trkMomZ[i] = trkExt->momentum().z(); - _trkPosX[i] = trkExt->entrancePosition().x(); - _trkPosY[i] = trkExt->entrancePosition().y(); - _trkPosZ[i] = trkExt->entrancePosition().z(); - - } - - _Ntup->Fill(); - - if(evt.id().event() % 100 == 0){ - cout << "Event "< Date: Mon, 2 Feb 2026 15:36:16 -0800 Subject: [PATCH 107/174] More fixes --- Analyses/CMakeLists.txt | 65 - Analyses/src/ReadTrackCaloMatching_module.cc | 242 ---- CaloFilters/CMakeLists.txt | 10 - TrkPatRec/CMakeLists.txt | 1 + TrkReco/CMakeLists.txt | 7 - TrkReco/src/KalFit.cc | 1193 ------------------ 6 files changed, 1 insertion(+), 1517 deletions(-) delete mode 100644 Analyses/src/ReadTrackCaloMatching_module.cc delete mode 100644 TrkReco/src/KalFit.cc diff --git a/Analyses/CMakeLists.txt b/Analyses/CMakeLists.txt index 46171036ef..2f32b55212 100644 --- a/Analyses/CMakeLists.txt +++ b/Analyses/CMakeLists.txt @@ -278,20 +278,6 @@ cet_build_plugin(ParticleIDScan art::module Offline::ParticleID ) -cet_build_plugin(PbarAnalysis2 art::module - REG_SOURCE src/PbarAnalysis2_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CaloCluster - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeometryService - Offline::GlobalConstantsService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::TrackerGeom -) - cet_build_plugin(pbars1hist art::module REG_SOURCE src/pbars1hist_module.cc LIBRARIES REG @@ -421,19 +407,6 @@ cet_build_plugin(ReadBack art::module Offline::TrackerGeom ) -cet_build_plugin(ReadCaloDigi art::module - REG_SOURCE src/ReadCaloDigi_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeometryService - Offline::GlobalConstantsService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::SeedService -) - cet_build_plugin(ReadMCTrajectories art::module REG_SOURCE src/ReadMCTrajectories_module.cc LIBRARIES REG @@ -475,26 +448,6 @@ cet_build_plugin(ReadStrawHitReco art::module Offline::TrackerGeom ) -cet_build_plugin(ReadTrackCaloMatching art::module - REG_SOURCE src/ReadTrackCaloMatching_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::GeometryService - Offline::RecoDataProducts - Offline::TrackerGeom -) - -cet_build_plugin(ReadTrackCaloMatchingMVA art::module - REG_SOURCE src/ReadTrackCaloMatchingMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::DataProducts - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts -) - cet_build_plugin(ReadTrackerSteps art::module REG_SOURCE src/ReadTrackerSteps_module.cc LIBRARIES REG @@ -504,24 +457,6 @@ cet_build_plugin(ReadTrackerSteps art::module Offline::TrackerGeom ) -cet_build_plugin(ReadTrkExtrapol art::module - REG_SOURCE src/ReadTrkExtrapol_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::GeometryService - Offline::RecoDataProducts - Offline::TrackerGeom -) - -cet_build_plugin(ReadTrkExtrapolMVA art::module - REG_SOURCE src/ReadTrkExtrapolMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::GeometryService - Offline::RecoDataProducts - Offline::TrackerGeom -) - cet_build_plugin(ReadVirtualDetector art::module REG_SOURCE src/ReadVirtualDetector_module.cc LIBRARIES REG diff --git a/Analyses/src/ReadTrackCaloMatching_module.cc b/Analyses/src/ReadTrackCaloMatching_module.cc deleted file mode 100644 index d53bebfe27..0000000000 --- a/Analyses/src/ReadTrackCaloMatching_module.cc +++ /dev/null @@ -1,242 +0,0 @@ -// -// -// -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDAnalyzer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/KalRepCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/HelixTraj.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - -// Other includes. -#include "cetlib_except/exception.h" - - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -//root includes -#include "TFile.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" - - -using namespace std; - -namespace mu2e { - - static int ncalls(0); - - class ReadTrackCaloMatching : public art::EDAnalyzer { - public: - explicit ReadTrackCaloMatching(fhicl::ParameterSet const& pset): - art::EDAnalyzer(pset), - _diagLevel(pset.get("diagLevel")), - _trackClusterMatchModuleLabel(pset.get("trackClusterMatchModuleLabel")), - _Ntup(0){} - - virtual ~ReadTrackCaloMatching() { - } - void beginJob(); - void endJob() {} - - void analyze(art::Event const& e ); - - private: - - void readTracClusterMatch(art::Event const& evt, bool skip); - - // Diagnostic level - int _diagLevel; - - // Label of the extrapolated impact points - std::string _trackClusterMatchModuleLabel; - - bool _skipEvent; - - TTree* _Ntup;//Ntupla which contains informations about the extrapolation starting from MC - - Int_t _evt,//event Id - _ntrks; - - Float_t _xtrk[100], - _ytrk[100], - _ztrk[100], - _ttrk[100], - _nx[100], - _ny[100], - _nz[100], - _dx[100], - _dy[100], - _dz[100], - _dt[100], - _du[100], - _dv[100], - _ep[100], - _chi2[100], - _chi2_time[100], - _int_depth[100], - _ds[100]; - - }; - - - - void ReadTrackCaloMatching::beginJob( ) { - - cout << "start ReadTrackCaloMatching..."< tfs; - _Ntup = tfs->make("trkClu", "track-cluster match info"); - - _Ntup->Branch("evt" , &_evt , "evt/F"); - _Ntup->Branch("ntrks" , &_ntrks , "ntrks/I"); - - _Ntup->Branch("xtrk", _xtrk, "xtrk[ntrks]/F"); - _Ntup->Branch("ytrk", &_ytrk, "ytrk[ntrks]/F"); - _Ntup->Branch("ztrk", &_ztrk, "ztrk[ntrks]/F"); - _Ntup->Branch("ttrk", &_ttrk, "ttrk[ntrks]/F"); - _Ntup->Branch("nx", &_nx, "nx[ntrks]/F"); - _Ntup->Branch("ny", &_ny, "ny[ntrks]/F"); - _Ntup->Branch("nz", &_nz, "nz[ntrks]/F"); - _Ntup->Branch("dx", &_dx, "dx[ntrks]/F"); - _Ntup->Branch("dy", &_dy, "dy[ntrks]/F"); - _Ntup->Branch("dz", &_dz, "dz[ntrks]/F"); - _Ntup->Branch("dt", &_dt, "dt[ntrks]/F"); - _Ntup->Branch("du", &_du, "du[ntrks]/F"); - _Ntup->Branch("dv", &_dv, "dv[ntrks]/F"); - _Ntup->Branch("ep", &_ep, "ep[ntrks]/F"); - _Ntup->Branch("chi2", &_chi2, "chi2[ntrks]/F"); - _Ntup->Branch("chi2time", &_chi2_time, "chi2time[ntrks]/F"); - _Ntup->Branch("intdepth", &_int_depth, "intdepth[ntrks]/F"); - _Ntup->Branch("ds", &_ds, "ds[ntrks]/F"); - } - - - readTracClusterMatch(evt, _skipEvent); - - } // end of analyze - - - void ReadTrackCaloMatching::readTracClusterMatch(art::Event const& evt, bool skip){ - - art::Handle handle; - evt.getByLabel(_trackClusterMatchModuleLabel, handle); - const TrackClusterMatchCollection* coll; - const TrackClusterMatch* obj; - - if (handle.isValid()){ - coll = handle.product(); - }else { - printf(">>> ERROR in ReadTrackCaloMatching::doExtrapolation: failed to locate collection"); - printf(". BAIL OUT. \n"); - return; - } - - _evt = evt.id().event(); - _ntrks = coll->size(); - - for(int i=0; i<_ntrks; ++i){ - - obj = &coll->at(i); - - _xtrk[i] = obj->xtrk(); - _ytrk[i] = obj->ytrk(); - _ztrk[i] = obj->ztrk(); - _ttrk[i] = obj->ttrk(); - _nx[i] = obj->nx(); - _ny[i] = obj->ny(); - _nz[i] = obj->nz(); - _dx[i] = obj->dx(); - _dy[i] = obj->dy(); - _dz[i] = obj->dz(); - _dt[i] = obj->dt(); - _du[i] = obj->du(); - _dv[i] = obj->dv(); - _ep[i] = obj->ep(); - _chi2[i] = obj->chi2(); - _chi2_time[i] = obj->chi2_time(); - _int_depth[i] = obj->int_depth(); - _ds[i] = obj->ds(); - - - } - - _Ntup->Fill(); - - if(evt.id().event() % 100 == 0){ - cout << "Event "< -#include -#include -#include -#include -#include -//CLHEP -#include "CLHEP/Vector/ThreeVector.h" -// C++ -#include -#include -#include -#include -#include - -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; -using CLHEP::HepSymMatrix; - -namespace mu2e -{ - // comparison functor for ordering hits. This should operate on TrkHit, FIXME! - struct fcomp { - bool operator()(TrkHit* x, TrkHit* y) { - return x->fltLen() < y->fltLen(); - } - }; - - // struct for finding materials - struct StrawFlight { - StrawId _id; // straw being tested - double _flt; // flight where trajectory comes near this straw - // construct from pair - StrawFlight(StrawId strawid, double flt) : _id(strawid), _flt(flt) {} - }; - - // comparison operators understand that the same straw could be hit twice, so the flight lengths need - // to be similar befoew we consider these 'the same' - struct StrawFlightComp { - double _maxdiff; // maximum flight difference; below this, consider 2 intersections 'the same' - StrawFlightComp(double maxdiff) : _maxdiff(maxdiff) {} - bool operator () (StrawFlight const& a, StrawFlight const& b) const { return a._id < b._id || - ( a._id == b._id && a._flt < b._flt && fabs(a._flt-b._flt)>=_maxdiff);} - }; - - // construct from a parameter set - KalFit::KalFit(fhicl::ParameterSet const& pset) : - // KalFit parameters - _debug(pset.get("debugLevel",0)), - _maxhitchi(pset.get("maxhitchi",3.5)), - _maxpull(pset.get("maxPull",5)), - _maxweed(pset.get("maxweed",10)), - _maxweedtch(pset.get("maxweedtch",1)), - // t0 parameters - _useTrkCaloHit(pset.get("useTrkCaloHit")), - _nCaloExtrapolSteps(pset.get("nCaloExtrapolSteps", 100)), - _caloHitErr(pset.get("caloHitError")), - _updatet0(pset.get>("updateT0")), - _t0tol(pset.get< vector >("t0Tolerance")), - _t0errfac(pset.get("t0ErrorFactor",1.2)), - _t0nsig(pset.get("t0window",2.5)), - _mindocatch(pset.get("mindocatch",-50.)), - _maxdocatch(pset.get("maxdocatch", 50.)), - _mindepthtch(pset.get("mindepthtch",-50.)), - _maxdepthtch(pset.get("maxdepthtch",250.)), - _maxtchdt(pset.get("maxtchdt", 5.)),//ns - _mintchenergy(pset.get("mintchEnergy", 10.)),//MeV - _mintchtrkpath(pset.get("mintchTrkPath", 1.)),//mm - _strHitW(pset.get("strawHitT0Weight")), - _calHitW(pset.get("caloHitT0Weight")), - // - _minnstraws(pset.get("minnstraws",15)), - _maxmatfltdiff(pset.get("MaximumMaterialFlightDifference",1000.0)), // mm separation in flightlength - _weedhits(pset.get >("weedhits")), - _herr(pset.get< vector >("hiterr")), - _ambigstrategy(pset.get< vector >("ambiguityStrategy")), - _addmaterial(pset.get >("AddMaterial")), - _resolveAfterWeeding(pset.get("ResolveAfterWeeding",false)), - _exup((extent)pset.get("UpstreamExtent",noextension)), - _exdown((extent)pset.get("DownstreamExtent",noextension)), - _ttcalc (pset.get("T0Calculator",fhicl::ParameterSet())), - _bfield(0) - { - // set KalContext parameters - _disttol = pset.get("IterationTolerance",0.1); - _intertol = pset.get("IntersectionTolerance",100.0); - _maxiter = pset.get("MaxIterations",10); - _maxinter = pset.get("MaxIntersections",0); - _matcorr = pset.get("materialCorrection",true); - _fieldcorr = pset.get("fieldCorrection",false); - _smearfactor = pset.get("SeedSmear",1.0e6); - _sitethresh = pset.get("SiteMomThreshold",0.2); - _momthresh = pset.get("MomThreshold",10.0); - _mingap = pset.get("mingap",1.0); - _minfltlen = pset.get("MinFltLen",0.1); - _minmom = pset.get("MinMom",10.0); - _fltepsilon = pset.get("FltEpsilon",0.001); - _divergeflt = pset.get("DivergeFlt",1.0e3); - _mindot = pset.get("MinDot",0.0); - _maxmomdiff = pset.get("MaxMomDiff",0.5); - _momfac = pset.get("MomFactor",0.0); - _maxpardif[0] = _maxpardif[1] = pset.get("MaxParameterDifference",1.0); - - _mindof = pset.get("MinNDOF",10); - - _printUtils = new TrkPrintUtils(pset.get("printUtils",fhicl::ParameterSet())); - - // this config belongs in the BField integrator, FIXME!!! - _bintconfig._maxRange = pset.get("BFieldIntMaxRange",1.0e5); // 100 m - _bintconfig._intTolerance = pset.get("BFieldIntTol",0.01); // 10 KeV - _bintconfig._intPathMin = pset.get("BFieldIntMin",20.0); // 20 mm - _bintconfig._divTolerance = pset.get("BFieldIntDivTol",0.05); // 50 KeV - _bintconfig._divPathMin = pset.get("BFieldIntDivMin",50.0); // 50 mm - _bintconfig._divStepCeiling = pset.get("BFieldIntDivMax",500.0); // 500 mm - // field integral errors. This is commented out as it hasn't been shown to improve the fit - // double perr = pset.get("BendCorrErrFrac",0.0); // fractional accuracy of trajectory - // double berr = pset.get("BFieldMapErr",0.0); // mapping and interpolation error - // KalBend::setErrors(perr,berr); - // make sure we have at least one entry for additional errors - if(_herr.size() <= 0) throw cet::exception("RECO")<<"mu2e::KalFit: no hit errors specified" << endl; - if(_herr.size() != _ambigstrategy.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution hiterr" << endl; - if(_herr.size() != _t0tol.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution t0" << endl; - if(_herr.size() != _weedhits.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution WeedHits" << endl; - if(_herr.size() != _addmaterial.size()) throw cet::exception("RECO")<<"mu2e::KalFit: inconsistent ambiguity resolution AddMaterial" << endl; - // Search for explicit resolver parameter sets. These may not be used - fhicl::ParameterSet const& fixedPset = pset.get("FixedAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& hitPset = pset.get("HitAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& panelPset = pset.get("PanelAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& pocaPset = pset.get("POCAAmbigResolver",fhicl::ParameterSet()); - fhicl::ParameterSet const& doubletPset = pset.get("DoubletAmbigResolver",fhicl::ParameterSet()); - // construct the explicit ambiguity resolvers, 1 instance per iteration - size_t niter = _ambigstrategy.size(); - for(size_t iter=0; iter ch; - - _nCaloDisks = ch->nDisks(); - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - for (unsigned i=0; i<_nCaloDisks; ++i){ - CLHEP::Hep3Vector pos(ch->disk(i).geomInfo().frontFaceCenter()); - pos = ch->geomUtil().mu2eToTracker(pos); - - _zmincalo[i] = (pos.z()); - _zmaxcalo[i] = (pos.z()+crystalLength); - _rmincalo[i] = (ch->disk(i).geomInfo().innerEnvelopeR()); - _rmaxcalo[i] = (ch->disk(i).geomInfo().outerEnvelopeR()); - } - } - - - //----------------------------------------------------------------------------- - // create the track (KalRep) from a track seed - //----------------------------------------------------------------------------- - void KalFit::makeTrack(StrawResponse::cptr_t srep, - Mu2eDetector::cptr_t detmodel, - KalFitData& kalData){ - - // test if fitable - if(fitable(*kalData.kalSeed)){ - // find the segment at the 0 flight - double flt0 = kalData.kalSeed->flt0(); - auto kseg = kalData.kalSeed->nearestSegmentFlt(flt0); - if(kseg->fmin() > kseg->localFlt(flt0) || - kseg->fmax() < kseg->localFlt(flt0) ){ - std::cout << "FitType: "<< kalData.fitType<<", number 0f segments = "<segments().size() - <<", Helix segment range doesn't cover flt0 = " << flt0 << std::endl; - } - // create a trajectory from the seed. This shoudl be a general utility function that - // can work with multi-segment seeds FIXME! - // create CLHEP objects from seed native members. This will - // go away when we switch to SMatrix FIXME!!! - HepVector pvec(5,0); - HepSymMatrix pcov(5,0); - kseg->helix().hepVector(pvec); - kseg->covar().symMatrix(pcov); - // Create the traj from these - HelixTraj htraj(pvec,pcov); - kalData.helixTraj = &htraj; - // create the hits - TrkStrawHitVector tshv; - makeTrkStrawHits(srep,kalData, tshv); - - // Find the wall and gas material description objects for these hits - std::vector detinter; - if(_matcorr)makeMaterials(detmodel, tshv,*kalData.helixTraj,detinter); - // Create the BaBar hit list, and fill it with these hits. The BaBar list takes ownership - // We should use the TrkHit vector everywhere, FIXME! - std::vector thv(0); - for(auto ihit = tshv.begin(); ihit != tshv.end(); ++ihit){ - thv.push_back(*ihit); - if (_debug>2) { (*ihit)->print(std::cout); } - } - if (_useTrkCaloHit){ //use the TrkCaloHit to initialize the t0? - //create the TrkCaloHit - TrkCaloHit* tch(0); - makeTrkCaloHit(kalData, tch); - if (tch != 0) thv.push_back(tch); - } - - TrkT0 t0(kalData.kalSeed->t0()); - // create Kalman rep - kalData.krep = new KalRep(htraj, thv, detinter, *this, TrkParticle(TrkParticle::type(kalData.kalSeed->particle())), t0, flt0); - assert(kalData.krep != 0); - - if (_debug > 0) { - char msg[100]; - sprintf(msg,"makeTrack_001 annealing step: %2i",_annealingStep); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - - // initialize history list - kalData.krep->addHistory(TrkErrCode(),"KalFit creation"); - // now fit - TrkErrCode fitstat = fitTrack(detmodel,kalData); - kalData.krep->addHistory(fitstat,"KalFit fit"); - // extend the fit - if(fitstat.success()){ - fitstat = extendFit(kalData.krep); - kalData.krep->addHistory(fitstat,"KalFit extension"); - } - } - } - - void KalFit::addHits(StrawResponse::cptr_t srep, Mu2eDetector::cptr_t detmodel, - KalFitData&kalData, double maxchi) { - //2017-05-02: Gianipez. In this function inten - // there must be a valid Kalman fit to add hits to - KalRep* krep = kalData.krep; - - if(kalData.krep != 0 && kalData.missingHits.size() > 0 && krep->fitStatus().success()){ - TrkHitVector::iterator ihigh; - TrkHitVector::reverse_iterator ilow; - // use the reference trajectory, as that's what all the existing hits do - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - for(unsigned iind=0;iindat(istraw)); - const Straw& straw = _tracker->getStraw(strawhit.strawId()); - // estimate initial flightlength - double hflt(0.0); - TrkHelixUtils::findZFltlen(*reftraj,straw.getMidPoint().z(),hflt); - // find the bounding sites near this hit, and extrapolate to get the hit t0 - findBoundingHits(krep,hflt,ilow,ihigh); - const TrkHit* nearhit; - if(ihigh != krep->hitVector().end()) - nearhit = *ihigh; - else - nearhit = *ilow; - - //can I just do krep_hitt0()???; this whole block (next 5 lines of code) will disappear! - HitT0 hitt0 = krep_hitT0(krep, nearhit);//nearhit->hitT0(); - double mom = krep->momentum(nearhit->fltLen()).mag(); - double beta = krep->particleType().beta(mom); - double tflt = (hflt-nearhit->fltLen())/(beta*CLHEP::c_light); - // update the time in the HitT0 object - hitt0._t0 += tflt; - // create the hit object. Assume we're at the last iteration over added error - TrkStrawHit* trkhit = new TrkStrawHit(srep,strawhit,*_tracker,istraw,hitt0,hflt, - _maxpull,_strHitW ); - assert(trkhit != 0); - trkhit->setTemperature(_herr.back()); // give this hit the final annealing temperature - trkhit->setFlag(TrkHit::addedHit); - // guess the ambiguity form the sign of the doca - int iambig; - if (kalData.missingHits[iind].doca > 0) iambig = 1; - else iambig = -1; - // can set ambiguity only for deactivated hit - trkhit->setActivity(false); - trkhit->setAmbig(iambig); - // must be initialy active for KalRep to process correctly - trkhit->setActivity(true); - // set the hit ambiguity. This is a preliminary value before using the official ambig resolver - TrkPoca poca(krep->traj(),hflt,*trkhit->hitTraj(),0.0); - int newamb = poca.doca() > 0 ? 1 : -1; - trkhit->setAmbig(newamb); - // add the hit to the track - krep->addHit(trkhit); - // check the raw residual: This call works because the HOT isn't yet processed as part of the fit. - double chi = fabs(trkhit->residual()/trkhit->hitRms()); - //if it's outside limits, deactivate the HOT - if(chi > maxchi || (!trkhit->isPhysical(maxchi))) - trkhit->setActivity(false); - // find the DetElem associated this straw - const DetStrawElem* strawelem = detmodel->strawElem(trkhit->straw()); - // see if this KalRep already has a KalMaterial with this element: if not, add it - bool hasmat(false); - std::vector kmats; - krep->findMaterialSites(strawelem,kmats); - // if this is a reflecting track the same material can appear multiple times: check the flight lengths - if(kmats.size() > 0){ - for(auto kmat: kmats) { - if( fabs( kmat->globalLength() - trkhit->fltLen()) < _maxmatfltdiff){ - hasmat = true; - break; - } - } - } - if(!hasmat){ - // create intersection object for this element; it includes all materials - DetIntersection strawinter(strawelem, krep->referenceTraj(),trkhit->fltLen()); - strawinter.thit = trkhit; - // compute initial intersection: this gets updated each fit iteration - strawelem->reIntersect(krep->referenceTraj(),strawinter); - krep->addInter(strawinter); - } - } - // refit the last iteration of the track - TrkErrCode fitstat = fitIteration(detmodel,kalData,_herr.size()-1); - krep->addHistory(fitstat,"AddHits"); - } - } - // - TrkErrCode KalFit::fitTrack(Mu2eDetector::cptr_t detmodel, KalFitData&kalData) { - // loop over external hit errors, ambiguity assignment, t0 toleratnce - TrkErrCode fitstat; - for(size_t iherr=0;iherr < _herr.size(); ++iherr) { - fitstat = fitIteration(detmodel,kalData,iherr); - if(_debug > 0) { - cout << "Iteration " << iherr - << " NDOF = " << kalData.krep->nDof() - << " Fit Status = " << fitstat << endl; - - char msg[200]; - sprintf(msg,"KalFit::fitTrack Iteration = %2li success = %i",iherr,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - if(!fitstat.success())break; - } - return fitstat; - } - - //----------------------------------------------------------------------------- - //----------------------------------------------------------------------------- - TrkErrCode KalFit::fitIteration(Mu2eDetector::cptr_t detmodel, - KalFitData&kalData, int iter) { - - if (iter == -1) iter = _herr.size()-1; - _annealingStep = iter;//used in the printHits routine - - // update the external hit errors. This isn't strictly necessary on the 1st iteration. - TrkHitVector* thv = &(kalData.krep->hitVector()); - for (auto itsh=thv->begin();itsh!=thv->end(); ++itsh){ - (*itsh)->setTemperature(_herr[iter]); - } - - // update t0, and propagate it to the hits - double oldt0 = kalData.krep->t0()._t0; - unsigned niter(0); - bool changed(true); - TrkErrCode retval = TrkErrCode::succeed; - - KalRep* krep = kalData.krep; - bool flagMaterialAdded(false); - - while(retval.success() && changed && ++niter < maxIterations()){ - //----------------------------------------------------------------------------- - // convention: resolve drift signs before the fit with respect to the trajectory - // determined at the previous iteration - //----------------------------------------------------------------------------- - changed = _ambigresolver[iter]->resolveTrk(krep); - // force a refit - krep->resetFit(); - retval = krep->fit(); - if(! retval.success())break; - - //2019-04-26: Giani&Dave; we want to do the weeding before the call to ::updateT0 - // drop outliers - if(_weedhits[iter]){ - kalData.nweediter = 0; - changed |= weedHits(kalData,iter); - changed |= unweedBestHit(kalData,_maxhitchi); - } - // updates - if(_updatet0[iter]){ - updateT0(kalData, iter); - changed |= fabs(krep->t0()._t0-oldt0) > _t0tol[iter]; - } - // find missing materials - unsigned nmat(0); - if(_addmaterial[iter]){ - nmat = addMaterial(detmodel,krep); - changed |= nmat>0; - if (!flagMaterialAdded) flagMaterialAdded=true; - } - - if(_debug > 1) std::cout << "Inner iteration " << niter << " changed = " - << changed << " t0 old " << oldt0 << " new " << krep->t0()._t0 - << " nmat = " << nmat << endl; - oldt0 = krep->t0()._t0; - } - if(_debug > 1) - std::cout << "Outer iteration " << iter << " stopped after " - << niter << " iterations" << std::endl; - // make sure the fit is current - if(!krep->fitCurrent()) - retval = krep->fit(); - return retval; - } - - bool - KalFit::fitable(KalSeed const& kseed){ - return kseed.segments().size() > 0 && kseed.hits().size() >= _minnstraws; - } - - void - KalFit::makeTrkStrawHits(StrawResponse::cptr_t srep, - KalFitData& kalData, TrkStrawHitVector& tshv ) { - - std::vectorconst hseeds = kalData.kalSeed->hits(); - HelixTraj const htraj = *kalData.helixTraj; - // compute particle velocity to - for(auto ths : hseeds ){ - // create a TrkStrawHit from this seed. - size_t index = ths.index(); - const ComboHit& strawhit(kalData.chcol->at(index)); - TrkStrawHit* trkhit = new TrkStrawHit(srep,strawhit,*_tracker,ths.index(),ths.t0(),ths.trkLen(), - _maxpull,_strHitW); - assert(trkhit != 0); - // set the initial ambiguity - trkhit->setAmbig(ths.ambig()); - // refine the flightlength, as otherwise hits in the same plane are at exactly the same flt, which can cause problems - TrkErrCode pstat = trkhit->updatePoca(&htraj); - if(pstat.failure()){ - trkhit->setActivity(false); - } - tshv.push_back(trkhit); - } - // sort the hits by flightlength - std::sort(tshv.begin(),tshv.end(),fcomp()); - } - - void - KalFit::makeTrkCaloHit (KalFitData& kalData, TrkCaloHit *&tch){ - art::Ptr const& calo = kalData.kalSeed->caloCluster(); - if (calo.isNonnull()){ - mu2e::GeomHandle ch; - Hep3Vector cog = ch->geomUtil().mu2eToTracker(ch->geomUtil().diskFFToMu2e( calo->diskID(), calo->cog3Vector())); - if(_debug > 0){ - std::cout << "Cluster COG (disk) " << calo->cog3Vector() << std::endl - << "Cluster COG (Mu2e) " << ch->geomUtil().diskFFToMu2e( calo->diskID(), calo->cog3Vector()) << std::endl - <<" Cluster COG (Det ) " << cog << std::endl; - } - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - // estimate fltlen from pitch; take the last segment - HelixVal const& hval = kalData.kalSeed->segments().back().helix(); - double mom = kalData.kalSeed->segments().back().mom(); - TrkParticle tpart(TrkParticle::type(kalData.kalSeed->particle())); - double beta = tpart.beta(mom); - double td = hval.tanDip(); - double sd = td/sqrt(1.0+td*td); - double fltlen = (cog.z()- hval.z0() + 0.5*crystalLength)/sd;// - kalData.kalSeed->flt0(); - // t0 represents the time the particle reached the sensor; estimate that - HitT0 ht0 = kalData.kalSeed->t0(); // start with the track t0 - double flt0 = kalData.kalSeed->flt0(); - double tflt = (fltlen -flt0)/(beta*CLHEP::c_light); - ht0._t0 += tflt; - ht0._t0err = _ttcalc.caloClusterTimeErr(); - Hep3Vector clusterAxis = Hep3Vector(0, 0, 1);//FIXME! should come from crystal - tch = new TrkCaloHit(*kalData.kalSeed->caloCluster().get(), cog, crystalLength, clusterAxis, ht0, fltlen, _calHitW, _caloHitErr, _ttcalc.caloClusterTimeErr(), _ttcalc.trkToCaloTimeOffset()); - } - } - - - void - KalFit::makeMaterials( Mu2eDetector::cptr_t detmodel, - TrkStrawHitVector const& tshv, HelixTraj const& htraj, - std::vector& detinter) { - // loop over strawhits and extract the straws - for (auto trkhit : tshv) { - // find the DetElem associated this straw - const DetStrawElem* strawelem = detmodel->strawElem(trkhit->straw()); - // create intersection object for this element; it includes all materials - DetIntersection strawinter; - strawinter.delem = strawelem; - strawinter.pathlen = trkhit->fltLen(); - strawinter.thit = trkhit; - // compute initial intersection: this gets updated each fit iteration - strawelem->reIntersect(&htraj,strawinter); - detinter.push_back(strawinter); - } - } - - unsigned KalFit::addMaterial(Mu2eDetector::cptr_t detmodel, KalRep* krep) { - unsigned retval(0); - // Tracker geometry - const Tracker& tracker = *_tracker; - // general properties; these should be computed once/job and stored FIXME! - double strawradius = tracker.strawOuterRadius(); - auto const& frontplane = tracker.planes().front(); - auto const& firstpanel = frontplane.getPanel(0); - auto const& innerstraw = firstpanel.getStraw(0); - auto const& outerstraw = firstpanel.getStraw(StrawId::_nstraws-1); - // compute limits: add some buffer for the finite size of the straw - auto DStoP = firstpanel.dsToPanel(); - auto innerstraw_origin = DStoP*innerstraw.origin(); - auto outerstraw_origin = DStoP*outerstraw.origin(); - double ymin = innerstraw_origin.y() - strawradius; - double ymax = outerstraw_origin.y() + strawradius; - double umax = innerstraw.halfLength() + strawradius; - // use the outermost straw end to set the max hit radius - double rmax = outerstraw.wireEnd(StrawEnd::cal).mag() + strawradius; - double spitch = (StrawId::_nstraws-1)/(ymax-ymin); - // storage of potential straws - StrawFlightComp strawcomp(_maxmatfltdiff); - std::set matstraws(strawcomp); - // loop - unsigned nadded(0); - for(auto const& plane : tracker.planes()){ - if(_tracker->planeExists(plane.id())) { - // get an approximate z position for this plane from the average position of the 1st and last straws - auto s0 = plane.origin(); - // find the track position at this z using the reference trajectory - double flt = krep->referenceTraj()->zFlight(s0.z()); - HepPoint pos = krep->referenceTraj()->position(flt); - Hep3Vector posv(pos.x(),pos.y(),pos.z()); - // loop over panels - for(auto panel_p : plane.panels()){ - auto const& panel = *panel_p; - // convert track position into panel coordinates - auto DStoP = panel.dsToPanel(); - auto pposv = DStoP*posv; - // see if this point is roughly in the active region of this panel. Use the z possition as a buffer, to - // account for the test being performed at the plane center. Note the radius cut is made in the Mu2e coordinate system - // this is not a bug! - double pbuff = fabs(pposv.z()); - if(pposv.y() > ymin - pbuff && pposv.y() < ymax + pbuff && fabs(pposv.x()) < umax && posv.perp() < rmax + pbuff) { - if(_debug>2)std::cout << "position " << pposv << " in rough acceptance " << std::endl; - // translate the y position into a rough straw number - int istraw = (int)rint( (pposv.y()-ymin)*spitch); - // take a few straws around this. This value should be configurable FIXME! - for(int is = max(0,istraw-3); is3)std::cout << "Adding Straw " << is << " in panel " << panel.id() << std::endl; - matstraws.insert(StrawFlight(panel.getStraw(is).id(),flt)); - ++nadded; - } - } // acceptance - } // panels - } // plane exists - } // planes - // Now test if the Kalman rep hits these straws - if(_debug>2)std::cout << "Found " << matstraws.size() << " unique possible straws " << " out of " << nadded << std::endl; - unsigned nfound(0); - for(auto const& strawflt : matstraws){ - const DetStrawElem* strawelem = detmodel->strawElem(strawflt._id); - DetIntersection strawinter; - strawinter.delem = strawelem; - strawinter.pathlen = strawflt._flt; - if(strawelem->reIntersect(krep->referenceTraj(),strawinter)){ - // If the rep already has a material site for this element, skip it - std::vector kmats; - krep->findMaterialSites(strawelem,kmats); - if(_debug>2)std::cout << "found intersection with straw " << strawelem->straw()->id() << " with " - << kmats.size() << " materials " << std::endl; - // test material isn't on the track - bool hasmat(false); - for(auto kmat : kmats ){ - const DetStrawElem* kelem = dynamic_cast(kmat->detIntersection().delem); - if(kelem != 0){ - StrawFlight ksflt(kelem->straw()->id(),kmat->globalLength()); - if(_debug>2)std::cout << " comparing flights " << kmat->globalLength() << " and " << strawflt._flt << std::endl; - if(!strawcomp.operator()(strawflt,ksflt)){ - if(_debug>2)std::cout << "operator returned false!!" << std::endl; - // this straw is already on the track: stop - hasmat = true; - nfound++; - break; - } - } - } - if(kmats.size() == 0 || !hasmat) { - if(_debug>2)std::cout << "Adding material element" << std::endl; - // this straw doesn't have an entry in the Kalman fit: add it` - DetIntersection detinter(strawelem, krep->referenceTraj(),strawflt._flt); - krep->addInter(detinter); - ++retval; - } - } - } - if(_debug>1)std::cout << "Added " << retval << " new material sites; found " << nfound << " intersections out of " << krep->nActive() << " active hits " << std::endl; - return retval; - } - - bool - KalFit::weedHits(KalFitData& kalData, int iter) { - // Loop over HoTs and find HoT with largest contribution to chi2. If this value - // is greater than some cut value, deactivate that HoT and reFit - KalRep* krep = kalData.krep; - bool retval(false); - double worst = -1.; - // TrkHit* worsthit = 0; - TrkStrawHit *worsthit = 0; - TrkHitVector *thv = &(krep->hitVector()); - - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - // TrkHit* hit = *ihit; - TrkStrawHit*hit = dynamic_cast(*ihit); - if (hit == 0) continue; - if (hit->isActive()) { - double resid, residErr; - if(hit->resid(resid, residErr, true)){ - double value = fabs(resid/residErr); - if (value > _maxhitchi && value > worst) { - worst = value; - worsthit = hit; - } - } - } - } - - if (iter == -1) iter = _ambigresolver.size()-1; - - if(0 != worsthit){ - retval = true; - worsthit->setActivity(false); - worsthit->setFlag(TrkHit::weededHit); - if (_resolveAfterWeeding) { - //----------------------------------------------------------------------------- - // _resolveAfterWeeding=0 makes changes in the logic fully reversible - //----------------------------------------------------------------------------- - _ambigresolver[iter]->resolveTrk(krep); - } - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitWeed"); - - if (_debug > 0) { - char msg[200]; - sprintf(msg,"KalFit::weedHits Iteration = %2i success = %i",iter,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - - // Recursively iterate - kalData.nweediter++; - if (fitstat.success() && kalData.nweediter < _maxweed) { - retval |= weedHits(kalData,iter); - } - } - return retval; - } - - bool - KalFit::unweedHits(KalFitData& kalData, double maxchi) { - bool retval = unweedBestHit(kalData, maxchi); - // if any hits were added, re-analyze ambiguity - if (retval && _resolveAfterWeeding) { - KalRep* krep = kalData.krep; - // 2015-04-12 P.Murat: '_resolveAfterWeeding' is here to make my changes fully reversible - // I think, resolving ambiguities before each fit, makes a lot of sense - // - // Moved to after iteration: PanelAmbig resolver can change the state of hit resulting in infinte - // loop if the resolver is called each iteration - int last = _herr.size()-1; - _ambigresolver[last]->resolveTrk(krep); - if(!krep->fitCurrent()){ - // if this changed the track state, refit it - krep->resetFit(); - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitUnWeedResolver"); - - if (_debug > 0) { - char msg[200]; - sprintf(msg,"KalFit::unweedHits Iteration = %2i success = %i",last,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - } - } - return retval; - } - - bool - KalFit::unweedBestHit(KalFitData& kalData, double maxchi) { - // Loop over inactive HoTs and find the one with the smallest contribution to chi2. If this value - // is less than some cut value, reactivate that HoT and reFit - KalRep* krep = kalData.krep; - bool retval(false); - double best = 1.e12; - // no need to cast - TrkHit* besthit = 0; - const TrkHitVector* thv = &(krep->hitVector()); - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkHit* hit = *ihit; - if (!hit->isActive()) { - double resid, residErr; - if(hit->resid(resid, residErr, true)){ - double chival = fabs(resid/residErr); - // test both for a good chisquared and for the drift radius to be physical - if (chival < maxchi && hit->isPhysical(maxchi) && chival < best) { - best = chival; - besthit = hit; - } - } - } - } - if(0 != besthit){ - retval = true; - besthit->setActivity(true); - besthit->setFlag(TrkHit::unweededHit); - int oldndof = krep->nDof(); - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitUnWeed"); - if (fitstat.success() && besthit->isActive() && krep->nDof() > oldndof) { - // Recursively iterate - retval |= unweedBestHit(kalData, maxchi); - } - } - return retval; - } - - //-------------------------------------------------------------------------------- - // This function uses the KalRep for searching for the calorimeter disk where - // the track is supposed to impact - //-------------------------------------------------------------------------------- - void - KalFit::findCaloDiskFromTrack(KalFitData& kalData, int& trkToCaloDiskId, double& caloFlt){ - KalRep*krep = kalData.krep; - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - float zExtrapolStep = (_zmaxcalo[0] - _zmincalo[0])/(float)_nCaloExtrapolSteps; - - //initialize the output values - trkToCaloDiskId = -1; - caloFlt = 0; - - float fltIn(0), fltOut(0); - for (unsigned i=0; i<_nCaloDisks; ++i){ - for (unsigned j=0; j<_nCaloExtrapolSteps; ++j){ - double flt(0); - double zCaloExtrap = _zmincalo[i] + j*zExtrapolStep; - TrkHelixUtils::findZFltlen(*reftraj, zCaloExtrap, flt); - HepPoint pos = krep->referenceTraj()->position(flt); - float radius = sqrt(pos.x()*pos.x() + pos.y()*pos.y()); - if ( (radius >= _rmincalo[i]) && (radius <= _rmaxcalo[i])){ - if (trkToCaloDiskId<0) { - trkToCaloDiskId = i; - fltIn = flt; - }else { - fltOut = flt; - } - } - }//end loop over the z-steps - if (trkToCaloDiskId>=0) break; - }//end loop over tghe disks - if (trkToCaloDiskId >= 0) caloFlt = fltOut - fltIn; - } - - - //-------------------------------------------------------------------------------- - // This function loops over the CaloClusterCollection to search for a Cluster - // compatible with the Track. If the Cluster energy was below the threshold, - // no Cluster was added in the TimeClusterFinder module - //-------------------------------------------------------------------------------- - int - KalFit::addTrkCaloHit( Mu2eDetector::cptr_t detmodel, KalFitData& kalData) { - int retval(-1); - //extrapolate the track to the calorimeter region - //to understand on which disk the track is supposed to impact - int trkToCaloDiskId(-1); - double trkInCaloFlt(0); - findCaloDiskFromTrack(kalData, trkToCaloDiskId, trkInCaloFlt); - if (trkToCaloDiskId >= 0 && //the Track doesn't intercept the calorimeter - fabs(trkInCaloFlt) > _mintchtrkpath) { //FIX ME! should we check the second disk in case the track-path in the first is too small? - KalRep* krep = kalData.krep; - double minFOM(1e10); - const CaloCluster*cl(0); - std::unique_ptr tchFinal; - mu2e::GeomHandle ch; - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - - unsigned nClusters = kalData.caloClusterCol->size(); - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - double flt0 = krep->flt0(); - double tflt(0), flt(0); - if (trkToCaloDiskId>=0){ - //evaluate the flight length at the z of the calorimeter cluster + half crystallength - TrkHelixUtils::findZFltlen(*reftraj, (_zmincalo[trkToCaloDiskId]+0.5*crystalLength),flt); - //evaluate the transittime using the full trajectory - tflt = krep->t0()._t0 + krep->transitTime(flt0, flt); - } - - for (unsigned icc=0; iccat(icc); - if (cl->diskID() != trkToCaloDiskId || - cl->energyDep() < _mintchenergy) continue; - // double hflt(0.0); - Hep3Vector cog = ch->geomUtil().mu2eToTracker(ch->geomUtil().diskFFToMu2e( cl->diskID(), cl->cog3Vector())); - double dt = cl->time() + _ttcalc.trkToCaloTimeOffset() - tflt; - - //check the compatibility of the track and time within a given time window - if (fabs(dt) > _maxtchdt) continue; - - HitT0 ht0; - ht0._t0 = tflt; - // initial error can't be better than the input error - ht0._t0err = _ttcalc.caloClusterTimeErr(); - - Hep3Vector clusterAxis = Hep3Vector(0, 0, 1);//FIXME! should come from crystal - // construct a temporary TrkCaloHit. This is just to be able to call POCA - TrkLineTraj hitTraj(HepPoint(cog.x(), cog.y(), cog.z()), - clusterAxis, 0.0, crystalLength); - //evaluate the doca - TrkPoca poca(krep->traj(),flt,hitTraj,0.5*crystalLength); - double doca = poca.doca(); - double depth = poca.flt2(); - if( doca > _mindocatch && doca < _maxdocatch && - depth > _mindepthtch && depth < _maxdepthtch && - fabs(doca) < minFOM) { - tchFinal.reset(new TrkCaloHit(*cl, cog, crystalLength, clusterAxis, - ht0, poca.flt1(), - _calHitW, _caloHitErr, - _ttcalc.caloClusterTimeErr(), _ttcalc.trkToCaloTimeOffset())); - minFOM = doca; // this should be some combination of energy, DOCA, etc FIXME! - retval = icc; - } - } - - if (tchFinal != 0) { - - //add the TrkCaloHit - krep->addHit(tchFinal.release()); - - TrkErrCode fitstat = fitIteration(detmodel,kalData,_herr.size()-1); - krep->addHistory(fitstat,"AddHits"); - } - } - - return retval; - - } - - void - KalFit::fillTchDiag(KalFitData& kalData){ - KalRep* krep = kalData.krep; - TrkHitVector *thv = &(krep->hitVector()); - - mu2e::GeomHandle ch; - double crystalLength = ch->caloInfo().getDouble("crystalZLength"); - - const TrkDifPieceTraj* reftraj = krep->referenceTraj(); - double flt0 = krep->flt0(); - - //evaluate the track-path length in the calorimeter - int trkToCaloDiskId(-1); - double trkInCaloFlt(0); - findCaloDiskFromTrack(kalData, trkToCaloDiskId, trkInCaloFlt); - - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkCaloHit*hit = dynamic_cast(*ihit); - if (hit == 0) continue; - if (hit->isActive()) { - //evaluate the flight length at the z of the calorimeter cluster + half crystallength - unsigned diskId = hit->caloCluster().diskID(); - double flt(0); - TrkHelixUtils::findZFltlen(*reftraj, (_zmincalo[diskId]+0.5*crystalLength),flt); - //evaluate the transittime using the full trajectory - double tflt = krep->t0()._t0 + krep->transitTime(flt0, flt); - double dt = hit->caloCluster().time() + _ttcalc.trkToCaloTimeOffset() - tflt; - - kalData.diag.diskId = diskId; - kalData.diag.depth = hit->hitLen(); - kalData.diag.dt = dt; - kalData.diag.trkPath = trkToCaloDiskId == (int)diskId ? trkInCaloFlt : -9999; - kalData.diag.energy = hit->caloCluster().energyDep(); - kalData.diag.doca = hit->poca().doca(); - } - } - } - - bool - KalFit::weedTrkCaloHit(KalFitData& kalData, int iter) { - // check if the TrkCaloHit residuals is within a given limit - KalRep* krep = kalData.krep; - bool retval(false); - // double worst = -1.; - TrkCaloHit *worsthit = 0; - TrkHitVector *thv = &(krep->hitVector()); - - for (auto ihit=thv->begin();ihit!=thv->end(); ++ihit){ - TrkCaloHit*hit = dynamic_cast(*ihit); - if (hit == 0) continue; - if (hit->isActive()) { - //evaluate the doca - double doca = hit->poca().doca(); - //evaluate the crystal depth - double depth = hit->hitLen(); - if( (doca < _mindocatch ) || (doca > _maxdocatch) || - (depth < _mindepthtch) || (depth > _maxdepthtch)) { - worsthit = hit; - break; - } - } - } - - if (iter == -1) iter = _ambigresolver.size()-1; - - if(0 != worsthit){ - retval = true; - worsthit->setActivity(false); - worsthit->setFlag(TrkHit::weededHit); - if (_resolveAfterWeeding) { - //----------------------------------------------------------------------------- - // _resolveAfterWeeding=0 makes changes in the logic fully reversible - //----------------------------------------------------------------------------- - _ambigresolver[iter]->resolveTrk(krep); - } - TrkErrCode fitstat = krep->fit(); - krep->addHistory(fitstat, "HitWeed"); - - if (_debug > 0) { - char msg[200]; - sprintf(msg,"KalFit::weedTrkCaloHit Iteration = %2i success = %i",iter,fitstat.success()); - _printUtils->printTrack(kalData.event,kalData.krep,"banner+data+hits",msg); - } - - } - - kalData.nweedtchiter++; - return retval; - } - - BField const& - KalFit::bField() const { - if(_bfield == 0){ - if(_fieldcorr){ - // create a wrapper around the mu2e field - _bfield = new BaBarMu2eField(); - } else { - // create a fixed field using the field at the tracker origin - GeomHandle bfmgr; - GeomHandle det; - // change coordinates to mu2e - CLHEP::Hep3Vector vpoint(0,0,0); - CLHEP::Hep3Vector vpoint_mu2e = det->toMu2e(vpoint); - CLHEP::Hep3Vector field = bfmgr->getBField(vpoint_mu2e); - _bfield=new BFieldFixed(CLHEP::Hep3Vector(0.0,0.0,field.z())); - assert(_bfield != 0); - } - } - return *_bfield; - } - - const TrkVolume* - KalFit::trkVolume(trkDirection trkdir) const { - //FIXME!!!! - return 0; - } - - - bool - KalFit::updateT0(KalFitData& kalData, int iter){ - KalRep* krep = kalData.krep; - using namespace boost::accumulators; - TrkHitVector *thv = &(krep->hitVector()); - bool retval(false); - // need to have a valid fit - if(krep->fitValid()){ - // find the global fltlen associated with z=0. - double flt0(0.0); - bool converged = TrkHelixUtils::findZFltlen(krep->traj(),0.0,flt0); - if(converged){ - std::vector hitt0, hitt0err; // store t0, to allow outlyer removal - size_t nhits = krep->hitVector().size(); - hitt0.reserve(nhits); - hitt0err.reserve(nhits); - - if (iter == -1) iter = _herr.size()-1; - accumulator_set,double > wmean; - - // loop over the hits and accumulate t0 - for(auto ihit=thv->begin(); ihit != thv->end(); ihit++){ - TrkHit* hit = *ihit; - bool trkShAmbigOK(true); - if (_ambigstrategy[iter] != 0) { - TrkStrawHit* trkSh = dynamic_cast(*ihit); - if (trkSh !=0){ - if (trkSh->ambig() == 0) - trkShAmbigOK = false; - } - } - if(hit->isActive() && trkShAmbigOK) { - HitT0 st0; - // if (hit->signalPropagationTime(st0 )){ - if (hit_time(hit, st0)){//2019-04-22: this function will become TrkHit::time(HitT0& hitT0) in the fututre development. FIXME! - // subtracting hitT0 makes this WRT the previous track t0 - double dtHitToTrack = st0._t0 - krep_hitT0(krep, hit)._t0;//FIXME! KalRep should own this function - wmean(dtHitToTrack, weight=1.0/(st0._t0err*st0._t0err)); - - } - } - } - - TrkT0 t0; // null t0; this will be the change in t0 from this update - unsigned nused = extract_result(wmean); - t0._t0 = extract_result(wmean); - t0._t0err = sqrt(extract_result(wmean)/nused); - - // put in t0 from the track. - t0._t0 += krep->t0()._t0; - krep->setT0(t0,flt0); - updateHitTimes(krep); - retval = true; - - } - } - return retval; - } - - void KalFit::updateHitTimes(KalRep* krep) { - // compute the time the track came closest to the sensor for each hit, starting from t0 and working out. - // this function allows for momentum change along the track. - // find the bounding hits on either side of this - TrkHitVector *thv = &(krep->hitVector()); - std::sort(thv->begin(),thv->end(),fcomp()); - TrkHitVector::iterator ihigh; - TrkHitVector::reverse_iterator ilow; - findBoundingHits(krep, krep->flt0(),ilow,ihigh); - // reset all the hit times - double flt0 = krep->flt0(); - HitT0 hitt0 = krep->t0(); - //GIANIPEZ 2019-04-26: update the following loops in the bottom using the function kres_hitt0//FIXME! - for(TrkHitVector::iterator ihit= ihigh;ihit != thv->end(); ++ihit){ - TrkHit* hit = *ihit; - double flt1 = hit->fltLen(); - // particle transit time to this hit from the reference - double tflt = krep->transitTime(flt0, flt1); - // update the time in the TrkT0 object - hitt0._t0 += tflt; - (*ihit)->setHitT0(hitt0); - // update the reference flightlength - flt0 = flt1; - } - // now the same, moving backwards. - flt0 = krep->flt0(); - hitt0 = krep->t0(); - for(TrkHitVector::reverse_iterator ihit= ilow;ihit != thv->rend(); ++ihit){ - TrkHit* hit = *ihit; - double flt1 = hit->fltLen(); - double tflt = krep->transitTime(flt0, flt1); - hitt0._t0 += tflt; - (*ihit)->setHitT0(hitt0); - flt0 = flt1; - } - } - - void KalFit::findBoundingHits(KalRep* krep,double flt0, - TrkHitVector::reverse_iterator& ilow, - TrkHitVector::iterator& ihigh) { - TrkHitVector* hits = &(krep->hitVector()); - ilow = hits->rbegin(); - ihigh = hits->begin(); - while(ilow != hits->rend() && (*ilow)->fltLen() > flt0 )++ilow; - while(ihigh != hits->end() && (*ihigh)->fltLen() < flt0 )++ihigh; - } - - // attempt to extend the fit to the specified location - TrkErrCode KalFit::extendFit(KalRep* krep) { - TrkErrCode retval; - // find the downstream and upstream Z positions to extend to - if(_exdown != noextension){ - double downz = extendZ(_exdown); - // convert to flightlength using the fit trajectory - double downflt = krep->pieceTraj().zFlight(downz); - // actually extend the track - retval = krep->extendThrough(downflt); - } - // same for upstream extension - if(retval.success() && _exup != noextension){ - double upz = extendZ(_exup); - double upflt = krep->pieceTraj().zFlight(upz); - retval = krep->extendThrough(upflt); - } - return retval; - } - - double KalFit::extendZ(extent ex) { - double retval(0.0); - if(ex == target){ - GeomHandle target; - GeomHandle det; - retval = det->toDetector(target->centerInMu2e()).z() - 0.5*target->cylinderLength(); - } else if(ex == ipa) { - // the following is wrong FIXME!! - GeomHandle target; - GeomHandle det; - retval = det->toDetector(target->centerInMu2e()).z() + 0.5*target->cylinderLength(); - } else if(ex == tracker) { - retval = 0.0; - } else if(ex == calo) { - GeomHandle cg; - return cg->caloInfo().getDouble("envelopeZ1"); - } - return retval; - } - - HitT0 KalFit::krep_hitT0(KalRep*krep, const TrkHit*hit){ - HitT0 t0; - double flt0 = krep->flt0(); - double flt1 = hit->fltLen(); - // particle transit time to this hit from the reference - double tflt = krep->transitTime(flt0, flt1); - t0._t0 = krep->t0()._t0 + tflt; - t0._t0err = krep->t0()._t0err;//the error contribution from the *tflt* term is neglected. In the last fit iteration we might be considering adding a contribution from *tlft* - return t0; - } - - - //-------------------------------------------------------------------------------- - // - //-------------------------------------------------------------------------------- - bool KalFit::hit_time(TrkHit*hit, HitT0& hitT0){ - TrkT0 st0; - if (hit->signalPropagationTime(st0)){ - hitT0._t0 = hit->time() - st0._t0; - hitT0._t0err = st0._t0err; - return true; - }else { - return false; - } - } - - } From b329b893c95069168d51060b908e9cddaa05c4ae Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 15:32:29 -0800 Subject: [PATCH 108/174] Fixes --- TrkPatRec/src/SConscript | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/TrkPatRec/src/SConscript b/TrkPatRec/src/SConscript index 32bf3340cb..58e03e2d38 100644 --- a/TrkPatRec/src/SConscript +++ b/TrkPatRec/src/SConscript @@ -17,11 +17,6 @@ helper = mu2e_helper(env) mainlib = helper.make_mainlib([ 'mu2e_TrkReco', -<<<<<<< HEAD - 'mu2e_ConditionsService', -======= - 'mu2e_BTrkData', ->>>>>>> main 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', @@ -53,11 +48,6 @@ mainlib = helper.make_mainlib([ helper.make_plugins([mainlib, 'mu2e_Mu2eUtilities', 'mu2e_TrkReco', -<<<<<<< HEAD - 'mu2e_ConditionsService', -======= - 'mu2e_BTrkData', ->>>>>>> main 'mu2e_TrackerConditions', 'mu2e_GeometryService', 'mu2e_BFieldGeom', From 8d8c65eee639e0fc4e50992c45f456fb7a70c713 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 15:40:56 -0800 Subject: [PATCH 109/174] More fixes --- ParticleID/src/ParticleID_module.cc | 447 ---------------------------- 1 file changed, 447 deletions(-) delete mode 100644 ParticleID/src/ParticleID_module.cc diff --git a/ParticleID/src/ParticleID_module.cc b/ParticleID/src/ParticleID_module.cc deleted file mode 100644 index 7cf41adc08..0000000000 --- a/ParticleID/src/ParticleID_module.cc +++ /dev/null @@ -1,447 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// $Id: -// $Author: -// $Date: -// -// Original author Vadim Rusu -// -// 2015-01-23 P.Murat: default condiguration is stored in ParticleID/fcl/prolog.fcl -/////////////////////////////////////////////////////////////////////////////// -// C++ includes. -#include -#include -#include - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Run.h" -#include "art/Framework/Principal/Handle.h" -#include "art_root_io/TFileService.h" -#include "fhiclcpp/ParameterSet.h" - -//ROOTs -#include "TH1F.h" -#include "TTree.h" -#include "TNtuple.h" -#include "TF1.h" -#include "TGraphErrors.h" -#include "TMinuit.h" -#include "TFile.h" -#include "TApplication.h" -#include "TCanvas.h" -#include "TDirectory.h" -#include "TROOT.h" -#include "TStyle.h" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "BTrk/TrkBase/TrkParticle.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -#include "BTrk/KalmanTrack/KalHit.hh" -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/RecoDataProducts/inc/PIDProduct.hh" - -#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" - -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" - -#include "Offline/ParticleID/inc/PIDUtilities.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -using namespace std; - -namespace mu2e { - -TGraphErrors *error; - - //compute sum of squares of residuals -void myfcn(Int_t &, Double_t *, Double_t &f, Double_t *par, Int_t) { - //minimisation function computing the sum of squares of residuals - Int_t np = error->GetN(); - f = 0; - Double_t *x = error->GetX(); - Double_t *y = error->GetY(); - Double_t *ey = error->GetEY(); - // Double_t *ey = error->GetEY(); - - for (Int_t i=0;ipathbounds[0] && d<=pathbounds[1]) return 0; - else if (d>pathbounds[1] && d<=pathbounds[2]) return 1; - else if (d>pathbounds[2] && d<=pathbounds[3]) return 2; - else if (d>pathbounds[3] && d<=pathbounds[4]) return 3; - else if (d>pathbounds[4] && d<=pathbounds[5]) return 4; - else if (d>pathbounds[5] && d<=pathbounds[6]) return 5; - else if (d>pathbounds[6] && d<=pathbounds[7]) return 6; - else if (d>pathbounds[7] && d<=pathbounds[8]) return 7; - else if (d>pathbounds[8] && d<=pathbounds[9]) return 8; - else if (d>pathbounds[9] && d<=pathbounds[10]) return 9; - else if (d>pathbounds[10]) return 10; - - else - { cout<<"Out of bounds. Should never end up here\n"; return -9999.;} - -} - - class ParticleID : public art::EDProducer { - - public: - explicit ParticleID(fhicl::ParameterSet const& pset); - virtual ~ParticleID() { } - void beginJob(); - void beginRun(art::Run &run); - void beginSubRun(art::SubRun & lblock ); - virtual void produce(art::Event& event); - void endJob(); - - private: - - PIDProduct _pid; - - int _processed_events; - int _evtid; - - std::string _fitterModuleLabel; - std::string _electronTemplateFile; - std::string _muonTemplateFile; - - ProditionsHandle _mu2eDetector_h; - - TrkParticle _tpart; - TrkFitDirection _fdir; - - int _trkid; - double _trkmom; - double _residualsSlope; - double _residualsSlopeError; - double _logeprob; - double _logmprob; - - int _debugLevel; - int _verbosity; - int _diagLevel; - bool _doDisplay; - - std::string _electrontemplates; - std::string _muontemplates; - - TH1D* _heletemp[nbounds]; - TH1D* _hmuotemp[nbounds]; - - int _templatesnbins ; - float _templateslastbin ; - float _templatesbinsize ; - - TTree * _pidtree; - TCanvas* _plotCanvas; - - bool calculateSlope(std::vectorvresd,std::vectorvflt, - std::vectorevresd,std::vectorevflt, - double * slope, - double * eslope); - - double calculateProb(std::vectorgaspaths, std::vectoredeps, TH1D** templates); - - unique_ptr _application; - - // Save directory from beginJob so that we can go there in endJob. - TDirectory* _directory; - }; - - ParticleID::ParticleID(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _fitterModuleLabel (pset.get("fitterModuleLabel")), - _electronTemplateFile(pset.get("ElectronTemplates")), - _muonTemplateFile (pset.get("MuonTemplates" )), - _tpart ((TrkParticle::type) (pset.get("fitparticle" ))), - _fdir ((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - _debugLevel(pset.get("debugLevel", 0 )), - _verbosity(pset.get ("verbosity" , 0 )), - _diagLevel(pset.get ("diagLevel" , 0 )), - _doDisplay(pset.get("doDisplay" ,false)), - _pidtree(0), - _plotCanvas(0) - { - _processed_events = -1; - - produces(); - - // location-independent files - ConfigFileLookupPolicy configFile; - - _electrontemplates = configFile(_electronTemplateFile); - _muontemplates = configFile(_muonTemplateFile ); - - char name[50]; - TFile* electrontemplatefile = TFile::Open(_electrontemplates.c_str()); - for (int i = 0; i < nbounds; i++){ - sprintf(name,"htempe%d",i); - electrontemplatefile->GetObject(name,_heletemp[i]); - } - - TFile* muontemplatefile = TFile::Open(_muontemplates.c_str()); - for (int i = 0; i < nbounds; i++){ - sprintf(name,"htempm%d",i); - muontemplatefile->GetObject(name,_hmuotemp[i]); - } - - _templatesnbins = _heletemp[0]->GetNbinsX(); - _templateslastbin = _heletemp[0]->GetBinLowEdge(_templatesnbins)+_heletemp[0]->GetBinWidth(1); - _templatesbinsize = _heletemp[0]->GetBinWidth(1); - - } - - void ParticleID::beginJob(){ - - // histograms - - art::ServiceHandle tfs; - - if (_diagLevel) { - _pidtree = tfs->make("PID", "PID info"); - _pidtree->Branch("trkid" , &_trkid , "trkid/I"); - _pidtree->Branch("slope" , &_residualsSlope , "slope/D"); - _pidtree->Branch("errslope", &_residualsSlopeError, "errslope/D"); - _pidtree->Branch("p" , &_trkmom , "trkmom/D"); - _pidtree->Branch("logeprob", &_logeprob , "logeprob/D"); - _pidtree->Branch("logmprob", &_logmprob , "logmprob/D"); - } - - if(_doDisplay) { - // If needed, create the ROOT interactive environment. See note 1. - if ( !gApplication ){ - int tmp_argc(0); - char** tmp_argv(0); - _application = unique_ptr(new TApplication( "noapplication", &tmp_argc, tmp_argv )); - } - - gStyle->SetPalette(1); - gROOT->SetStyle("Plain"); - gStyle->SetOptFit(1); - gStyle->SetMarkerStyle(22); - - _plotCanvas = new TCanvas("plots","PID Plots",600,400); - } - } - - void ParticleID::beginRun(art::Run & run){ - if (_verbosity>=2) cout << "ParticleID: From beginRun: " << run.id().run() << endl; - - } - - void ParticleID::beginSubRun(art::SubRun & lblock ) { - if (_verbosity>=2) cout << "ParticleID: From beginSubRun. " << endl; - } - - void ParticleID::endJob(){ - if (_verbosity>=2) cout << "ParticleID: From endJob. " << endl; - if (_doDisplay) delete _plotCanvas; - - } - -////////// Produce /////////// - - void ParticleID::produce(art::Event& event) { - - auto detmodel = _mu2eDetector_h.getPtr(event.id()); - - _evtid = event.id().event(); - ++_processed_events; - if (_processed_events%100 == 0) { - if (_verbosity>=1) cout << "ParticleID: processing " << _processed_events << "-th event at evtid=" << _evtid << endl; - } - if (_verbosity>=2) cout << "ParticleID: processing " << _processed_events << "-th event at evtid=" << _evtid << endl; - - unique_ptr pids(new PIDProductCollection ); - - art::Handle trksHandle; - event.getByLabel(_fitterModuleLabel,trksHandle); - const KalRepPtrCollection* const trks = trksHandle.product(); - - if (!trksHandle.isValid()) { - if (_verbosity>=1) cout << "ParticleID : " << "no" << " obj for " << _fitterModuleLabel.c_str() << " of event " << _evtid << endl; - } - - if (trks->size() >0) { - if (_verbosity>=1) cout << "ParticleID : " << trks->size() << " obj for " << _fitterModuleLabel.c_str() << " of event " << _evtid << endl; - } - - for ( size_t i=0; i< trks->size(); ++i ){ - - _trkid = i; - const KalRep* krep = trks->at(i).get(); - - double firsthitfltlen = krep->firstHit()->kalHit()->hit()->fltLen() - 10; - double lasthitfltlen = krep->lastHit()->kalHit()->hit()->fltLen() - 10; - double entlen = std::min(firsthitfltlen,lasthitfltlen); - _trkmom = krep->momentum(entlen).mag(); - - std::vector kalsites= krep->siteList(); - - std::vector vresd; - std::vector vflt; - std::vector evflt; - std::vector evresd; - std::vector gaspaths; - std::vector edeps; - - for(unsigned isite=0;isitetype() == KalSite::hitSite){ - - TrkStrawHit* hit = dynamic_cast(ksite->kalHit()->hit()); - double resid, residerr; - hit->resid(resid,residerr,true); - - bool activehit = hit->isActive(); - if (activehit){ - double aresd = (hit->poca().doca()>0?resid:-resid); - double normflt = hit->fltLen() - krep->flt0(); - double normresd = aresd/residerr; - - vresd.push_back(normresd); - vflt.push_back(normflt); - evresd.push_back(1.); - evflt.push_back(0.1); - - // 2. * here because KalmanFit reports half the path through gas. - const DetStrawElem* strawelem = detmodel->strawElem(hit->straw()); - gaspaths.push_back(2. * strawelem->gasPath(hit->driftRadius(),hit->trkTraj()->direction( hit->fltLen() ))); - - edeps.push_back(hit->comboHit().energyDep()); - - } - } - } - - calculateSlope(vresd,vflt,evresd,evflt,&_residualsSlope,&_residualsSlopeError); - - double eprob = calculateProb(gaspaths, edeps, _heletemp); - double muprob = calculateProb(gaspaths, edeps, _hmuotemp); - - _logeprob = log(eprob); - _logmprob = log(muprob); - - if(_diagLevel) - _pidtree->Fill(); - - _pid.clear(); - _pid.SetTrkID(_trkid); - _pid.SetResidualsSlope(_residualsSlope); - _pid.SetResidualsSlopeError(_residualsSlopeError); - _pid.SetLogEProb(_logeprob); - _pid.SetLogMProb(_logmprob); - - pids->push_back(_pid); - - } // end of trks loop - event.put(std::move(pids)); - - } - - double ParticleID::calculateProb(std::vectorgaspaths, std::vectoredeps, TH1D** templates){ - - static const double _minpath = 0.5; - static const double _maxpath = 10.; - - double thisprob = 1; - - for (unsigned int ipath = 0; ipath < gaspaths.size(); ipath++){ - double thispath = gaspaths.at(ipath); - double thisedep = edeps.at(ipath); - - double tmpprob = 0; - if (thispath > _minpath && thispath<=_maxpath){ - int lowhist = findlowhist(thispath); - - PIDUtilities util; - TH1D* hinterp = util.th1dmorph(templates[lowhist],templates[lowhist+1],pathbounds[lowhist],pathbounds[lowhist+1],thispath,1,0); - //what is the probability for this edep - int thisedepbin = -999; - if (thisedep > _templateslastbin) thisedepbin = _templatesnbins; - else - thisedepbin = int(thisedep/_templatesbinsize)+1; - - tmpprob=hinterp->GetBinContent(thisedepbin); - - if (_doDisplay){ - templates[lowhist]->Draw(); - templates[lowhist+1]->Draw("same"); - hinterp->SetLineColor(2); - hinterp->Draw("same"); - _plotCanvas->WaitPrimitive(); - } - hinterp->Delete(); - } - - if (tmpprob> 0) - thisprob = thisprob * tmpprob; - - } - - return thisprob; - - } - - bool ParticleID::calculateSlope(std::vectorvresd,std::vectorvflt,std::vectorevresd,std::vectorevflt, double * slope, double * eslope) { - - error = new TGraphErrors(vresd.size(),vflt.data(),vresd.data(),evflt.data(),evresd.data()); - - TMinuit *gmMinuit = new TMinuit(2); - gmMinuit->SetPrintLevel(-1); - gmMinuit->SetFCN(myfcn); - const int dim(2); - const char par_name[dim][20]={"offset","slope"}; - static Double_t step[dim] = {0.001,0.001}; - Double_t sfpar[dim]={0.0,0.005}; - Double_t errsfpar[dim]={0.0,0.0}; - int ierflg = 0; - for (int ii = 0; iimnparm(ii,par_name[ii],sfpar[ii], step[ii], 0,0,ierflg); - } - gmMinuit->FixParameter(0); - gmMinuit->Migrad(); - bool converged = gmMinuit->fCstatu.Contains("CONVERGED"); - if (!converged) - { - cout <<"-----------TOF Linear fit did not converge---------------------------" <GetParameter(i,sfpar[i],errsfpar[i]); - } - - *slope = sfpar[1]; - *eslope = errsfpar[1]; - - if (_doDisplay){ - error->Draw("AP"); - _plotCanvas->WaitPrimitive(); - } - - delete error; - - return converged; - } - -} // end namespace mu2e - -using mu2e::ParticleID; -DEFINE_ART_MODULE(ParticleID) From bfb244a11d5546529f18a4887cf41dfb51826378 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 15:50:32 -0800 Subject: [PATCH 110/174] More re-deletion --- TrackCaloMatching/CMakeLists.txt | 61 -- TrackCaloMatching/src/SConscript | 72 --- .../src/TrackCaloMatching_module.cc | 522 ---------------- TrackCaloMatching/src/TrkExtrapol_module.cc | 581 ------------------ TrkPatRec/src/KalSeedFit_module.cc | 567 ----------------- 5 files changed, 1803 deletions(-) delete mode 100644 TrackCaloMatching/CMakeLists.txt delete mode 100644 TrackCaloMatching/src/SConscript delete mode 100644 TrackCaloMatching/src/TrackCaloMatching_module.cc delete mode 100644 TrackCaloMatching/src/TrkExtrapol_module.cc delete mode 100644 TrkPatRec/src/KalSeedFit_module.cc diff --git a/TrackCaloMatching/CMakeLists.txt b/TrackCaloMatching/CMakeLists.txt deleted file mode 100644 index 1a34098afd..0000000000 --- a/TrackCaloMatching/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -cet_build_plugin(TrackCaloIntersection art::module - REG_SOURCE src/TrackCaloIntersection_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrackCaloIntersectionMVA art::module - REG_SOURCE src/TrackCaloIntersectionMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrackCaloMatchingExtend art::module - REG_SOURCE src/TrackCaloMatchingExtend_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrackCaloMatching art::module - REG_SOURCE src/TrackCaloMatching_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts - ROOT::Physics -) - -cet_build_plugin(TrackCaloMatchingMVA art::module - REG_SOURCE src/TrackCaloMatchingMVA_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::RecoDataProducts -) - -cet_build_plugin(TrkExtrapol art::module - REG_SOURCE src/TrkExtrapol_module.cc - LIBRARIES REG - art_root_io::TFileService_service - Offline::CalorimeterGeom - Offline::GeometryService - Offline::MCDataProducts - Offline::RecoDataProducts - Offline::TrackerGeom -) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcl/prolog.fcl ${CURRENT_BINARY_DIR} fcl/prolog.fcl COPYONLY) - -install_source(SUBDIRS src) -install_fhicl(SUBDIRS fcl SUBDIRNAME Offline/TrackCaloMatching/fcl) diff --git a/TrackCaloMatching/src/SConscript b/TrackCaloMatching/src/SConscript deleted file mode 100644 index 9947990e53..0000000000 --- a/TrackCaloMatching/src/SConscript +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -# Original author Rob Kutschke. -# - -Import('env') - -Import('mu2e_helper') - -helper=mu2e_helper(env) - -extrarootlibs = ['TMVA'] -rootlibs = env['ROOTLIBS'] -babarlibs = env['BABARLIBS'] - -mainlib = helper.make_mainlib ( [ - 'mu2e_TrkReco', - 'mu2e_BTrkData', - 'mu2e_Mu2eBTrk', - 'mu2e_GeometryService', - 'mu2e_CalorimeterGeom', - 'mu2e_RecoDataProducts', - 'mu2e_DataProducts', - babarlibs, - rootlibs, - 'art_Framework_Services_Registry', - 'art_Persistency_Provenance', - 'art_Persistency_Common', - 'art_Utilities', - 'canvas', - 'CLHEP', - 'cetlib', - 'cetlib_except', - ] ) - -helper.make_plugins( [ - mainlib, - 'mu2e_GeometryService', - 'mu2e_MCDataProducts', - 'mu2e_RecoDataProducts', - 'mu2e_DataProducts', - 'mu2e_CalorimeterGeom', - 'mu2e_TrackerGeom', - 'mu2e_ConfigTools', - babarlibs, - 'art_Framework_Core', - 'art_Framework_Principal', - 'art_Framework_Services_Registry', - 'art_root_io_tfile_support', - 'art_root_io_TFileService', - 'art_Framework_Services_Optional_RandomNumberGenerator', - 'art_Persistency_Common', - 'art_Persistency_Provenance', - 'art_Utilities', - 'canvas', - 'MF_MessageLogger', - 'fhiclcpp', - 'fhiclcpp_types', - 'tbb', - 'cetlib', - 'cetlib_except', - 'CLHEP', - rootlibs, - extrarootlibs, - 'boost_filesystem', - ] ) - - -# This tells emacs to view this file in python mode. -# Local Variables: -# mode:python -# End: diff --git a/TrackCaloMatching/src/TrackCaloMatching_module.cc b/TrackCaloMatching/src/TrackCaloMatching_module.cc deleted file mode 100644 index e31b4c2a79..0000000000 --- a/TrackCaloMatching/src/TrackCaloMatching_module.cc +++ /dev/null @@ -1,522 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Original author G. Pezzullo -// -// 2014-06-03 P.Murat: will no longer work with the vanes-based geometry -// 2015-09-17 P.Murat: use Bertran's extrapolator -/////////////////////////////////////////////////////////////////////////////// - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" - -// conditions -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" - -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" - -#include "Offline/RecoDataProducts/inc/TrkCaloIntersect.hh" -#include "Offline/RecoDataProducts/inc/TrackClusterMatch.hh" - -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" - -#include "BTrk/TrkBase/HelixParams.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -//root includes -#include "TFile.h" -#include "TDirectory.h" -#include "TMath.h" -#include "TVector2.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cetlib/pow.h" -#include "BTrk/BaBar/Constants.hh" - - -using namespace std; -using cet::square; -using cet::sum_of_squares; -using CLHEP::Hep3Vector; - -namespace mu2e { - - class TrackCaloMatching : public art::EDProducer { - private: - - art::ProductToken const _fitterToken; - art::ProductToken const _caloClusterToken; - art::ProductToken const _trkToCaloExtrapolToken; - - int _debugLevel; - - double _minClusterEnergy; // - double _maxDeltaT; // time preselection for track-cluster matching - double _meanInteractionDepth; // path length correction - double _dtOffset; // shift of the Delta(T) distribution - - // resolutions used to calculate chi2's - double _sigmaE; - double _sigmaT; - double _sigmaU; - double _sigmaV; - - double _chi2e, _chi2t, _chi2u, _chi2v; - - // no offset in Y ? - double _solenoidOffSetX; - double _solenoidOffSetZ; - - bool _skipEvent; - bool _firstEvent; - - public: - - explicit TrackCaloMatching(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _fitterToken {consumes (pset.get ("fitterModuleLabel" ))}, - _caloClusterToken {consumes (pset.get("caloClusterModuleLabel" ))}, - _trkToCaloExtrapolToken{consumes(pset.get("trkToCaloExtrapolModuleLabel"))}, - - _debugLevel (pset.get ("debugLevel" )), - _minClusterEnergy (pset.get("minClusterEnergy" )), - _maxDeltaT (pset.get("maxDeltaT" )), - _meanInteractionDepth (pset.get("meanInteractionDepth")), - _dtOffset (pset.get("dtOffset" )), - _sigmaE (pset.get("sigmaE" )), - _sigmaT (pset.get("sigmaT" )), - _sigmaU (pset.get("sigmaU" )), - _sigmaV (pset.get("sigmaV" )), - _firstEvent (true) - { -//----------------------------------------------------------------------------- -// Tell the framework what we make. -//----------------------------------------------------------------------------- - produces(); - } - - void beginJob() override; - void beginRun(art::Run& aRun) override; - void produce (art::Event& e) override; - - void fromTrkToMu2eFrame(HepPoint& vec, CLHEP::Hep3Vector& res); - - void doMatching(art::Event & evt, bool skip); - }; - - - //----------------------------------------------------------------------------- - void TrackCaloMatching::fromTrkToMu2eFrame(HepPoint& vec, Hep3Vector& res) { - res.setX(vec.x() - _solenoidOffSetX); - res.setZ(vec.z() - _solenoidOffSetZ); - res.setY(vec.y()); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::beginJob() { - - if (_debugLevel > 0) { - printf("---- TrackCaloMatching::beginJob constants used: \n" ); - printf(" minClusterEnergy : %10.3f\n",_minClusterEnergy ); - printf(" maxDeltaT : %10.3f\n",_maxDeltaT ); - printf(" meanInteractionDepth : %10.3f\n",_meanInteractionDepth); - printf(" dtOffset : %10.3f\n",_dtOffset ); - } - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::beginRun(art::Run& aRun) { - art::ServiceHandle geom; - - // calculate DS offsets - - _solenoidOffSetX = geom->config().getDouble("mu2e.solenoidOffset"); - _solenoidOffSetZ = -geom->config().getDouble("mu2e.detectorSystemZ0"); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::produce(art::Event & evt) { - doMatching(evt, _skipEvent); - } - - //----------------------------------------------------------------------------- - void TrackCaloMatching::doMatching(art::Event & evt, bool skip) { - constexpr const char* oname = "TrackCaloMatching::doMatching"; - - double cl_x, cl_y, cl_time, cl_energy; - double trk_x, trk_y, trk_mom, trk_time; - double s1, s2, sint, ds; - double nx, ny, dx, dy, du, dv, dt, xu, xv, xt, xe; - double chi2; - constexpr double chi2_max(1.e12); - - int idisk, iex, icl, ltrk; - constexpr int ndisks(2); - - TrackClusterMatch::Data_t tcm_data[100][ndisks]; - - const TrkCaloIntersect *extrk; - const KalRep *krep; - const CaloCluster *cl; - // cp_mu2e: cluster position in the MU2E frame - - CLHEP::Hep3Vector tp_disk, tp_mu2e, cp_mu2e, cp_st; - CLHEP::Hep3Vector mom, pos; - HepPoint point, p1, p2, p12, p_closest; - - const KalRep *kkrep[100]; - int nkkrep(0); - //----------------------------------------------------------------------------- - // Get handle to calorimeter - //----------------------------------------------------------------------------- - art::ServiceHandle geom; - GeomHandle cg; - - auto const& trjExtrapols = evt.getValidHandle(_trkToCaloExtrapolToken); - int const nex = trjExtrapols->size(); - - auto const& trksHandle = evt.getValidHandle(_fitterToken); - const KalRepPtrCollection* trks = trksHandle.product(); - int const ntracks = trks->size(); - - auto const& caloClusters = evt.getValidHandle(_caloClusterToken); - int const nclusters = caloClusters->size(); - - if (_debugLevel > 2) { - printf("%s: Event Number : %8i ntracks: %2i nclusters: %4i nex: %2i\n", - oname,evt.event(), ntracks, nclusters, nex); - } - - unique_ptr tcmcoll(new TrackClusterMatchCollection); - tcmcoll->reserve(nex); - //----------------------------------------------------------------------------- - // here the execution really starts - //----------------------------------------------------------------------------- - if (ntracks == 0) goto END; - - for (int it=0; it 2) { - printf("%s: jex = %5i\n", oname, jex); - } - - extrk = &trjExtrapols->at(jex); - krep = extrk->trk().get(); - //----------------------------------------------------------------------------- - // track index, important: store one, the best, intersection per track per vane - // the absolute ltrk number doesn't really matter - //----------------------------------------------------------------------------- - ltrk = nkkrep; - for (int ik=0; ik 100) { - printf(">>> ERROR in %s: ltrk = %i, skip the rest\n",oname,ltrk); - goto NEXT_INTERSECTION; - } - else if (ltrk < 0) { - printf(">>> ERROR in %s: ltrk = %i, skip the rest\n",oname,ltrk); - goto NEXT_INTERSECTION; - } - //----------------------------------------------------------------------------- - // apparently, ntupling stuff was mixed in, almost removed - //----------------------------------------------------------------------------- - idisk = extrk->diskId(); - // assume Z(middle of the disk) - - s1 = extrk->pathLengthEntrance(); - s2 = extrk->pathLengthExit (); - ds = s2-s1; - // 'sint' - extrapolation length to the interaction point - - if (ds > _meanInteractionDepth) sint = s1+_meanInteractionDepth; - else sint = s2; - - // shower starts developing when the particle - // reaches the disk - trk_time = krep->arrivalTime(sint); - mom = krep->momentum(sint); - - point = krep->position(sint); - mom = krep->momentum(sint); - trk_mom = mom.mag(); - - if (_debugLevel > 2) { - printf("%s: idisk: %5i trk_mom: %10.5f [MeV/c]\n",oname,idisk,trk_mom); - } - // track direction cosines in XY plane - - nx = mom.x()/sqrt(mom.x()*mom.x()+mom.y()*mom.y()); - ny = mom.y()/sqrt(mom.x()*mom.x()+mom.y()*mom.y()); - - // transform track position to Mu2e detector frame - - fromTrkToMu2eFrame(point, tp_mu2e); - - if (_debugLevel > 2){ - } - - tp_disk = cg->geomUtil().mu2eToDisk(idisk,tp_mu2e); - trk_x = tp_disk.x(); - trk_y = tp_disk.y(); - - if(_debugLevel > 2){ - printf("%s: tp_mu2e: %10.4f %10.4f %10.4f tp_disk: %10.4f %10.4f %10.4f\n", - oname, - tp_mu2e.x(),tp_mu2e.y(),tp_mu2e.z(), - tp_disk.x(),tp_disk.y(),tp_disk.z()); - } - //----------------------------------------------------------------------------- - // save track-only information - //----------------------------------------------------------------------------- - tcm_data[ltrk][idisk].xtrk = tp_disk.x(); - tcm_data[ltrk][idisk].ytrk = tp_disk.y(); - tcm_data[ltrk][idisk].ztrk = tp_disk.z(); - tcm_data[ltrk][idisk].ttrk = trk_time; - tcm_data[ltrk][idisk].nx = mom.x()/trk_mom; - tcm_data[ltrk][idisk].ny = mom.y()/trk_mom; - tcm_data[ltrk][idisk].nz = mom.z()/trk_mom; - tcm_data[ltrk][idisk].int_depth = _meanInteractionDepth; - tcm_data[ltrk][idisk].ds = ds; - - //----------------------------------------------------------------------------- - // track helix at Z = Z(middle of the disk) in the tracker frame - //----------------------------------------------------------------------------- - double trk_d0, trk_om, trk_r, trk_phi0, trk_phi1, trk_x0, trk_y0, trk_tandip; - double cp_dx, cp_dy, cp_phi, cp_dphi, delta_x, delta_y, s12, s_cl; - double dds, dz, dr, sint; - - - p1 = krep->position(s1); - p2 = krep->position(s2); - - s12 = (s1+s2)/2; - - p12 = krep->position(s12); - - trk_d0 = krep->helix(s12).d0(); - trk_om = krep->helix(s12).omega(); - trk_r = fabs(1./trk_om); - trk_phi0 = krep->helix(s12).phi0(); - trk_tandip = krep->helix(s12).tanDip(); - trk_x0 = -(1/trk_om+trk_d0)*sin(trk_phi0); - trk_y0 = (1/trk_om+trk_d0)*cos(trk_phi0); - trk_phi1 = atan2(p12.y()-trk_y0,p12.x()-trk_x0); - //----------------------------------------------------------------------------- - // loop over clusters - //----------------------------------------------------------------------------- - for (int icl=0; icltime(); - // move peak to zero - dt = trk_time-cl_time-_dtOffset; - - if (cl->diskID() != idisk ) goto NEXT_CLUSTER; - if (cl->energyDep() < _minClusterEnergy) goto NEXT_CLUSTER; - if (std::fabs(dt) > _maxDeltaT ) goto NEXT_CLUSTER; - //------------------------------------------------------------------------------ - // 2015-03-26: as of now, the cluster coordinates are defined in the local disk - // coordinate system - //----------------------------------------------------------------------------- - cl_x = cl->cog3Vector().x(); - cl_y = cl->cog3Vector().y(); - cl_energy = cl->energyDep(); - //----------------------------------------------------------------------------- - // X and Y - coordinates in the disk system - // rotate them in the direction perpendicular to the track - //----------------------------------------------------------------------------- - dx = trk_x-cl_x; - dy = trk_y-cl_y; - - du = dx*nx+dy*ny; - dv = dx*ny-dy*nx; - //----------------------------------------------------------------------------- - // to study pattern recognition accuracies, calculate track parameters in the - // point closest to the cluster in 2D (XY) - want to understand coordinate and - // angle resolutions - //----------------------------------------------------------------------------- - cp_mu2e = cg->geomUtil().diskToMu2e(idisk,cl->cog3Vector()); - cp_st = cg->geomUtil().mu2eToTracker(cp_mu2e); - - cp_dx = cp_st.x()-trk_x0; - cp_dy = cp_st.y()-trk_y0; - // cluster phi wrt helix center - cp_phi = atan2(cp_dy,cp_dx); - cp_dphi = TVector2::Phi_mpi_pi(cp_phi-trk_phi1); - - // radial distance - - dr = sqrt(cp_dx*cp_dx+cp_dy*cp_dy)-trk_r; - delta_x = dr*cos(cp_dphi); - delta_y = dr*sin(cp_dphi); - // last: track Z in the closest point - - dds = cp_dphi*trk_r*sqrt(1+trk_tandip*trk_tandip); - if (trk_om < 0) dds = -dds; - - s_cl = s12+dds; - - p_closest = krep->position(s_cl); - dz = p_closest.z()-cp_st.z(); - sint = s_cl-s1; - - if (_debugLevel > 2) { - printf("%s: s1 : %9.3f p1 : %9.3f %9.3f %9.3f\n",oname,s1, p1.x(),p1.y(),p1.z()); - printf("%s: s2 : %9.3f p2 : %9.3f %9.3f %9.3f\n",oname,s2, p2.x(),p2.y(),p2.z()); - printf("%s: s12 : %9.3f p12 : %9.3f %9.3f %9.3f\n",oname,s12,p12.x(),p12.y(),p12.z()); - printf("%s: mom : %9.3f %9.3f %9.3f tandip: %9.3f\n",oname,mom.x(),mom.y(),mom.z(),trk_tandip); - printf("%s: dds : %9.3f\n",oname,dds); - printf("%s: s_cl : %9.3f\n",oname,s_cl); - printf("%s: p_cl : %9.3f %9.3f %9.3f\n",oname,p_closest.x(),p_closest.y(),p_closest.z()); - - printf("%s: ",oname); - printf("trk_x0 : %9.3f ",trk_x0); - printf("trk_y0 : %9.3f ",trk_y0); - printf("trk_ph0: %9.3f ",trk_phi0); - printf("trk_ph1: %9.3f ",trk_phi1); - printf("trk_r : %9.3f ",trk_r ); - printf("\n"); - - printf("%s: ",oname); - printf("cl_x : %9.3f ",cl_x ); - printf("cl_y : %9.3f ",cl_y ); - printf("cp_phi : %9.3f ",cp_phi); - printf("cp_dphi: %9.3f ",cp_dphi); - printf("\n"); - - printf("%s: ",oname); - printf("delta_x: %9.3f ",delta_x); - printf("delta_y: %9.3f ",delta_y); - printf("dr : %9.3f ",dr ); - printf("dz : %9.3f ",dz ); - printf("sint : %9.3f ",sint ); - printf("\n"); - } - //----------------------------------------------------------------------------- - // 2014-05-14 P.Murat: use 10 MeV as the matching resolution, - // for a 10 MeV cluster the energy term in the chi2 would be (90/10)^2 - // also set coordinate resolution to 5cm , need to try using dx only - //----------------------------------------------------------------------------- - xu = du/_sigmaU; - xv = dv/_sigmaV; - xt = dt /_sigmaT; - xe = (trk_mom-cl_energy)/_sigmaE; - - _chi2u = xu*xu; - _chi2v = xv*xv; - _chi2t = xt*xt; - _chi2e = xe*xe; - - chi2 = _chi2u + _chi2v; - - if (_debugLevel > 2){ - printf("%s: ",oname); - printf("trk_x : %9.3f " ,trk_x ); - printf("cl_x : %9.3f " ,cl_x ); - printf("trk_y : %9.3f " ,trk_y ); - printf("cl_y : %9.3f " ,cl_y ); - printf("cl_time: %9.3f " ,cl_time); - printf("\n"); - printf("%s: ",oname); - printf("du : %9.3f " ,du ); - printf("dv : %9.3f " ,dv ); - printf("xu : %9.3f " ,xu ); - printf("xv : %9.3f " ,xv ); - printf("chi2 : %9.3f " ,chi2 ); - printf("\n"); - } - - if (chi2 < tcm_data[ltrk][idisk].chi2) { - //----------------------------------------------------------------------------- - // new best match - //----------------------------------------------------------------------------- - tcm_data[ltrk][idisk].icl = icl; - tcm_data[ltrk][idisk].iex = jex; - tcm_data[ltrk][idisk].dx = dx; - tcm_data[ltrk][idisk].dy = dy; - tcm_data[ltrk][idisk].dz = -1e6; - tcm_data[ltrk][idisk].du = du; - tcm_data[ltrk][idisk].dv = dv; - tcm_data[ltrk][idisk].dt = dt; - tcm_data[ltrk][idisk].ep = cl_energy/trk_mom; - tcm_data[ltrk][idisk].chi2 = chi2; - tcm_data[ltrk][idisk].chi2_time = _chi2t; - tcm_data[ltrk][idisk].dr = dr; - tcm_data[ltrk][idisk].sint = sint; - } - NEXT_CLUSTER:; - } - NEXT_INTERSECTION:; - } - - //----------------------------------------------------------------------------- - // form output list of matches - //----------------------------------------------------------------------------- - for (int it=0; it artPtrTex (trjExtrapols,iex); - art::Ptr artPtrCluster(caloClusters,icl); - TrackClusterMatch tcm(artPtrTex,artPtrCluster,&tcm_data[it][iv]); - tcmcoll->push_back(tcm); - } - } - } - - END:; - - evt.put(std::move(tcmcoll)); - //----------------------------------------------------------------------------- - // diagnostics printout - //----------------------------------------------------------------------------- - if (_debugLevel > 0) { - if (evt.id().event() %100 == 0) printf("Event %d TrackCaloMatching done.\n",evt.id().event()); - } - } - -} - -DEFINE_ART_MODULE(mu2e::TrackCaloMatching) diff --git a/TrackCaloMatching/src/TrkExtrapol_module.cc b/TrackCaloMatching/src/TrkExtrapol_module.cc deleted file mode 100644 index da7a1b47a1..0000000000 --- a/TrackCaloMatching/src/TrkExtrapol_module.cc +++ /dev/null @@ -1,581 +0,0 @@ -// -// Original author G. Pezzullo -// - -// Framework includes. -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "art/Framework/Principal/Selector.h" -#include "art_root_io/TFileDirectory.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" -#include "art_root_io/TFileService.h" -#include "art/Framework/Principal/Handle.h" - -//CLHEP includes -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Matrix/Vector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Matrix/Matrix.h" -#include "BTrk/BbrGeom/HepPoint.h" -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/SymMatrix.h" - -#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" -#include "Offline/RecoDataProducts/inc/KalRepPtrCollection.hh" - -// From the art tool-chain -#include "fhiclcpp/ParameterSet.h" -#include "messagefacility/MessageLogger/MessageLogger.h" - -//tracker includes -#include "BTrk/BaBar/BaBar.hh" -#include "BTrk/BaBar/Constants.hh" -#include "BTrk/TrkBase/HelixParams.hh" -#include "BTrk/TrkBase/TrkRep.hh" -#include "BTrk/KalmanTrack/KalRep.hh" -// conditions -#include "Offline/TrackerGeom/inc/Tracker.hh" -// data -#include "Offline/RecoDataProducts/inc/StrawHit.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" -#include "Offline/RecoDataProducts/inc/TrkToCaloExtrapol.hh" - -//calorimeter includes -#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/CalorimeterGeom/inc/DiskCalorimeter.hh" -#include "Offline/RecoDataProducts/inc/CaloHit.hh" -#include "Offline/RecoDataProducts/inc/CaloCluster.hh" - -// Other includes. -#include "cetlib_except/exception.h" - -// Mu2e includes. -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/MCDataProducts/inc/PtrStepPointMCVector.hh" -#include "Offline/MCDataProducts/inc/GenParticle.hh" -#include "Offline/MCDataProducts/inc/SimParticle.hh" -#include "Offline/MCDataProducts/inc/StepPointMC.hh" - -//root includes -#include "TFile.h" -#include "TDirectory.h" -#include "TNtuple.h" -#include "TH2D.h" -#include "TCanvas.h" -#include "THStack.h" -#include "TGraph.h" -#include "TApplication.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLatex.h" -#include "TMath.h" - -// From the art tool-chain -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace mu2e { - - struct IntersectData_t { - int fSection; - int fRC; // return code, 0=success, <0: failure, details TBD - double fSEntr; - double fSExit; - }; - - class TrkExtrapol : public art::EDProducer { - public: - - explicit TrkExtrapol(fhicl::ParameterSet const& pset): - art::EDProducer{pset}, - _fitterModuleLabel(pset.get("fitterModuleLabel")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _diagLevel(pset.get("diagLevel",0)), - _outPutNtup(pset.get("outPutNtup",0)), - _generatorModuleLabel(pset.get("generatorModuleLabel", - "generate")), - _g4ModuleLabel(pset.get("g4ModuleLabel", "g4run")), - _caloReadoutModuleLabel(pset.get("caloReadoutModuleLabel", - "CaloReadoutHitsMaker")), - _caloCrystalModuleLabel(pset.get("caloCrystalModuleLabel", - "CaloHitsMaker")), - _directory(0), - _firstEvent(true), - _trkdiag(0){ - // Tell the framework what we make. - produces(); - - // construct the data product instance name - _fitDir = _fdir.fitDirection(); - - } - - virtual ~TrkExtrapol() {} - - void beginJob(); - void endJob() {} - - void produce(art::Event & e ); - - void caloExtrapol(int& diagLevel, - int evtNumber, - TrkFitDirection fdir, - KalRep* Krep, - double& lowrange, - double& highrange, - HelixTraj &trkHel, - int &res0, - int& NIntersections, - IntersectData_t* Intersections); - - double ZfrontFaceCalo() const{ return _ZfrontFaceCalo;} - - double ZbackFaceCalo() const{ return _ZbackFaceCalo;} - - private: - - void doExtrapolation(art::Event & evt, bool skip); - // Module label of the module that performed the fits. - std::string _fitterModuleLabel; - - TrkParticle _tpart; - - TrkFitDirection _fdir; - - TrkFitDirection::FitDirection _fitDir; - - // diagnostic of Kalman fit - - // Diagnostic level - int _diagLevel; - int _outPutNtup; - - // Label of the generator. - std::string _generatorModuleLabel; - - // Label of the G4 module - std::string _g4ModuleLabel; - - // Label of the calo readout hits maker - std::string _caloReadoutModuleLabel; - - // Label of the calo crystal hists maker - std::string _caloCrystalModuleLabel; - - bool _skipEvent; - - // Save directory from beginJob so that we can go there in endJob. See note 3. - TDirectory* _directory; - bool _firstEvent; - - TTree* _trkdiag; - - Int_t _trkid - ,_trkint; - Float_t _trksection[1000] - , _trkpath[1000] - , _trktof[1000] - , _trkx[1000] - , _trky[1000] - , _trkz[1000] - , _trkmomx[1000] - , _trkmomy[1000] - , _trkmomz[1000] - , _trkmom[1000]; - - double _solenoidOffSetX; - double _solenoidOffSetZ; - double _ZfrontFaceCalo; - double _ZbackFaceCalo; - - CLHEP::Hep3Vector fromTrkToMu2eFrame(CLHEP::Hep3Vector &vec); - - void filltrkdiag(int itrk, IntersectData_t *intersec, - int size, KalRep const* kalrep); - - }; - - CLHEP::Hep3Vector TrkExtrapol::fromTrkToMu2eFrame(CLHEP::Hep3Vector &vec){ - art::ServiceHandle geom; - double solenoidOffSetX = geom->config().getDouble("mu2e.solenoidOffset"); - double solenoidOffSetZ = -geom->config().getDouble("mu2e.detectorSystemZ0"); - CLHEP::Hep3Vector res; - - res.setX(vec.x() - solenoidOffSetX); - res.setZ(vec.z() - solenoidOffSetZ); - res.setY(vec.y()); - return res; - } - - void TrkExtrapol::caloExtrapol(int& diagLevel, - int evtNumber, - TrkFitDirection fdir, - KalRep* Krep, - double& lowrange, - double& highrange, - HelixTraj &trkHel, - int &res0, - int& NIntersections, - IntersectData_t* Intersection ) { - art::ServiceHandle geom; - GeomHandle cg; - static const char* oname = "TrkExtrapol::caloExtrapol"; - - if(diagLevel>2){ - - cout<<"start caloExtrapol, lowrange = "<traj().position(lowrange)<traj().position(highrange)<2){ - cout<<", after extention..."<< - ", lowrange = "<traj().position(lowrange)<traj().position(highrange)< 100, TRUNCATE LIST\n",oname); - } - } - } - if(fdir.dzdt() == 1.0){ - tmpRange += pathStepSize; - }else if(fdir.dzdt() == -1.0){ - tmpRange -= pathStepSize; - } - } - // } - - if (diagLevel>2) { - cout<<"end search behindSection(), position is : "<extendThrough(lrange); - if (trk_rc.success() != 1) { - //----------------------------------------------------------------------------- - // failed to extend - //----------------------------------------------------------------------------- - Intersection[i].fRC = -1; - if (diagLevel>2) { - printf("%s ERROR vane = %2i FAILED to EXTEND TRAJECTORY, rc = %i\n", - oname,Intersection[i].fSection,trk_rc.success()); - } - } - - } - - delete [] isInside ; - delete [] entr ; - delete [] ex; - - }//end proce_dUre - - void TrkExtrapol::beginJob() { - - if (_outPutNtup == 1) { - art::ServiceHandle tfs; - _trkdiag = tfs->make("trk", "trk extrapolated info"); - _trkdiag->Branch("trkid", &_trkid ,"trkid/I"); - _trkdiag->Branch("trkint", &_trkint ,"trkint/I"); - _trkdiag->Branch("trksection[trkint]", _trksection, "trksection[trkint]/F"); - _trkdiag->Branch("trkpath[trkint]", _trkpath, "trkpath[trkint]/F"); - _trkdiag->Branch("trktof[trkint]", _trktof, "trktof[trkint]/F"); - _trkdiag->Branch("trkx[trkint]", _trkx, "trkx[trkint]/F"); - _trkdiag->Branch("trky[trkint]", _trky, "trky[trkint]/F"); - _trkdiag->Branch("trkz[trkint]", _trkz, "trkz[trkint]/F"); - _trkdiag->Branch("trkmomx[trkint]", _trkmomx, "trkmomx[trkint]/F"); - _trkdiag->Branch("trkmomy[trkint]", _trkmomy, "trkmomy[trkint]/F"); - _trkdiag->Branch("trkmomz[trkint]", _trkmomz, "trkmomz[trkint]/F"); - _trkdiag->Branch("trkmom[trkint]", _trkmom, "trkmom[trkint]/F"); - } - - } - - void TrkExtrapol::filltrkdiag(int itrk, IntersectData_t *intersec, int size, KalRep const* kalrep){ - _trkid = itrk; - double lenght(0.0); - _trkint = size; - TrkDifTraj const &traj = kalrep->traj(); - for(int i=0; iarrivalTime(lenght); - _trkx[i] = traj.position(lenght).x(); - _trky[i] = traj.position(lenght).y(); - _trkz[i] = traj.position(lenght).z(); - _trkmomx[i] = kalrep->momentum(lenght).x(); - _trkmomy[i] = kalrep->momentum(lenght).y(); - _trkmomz[i] = kalrep->momentum(lenght).z(); - _trkmom[i] = kalrep->momentum(lenght).mag(); - - } - _trkdiag->Fill(); - } - -//----------------------------------------------------------------------------- - void TrkExtrapol::produce(art::Event & evt ) { - - doExtrapolation(evt, _skipEvent); - } - -//----------------------------------------------------------------------------- - void TrkExtrapol::doExtrapolation(art::Event & evt, bool skip){ - - art::ServiceHandle geom; - GeomHandle cg; - _solenoidOffSetX = geom->config().getDouble("mu2e.solenoidOffset");//3904.;//[mm] - _solenoidOffSetZ = -geom->config().getDouble("mu2e.detectorSystemZ0");//-10200.; - - _ZfrontFaceCalo = cg->geomUtil().origin().z() + _solenoidOffSetZ; - _ZbackFaceCalo = cg->geomUtil().origin().z() + _solenoidOffSetZ; - - const char* oname = "TrkExtrapol::doExtrapolation"; - double lowrange, highrange, zmin, zmax; - HepPoint point; - int ntrk, res0; - - //create output - unique_ptr extrapolatedTracks(new TrkToCaloExtrapolCollection ); - TrkToCaloExtrapolCollection tmpExtrapolatedTracks; - - art::Handle trksHandle; - evt.getByLabel(_fitterModuleLabel,trksHandle); - const KalRepPtrCollection* trks = trksHandle.product(); - - ntrk = trks->size(); - - if(_diagLevel>2){ - cout<traj().position(lowrange); - printf("point of trj at lowrange(%10.3f) : ( %10.3f, %10.3f, %10.3f )\n", - lowrange, - point.x(), point.y(), point.z()); - - point = krep->traj().position(highrange); - printf("point of trj at highrange(%10.3f) : ( %10.3f, %10.3f, %10.3f )\n", - highrange, - point.x(), point.y(), point.z()); - } - - if(_outPutNtup ==1){ - filltrkdiag(int(itrk), intersection, nint, krep); - } - - for (int i=0; iat(itrk); - tmpExtrapolatedTracks.push_back( - TrkToCaloExtrapol(intersection[i].fSection, - itrk, - tmpRecTrk, - intersection[i].fSEntr, - intersection[i].fSExit) - ); - } - - // P.Murat: why would one need to sort at this point? - - // std::sort(tmpExtrapolatedTracks.begin(), tmpExtrapolatedTracks.end()); - for(TrkToCaloExtrapolCollection::iterator it = tmpExtrapolatedTracks.begin(); it != tmpExtrapolatedTracks.end(); ++it){ - extrapolatedTracks->push_back(*it); - } - - }//end loop on recoTrj - - evt.put(std::move(extrapolatedTracks)); - if( evt.id().event() %100 ==0){ - printf("\nEvent %d %s done...\n",evt.id().event(),oname ); - } - } - -} - -using mu2e::TrkExtrapol; -DEFINE_ART_MODULE(TrkExtrapol) diff --git a/TrkPatRec/src/KalSeedFit_module.cc b/TrkPatRec/src/KalSeedFit_module.cc deleted file mode 100644 index 194731ea68..0000000000 --- a/TrkPatRec/src/KalSeedFit_module.cc +++ /dev/null @@ -1,567 +0,0 @@ -// -// Starting with a Helix fit, perform a Least-squares fit (using the BTrk -// Kalman fit, appropriately configured) to produce an initial estimate of the parmeters and -// covariance for the final Kalman fit. This fit uses wire positions only, -// not drift. -// -// Original author Dave Brown (LBNL) 31 Aug 2016 -// - -// framework -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "art/Framework/Principal/Handle.h" -#include "art/Framework/Core/EDProducer.h" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "art_root_io/TFileService.h" -#include "art/Utilities/make_tool.h" -#include "art/Framework/Principal/Run.h" -// conditions -#include "Offline/TrackerGeom/inc/Tracker.hh" -#include "Offline/GeometryService/inc/GeometryService.hh" -#include "Offline/GeometryService/inc/GeomHandle.hh" -#include "Offline/BFieldGeom/inc/BFieldManager.hh" -#include "Offline/GeometryService/inc/DetectorSystem.hh" -#include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/TrackerConditions/inc/StrawResponse.hh" -#include "Offline/TrackerConditions/inc/Mu2eMaterial.hh" -#include "Offline/TrackerConditions/inc/Mu2eDetector.hh" -// utiliites -#include "Offline/GeneralUtilities/inc/Angles.hh" -#include "Offline/TrkReco/inc/TrkUtilities.hh" -#include "Offline/TrkReco/inc/TrkDef.hh" -#include "Offline/Mu2eUtilities/inc/ModuleHistToolBase.hh" -// data -#include "Offline/DataProducts/inc/Helicity.hh" -#include "Offline/RecoDataProducts/inc/ComboHit.hh" -#include "Offline/RecoDataProducts/inc/StrawHitFlag.hh" -#include "Offline/RecoDataProducts/inc/HelixSeed.hh" -#include "Offline/RecoDataProducts/inc/KalSeed.hh" -#include "Offline/RecoDataProducts/inc/KalSeedAssns.hh" -#include "Offline/RecoDataProducts/inc/TrkFitFlag.hh" -// Diagnostic data objects -#include "Offline/TrkReco/inc/KalFitData.hh" -#include "Offline/TrkPatRec/inc/KalSeedFit_types.hh" -// BaBar -#include "BTrk/BbrGeom/BbrVectorErr.hh" -#include "BTrk/TrkBase/TrkPoca.hh" -#include "BTrk/TrkBase/TrkHelixUtils.hh" -#include "BTrk/ProbTools/ChisqConsistency.hh" -#include "BTrk/TrkBase/TrkMomCalculator.hh" -// Mu2e BaBar -#include "Offline/BTrkData/inc/TrkStrawHit.hh" -#include "Offline/TrkReco/inc/KalFit.hh" -//CLHEP -#include "CLHEP/Units/PhysicalConstants.h" -#include "CLHEP/Matrix/Vector.h" -// root -#include "TH1F.h" -#include "TTree.h" -// C++ -#include -#include -#include -#include -#include -#include -using namespace std; -using CLHEP::Hep3Vector; -using CLHEP::HepVector; - -namespace mu2e -{ - - using namespace KalSeedFitTypes; - - - class KalSeedFit : public art::EDProducer - { - public: - explicit KalSeedFit(fhicl::ParameterSet const&); - virtual ~KalSeedFit(); - virtual void beginRun(art::Run&); - virtual void produce(art::Event& event ); - private: - unsigned _iev; - // configuration parameters - int _debug; - int _diag; - int _printfreq; - bool _saveall; - bool _checkhelicity; - // event object tags - art::ProductToken const _shToken; - art::ProductToken const _hsToken; - TrkFitFlag _seedflag; // helix fit flag - unsigned _minnhits; // minimum # of hits - double _maxdoca; // outlier cut - bool _foutliers; // filter hits far from the helix - bool _fhoutliers; // filter hits found flagged as outliers in the helix fit - double _maxAddDoca; // rescue hits cut after fit - double _maxAddChi; // cut for KalFit::AddHits - int _rescueHits; // search for missing hits after the fit is performed - TrkParticle _tpart; // particle type being searched for - TrkFitDirection _fdir; // fit direction in search - vector _perr; // diagonal parameter errors to use in the fit - Helicity _helicity; // cached value of helicity expected for this fit - double _upz, _downz; // z positions to extend the segment - double _amsign; // cached sign of angular momentum WRT the z axis - double _bz000; // sign of the magnetic field at (0,0,0) - HepSymMatrix _hcovar; // cache of parameter error covariance matrix - TrkFitFlag _ksf; // default fit flag - // cache of event objects - const ComboHitCollection *_chcol; - const HelixSeedCollection *_hscol; - // ouptut collections - // Kalman fitter. This will be configured for a least-squares fit (no material or BField corrections). - KalFit _kfit; - KalFitData _result; - const Tracker* _tracker; // straw tracker geometry - - ProditionsHandle _strawResponse_h; - ProditionsHandle _mu2eMaterial_h; - ProditionsHandle _mu2eDetector_h; - ProditionsHandle _alignedTracker_h; - - // diagnostic - Data_t _data; - std::unique_ptr _hmanager; - - // helper functions - bool findData(const art::Event& e); - void filterOutliers(TrkDef& trkdef); - void findMissingHits(KalFitData&kalData); - }; - - KalSeedFit::KalSeedFit(fhicl::ParameterSet const& pset) : - art::EDProducer{pset}, - _debug(pset.get("debugLevel",0)), - _diag(pset.get("diagLevel",0)), - _printfreq(pset.get("printFrequency",101)), - _saveall(pset.get("saveall",false)), - _checkhelicity(pset.get("CheckHelicity",true)), - _shToken{consumes(pset.get("ComboHitCollection"))}, - _hsToken{consumes(pset.get("SeedCollection"))}, - _seedflag(pset.get >("HelixFitFlag",vector{"HelixOK"})), - _minnhits(pset.get("MinNHits",10)), - _maxdoca(pset.get("MaxDoca",40.0)), - _foutliers(pset.get("FilterOutliers",true)), - _fhoutliers(pset.get("FilterHelixOutliers",false)), - _maxAddDoca(pset.get("MaxAddDoca")), - _maxAddChi(pset.get("MaxAddChi")), - _rescueHits(pset.get("rescueHits")), - _tpart((TrkParticle::type)(pset.get("fitparticle",TrkParticle::e_minus))), - _fdir((TrkFitDirection::FitDirection)(pset.get("fitdirection",TrkFitDirection::downstream))), - _perr(pset.get >("ParameterErrors")), - _upz(pset.get("UpstreamZ",-1500)), - _downz(pset.get("DownstreamZ",1500)), - _ksf(TrkFitFlag::KSF), - _kfit(pset.get("KalFit",fhicl::ParameterSet())), - _result() - { - // This following consumesMany call is necessary because - // ComboHitCollection::fillStrawHitIndices calls getManyByType - // under the covers. - consumesMany(); - produces(); - produces(); - // check dimensions - if(_perr.size() != HelixTraj::NHLXPRM) - throw cet::exception("RECO")<<"mu2e::KalSeedFit: parameter error vector has wrong size"<< endl; - // mock covariance matrix, all diagonal - _hcovar = HepSymMatrix(HelixTraj::NHLXPRM,0); - for(size_t ipar = 0; ipar < HelixTraj::NHLXPRM; ++ipar){ - _hcovar(ipar+1,ipar+1) = _perr[ipar]*_perr[ipar]; // clhep indexing starts a 1 - } - - //----------------------------------------------------------------------------- - // provide for interactive disanostics - //----------------------------------------------------------------------------- - _data.result = &_result; - - - if (_diag != 0) _hmanager = art::make_tool(pset.get("diagPlugin")); - else _hmanager = std::make_unique(); - } - - KalSeedFit::~KalSeedFit(){} - - void KalSeedFit::beginRun(art::Run& run){ - // calculate the helicity - GeomHandle bfmgr; - GeomHandle det; - - // initialize the BTrk material and particle models - _mu2eMaterial_h.get(run.id()); - - _kfit.setCaloGeom(); - - // change coordinates to mu2e - CLHEP::Hep3Vector vpoint(0.0,0.0,0.0); - CLHEP::Hep3Vector vpoint_mu2e = det->toMu2e(vpoint); - CLHEP::Hep3Vector field = bfmgr->getBField(vpoint_mu2e); - // helicity is a purely geometric quantity, however it's easiest - // to determine it from the kinematics (angular momentum and Z momentum) - _bz000 = field.z(); - _amsign = copysign(1.0,-_tpart.charge()*_bz000); - _helicity = Helicity(static_cast(_fdir.dzdt()*_amsign)); - } - - void KalSeedFit::produce(art::Event& event ) { - - auto srep = _strawResponse_h.getPtr(event.id()); - auto detmodel = _mu2eDetector_h.getPtr(event.id()); - - _tracker = _alignedTracker_h.getPtr(event.id()).get(); - _kfit.setTracker(_tracker); - - // create output collection - unique_ptr kscol(new KalSeedCollection()); - unique_ptr ksha(new KalHelixAssns()); - auto KalSeedCollectionPID = event.getProductID(); - auto KalSeedCollectionGetter = event.productGetter(KalSeedCollectionPID); - // event printout - _iev=event.id().event(); - if(_debug > 0 && (_iev%_printfreq)==0)cout<<"KalSeedFit: event="<<_iev<size(); ++iseed) { - // convert the HelixSeed to a TrkDef - HelixSeed const& hseed(_hscol->at(iseed)); - - if (hseed.caloCluster()) _result.caloCluster = hseed.caloCluster().get(); - _result.helixSeed = &hseed; - //----------------------------------------------------------------------------- - // 2018-12-08 PM : allow list of helices to contain helices of different - // helicities and corresponding to particles of opposite signs. Assume that the - // PDG particle coding scheme is used such that the particle and antiparticle - // PDG codes have opposite signs - //----------------------------------------------------------------------------- - TrkParticle tpart(_tpart); - if(_helicity != hseed.helix().helicity()) { - if(_checkhelicity) throw cet::exception("RECO")<<"mu2e::KalSeedFit: helicity doesn't match configuration" << endl; - TrkParticle::type t = (TrkParticle::type) (-int(_tpart.particleType())); - tpart = TrkParticle(t); - } - - double amsign = copysign(1.0,-tpart.charge()*_bz000); - - HepVector hpvec(HelixTraj::NHLXPRM); - // verify the fit meets requirements and can be translated - // to a fit trajectory. This accounts for the physical particle direction - // helicity. This could be wrong due to FP effects, so don't treat it as an exception - if(hseed.status().hasAllProperties(_seedflag) && - // _helicity == hseed.helix().helicity() && - TrkUtilities::RobustHelix2Traj(hseed._helix,hpvec,amsign)){ - HelixTraj hstraj(hpvec,_hcovar); - // update the covariance matrix - if(_debug > 1) - // hstraj.printAll(cout); - cout << "Seed Fit HelixTraj parameters " << hstraj.parameters()->parameter() - << "and covariance " << hstraj.parameters()->covariance() << endl; - // build a time cluster: exclude the outlier hits - TimeCluster tclust; - tclust._t0 = hseed._t0; - for(uint16_t ihit=0;ihit < hseed.hits().size(); ++ihit){ - ComboHit const& ch = hseed.hits()[ihit]; - if((!_fhoutliers) || (!ch.flag().hasAnyProperty(StrawHitFlag::outlier))) - hseed.hits().fillStrawHitIndices(ihit,tclust._strawHitIdxs); - } - // create a TrkDef; it should be possible to build a fit from the helix seed directly FIXME! - // TrkDef seeddef(tclust,hstraj,_tpart,_fdir); - TrkDef seeddef(tclust,hstraj,tpart,_fdir); - // filter outliers; this doesn't use drift information, just straw positions - if(_foutliers)filterOutliers(seeddef); - const HelixTraj* htraj = &seeddef.helix(); - double flt0 = htraj->zFlight(0.0); - double mom = TrkMomCalculator::vecMom(*htraj, _kfit.bField(), flt0).mag(); - double vflt = seeddef.particle().beta(mom)*CLHEP::c_light; - double helt0 = hseed.t0().t0(); - - KalSeed kf(PDGCode::type(tpart.particleType()),hseed.status(), flt0 ); - // extract the hits from the rep and put the hitseeds into the KalSeed - int nsh = seeddef.strawHitIndices().size();//tclust._strawHitIdxs.size(); - for (int i=0; i< nsh; ++i){ - size_t istraw = seeddef.strawHitIndices().at(i); - const ComboHit& strawhit(_chcol->at(istraw)); - const Straw& straw = _tracker->getStraw(strawhit.strawId()); - double fltlen = htraj->zFlight(straw.getMidPoint().z()); - double propTime = (fltlen-flt0)/vflt; - - //fill the TrkStrwaHitSeed info - TrkStrawHitSeed tshs; - tshs._index = istraw; - tshs._t0 = TrkT0(helt0 + propTime, hseed.t0().t0Err()); - tshs._trklen = fltlen; - kf._hits.push_back(tshs); - } - - if(kf._hits.size() >= _minnhits) kf._status.merge(TrkFitFlag::hitsOK); - // extract the helix trajectory from the fit (there is just 1) - // use this to create segment. This will be the only segment in this track - if(htraj != 0){ - KalSegment kseg; - // sample the momentum at this point - TrkUtilities::fillSegment(*htraj,0.0,0.0,hseed.t0(),tpart.mass(),int(tpart.charge()),_kfit.bField(),kseg); - kf._segments.push_back(kseg); - } else { - throw cet::exception("RECO")<<"mu2e::KalSeedFit: Can't extract helix traj from seed fit" << endl; - } - - // now, fit the seed helix from the filtered hits - - //fill the KalFitData variable - _result.kalSeed = &kf; - - _kfit.makeTrack(srep,detmodel,_result); - - if(_debug > 1){ - if(_result.krep == 0) - cout << "No Seed fit produced " << endl; - else - cout << "Seed Fit result " << _result.krep->fitStatus() << endl; - } - if(_result.krep != 0 && (_result.krep->fitStatus().success() || _saveall)){ - if (_rescueHits) { - int nrescued = 0; - findMissingHits(_result); - nrescued = _result.missingHits.size(); - if (nrescued > 0) { - _kfit.addHits(srep,detmodel,_result, _maxAddChi); - } - } - - // KalRep *krep = _result.stealTrack(); - - // convert the status into a FitFlag - // create a KalSeed object from this fit, recording the particle and fit direction - // KalSeed kseed(_tpart,_fdir,_result.krep->t0(),_result.krep->flt0(),seedok); - - KalSeed kseed(PDGCode::type(_result.krep->particleType().particleType()),kf.status(), _result.krep->flt0()); - kseed._status.merge(_ksf); - if(_result.krep->fitStatus().success())kseed._status.merge(TrkFitFlag::kalmanOK); - // add CaloCluster if present - kseed._chit._cluster = hseed.caloCluster(); - // extract the hits from the rep and put the hitseeds into the KalSeed - TrkUtilities::fillStrawHitSeeds(_result.krep,*_chcol,kseed._hits); - if(_result.krep->fitStatus().success())kseed._status.merge(TrkFitFlag::seedOK); - if(_result.krep->fitStatus().success()==1)kseed._status.merge(TrkFitFlag::seedConverged); - if(kseed._hits.size() >= _minnhits)kseed._status.merge(TrkFitFlag::hitsOK); - kseed._chisq = _result.krep->chisq(); - kseed._ndof = _result.krep->nDof(); - // use the default consistency calculation, as t0 is not fit here - kseed._fitcon = _result.krep->chisqConsistency().significanceLevel(); - // extract the helix trajectory from the fit (there is just 1) - double locflt; - const HelixTraj* htraj = dynamic_cast(_result.krep->localTrajectory(_result.krep->flt0(),locflt)); - // use this to create segment. This will be the only segment in this track - if(htraj != 0){ - KalSegment kseg; - // sample the momentum at this point - BbrVectorErr momerr = _result.krep->momentumErr(_result.krep->flt0()); - TrkUtilities::fillSegment(*htraj,locflt,_result.krep->flt0(),_result.krep->t0(),tpart.mass(),int(tpart.charge()),_kfit.bField(),kseg); - // extend the segment - double upflt(0.0), downflt(0.0); - TrkHelixUtils::findZFltlen(*htraj,_upz,upflt); - TrkHelixUtils::findZFltlen(*htraj,_downz,downflt); - double tup = kseg.fltToTime(upflt); - double tdown = kseg.fltToTime(downflt); - if(_fdir == TrkFitDirection::downstream){ - kseg._tmin = tup; - kseg._tmax = tdown; - } else { - kseg._tmax = tup; - kseg._tmin = tdown; - } - kseed._segments.push_back(kseg); - // push this seed into the collection - kscol->push_back(kseed); - // fill assns with the helix seed - auto hsH = event.getValidHandle(_hsToken); - auto hptr = art::Ptr(hsH,iseed); - auto kseedptr = art::Ptr(KalSeedCollectionPID,kscol->size()-1,KalSeedCollectionGetter); - ksha->addSingle(kseedptr,hptr); - if(_debug > 1){ - cout << "Seed fit segment parameters " << endl; - for(size_t ipar=0;ipar<5;++ipar) cout << kseg.helix()._pars[ipar] << " "; - cout << " covariance " << endl; - for(size_t ipar=0;ipar<15;++ipar) - cout << kseg.covar()._cov[ipar] << " "; - cout << endl; - } - } else { - throw cet::exception("RECO")<<"mu2e::KalSeedFit: Can't extract helix traj from seed fit" << endl; - } - } - // cleanup the seed fit KalRep. Optimally the krep should be a data member of this module - // and get reused to avoid thrashing memory, but the BTrk code doesn't support that, FIXME! - _result.deleteTrack(); - } - } - // put the tracks into the event - event.put(move(kscol)); - event.put(move(ksha)); - } - - - // find the input data objects - bool KalSeedFit::findData(const art::Event& evt){ - _chcol = 0; - _hscol = 0; - - auto shH = evt.getValidHandle(_shToken); - _chcol = shH.product(); - auto hsH = evt.getValidHandle(_hsToken); - _hscol = hsH.product(); - - return _chcol != 0 && _hscol != 0; - } - - void KalSeedFit::filterOutliers(TrkDef& mydef){ - // for now filter on DOCA. In future this shoudl be an MVA using time and position FIXME! - // Trajectory info - Hep3Vector tdir; - HepPoint tposp; - double flt0 = mydef.helix().zFlight(0.0); - mydef.helix().getInfo(flt0,tposp,tdir); - // tracker and conditions - const Tracker& tracker = *_tracker; - - - const vector& indices = mydef.strawHitIndices(); - vector goodhits; - for(unsigned ihit=0;ihitat(indices[ihit]); - Straw const& straw = tracker.getStraw(sh.strawId()); - CLHEP::Hep3Vector hpos = straw.getMidPoint(); - CLHEP::Hep3Vector hdir = straw.getDirection(); - // convert to HepPoint to satisfy antique BaBar interface: FIXME!!! - HepPoint spt(hpos.x(),hpos.y(),hpos.z()); - TrkLineTraj htraj(spt,hdir,-straw.halfLength(),straw.halfLength()); - // estimate flightlength along track. This assumes a constant BField!!! - double fltlen = (hpos.z()-tposp.z())/tdir.z(); - HepPoint tp = mydef.helix().position(fltlen); - Hep3Vector tpos(tp.x(),tp.y(),tp.z()); // ugly conversion FIXME! - double hitlen = hdir.dot(tpos - hpos); - TrkPoca hitpoca(mydef.helix(),fltlen,htraj,hitlen); - // keep hits with small residuals - if(fabs(hitpoca.doca()) < _maxdoca){ - goodhits.push_back(indices[ihit]); - } - } - // update track - mydef.strawHitIndices() = goodhits; - } - - //----------------------------------------------------------------------------- - // look for hits which were not a part of the helix hit list around the - // trajectory found by the seed fit - // look at all hits included into the corresponding time cluster - // first reactivate already associated hits - //----------------------------------------------------------------------------- - void KalSeedFit::findMissingHits(KalFitData&kalData){ - - const char* oname = "KalSeedFit::findMissingHits"; - - mu2e::TrkStrawHit* hit; - int hit_index; - const ComboHit* sh; - const Straw* straw; - - Hep3Vector tdir; - HepPoint tpos; - double doca, /*rdrift, */fltlen; - - if (_debug > 0) printf("[%s]: BEGIN\n",oname); - - const KalRep* krep = kalData.krep; - - kalData.missingHits.clear(); - - const TrkDifTraj& trajectory = krep->traj(); - const vector& trackHits = krep->hitVector(); - //----------------------------------------------------------------------------- - // get track position and direction at S=0 - //----------------------------------------------------------------------------- - trajectory.getInfo(0.0,tpos,tdir); - //----------------------------------------------------------------------------- - // look for so far unused hits around the trajectory - //----------------------------------------------------------------------------- - const HelixSeed* hseed = kalData.helixSeed; - const std::vector& tchits = hseed->timeCluster()->hits(); - - int n = tchits.size(); - for (int i=0; iat(hit_index); - if (sh->flag().hasAnyProperty(StrawHitFlag::dead)) { - continue; - } - straw = &_tracker->getStraw(sh->strawId()); - - const CLHEP::Hep3Vector& wpos = straw->getMidPoint(); - const CLHEP::Hep3Vector& wdir = straw->getDirection(); - - HepPoint wpt (wpos.x(),wpos.y(),wpos.z()); - TrkLineTraj wire (wpt,wdir,-20,20); - //----------------------------------------------------------------------------- - // estimate flightlength along the track for z-coordinate corresponding to the - // wire position. This assumes a constant BField!!! - // in principle, this should work well enough, however, may want to check - // then determine the distance from the wire to the trajectory - //----------------------------------------------------------------------------- - fltlen = (wpos.z()-tpos.z())/tdir.z(); - TrkPoca wpoca(trajectory,fltlen,wire,0.0); - doca = wpoca.doca(); - - int found(-1); - - if (std::fabs(doca) < _maxAddDoca) { - found = 0; - for (auto it=trackHits.begin(); it (*it); - if (hit == 0) continue; //it means that "hit" is a TrkCaloHit - int shIndex = int(hit->index()); - if (hit_index == shIndex) { - found = 1; - break; - } - } - //----------------------------------------------------------------------------- - // KalSeedFit doesn't look at the hit residuals, only wires - //----------------------------------------------------------------------------- - if (found == 0) { - MissingHit_t m; - m.index = hit_index; - m.doca = doca; - // m.dr = ??; - kalData.missingHits.push_back(m);//hit_index); - // KRes._doca.push_back(doca); - } - } - - if (_debug > 0) printf("[%s] %5i %8.3f %2i \n",oname,hit_index,doca,found); - - } - } - -}// mu2e -using mu2e::KalSeedFit; -DEFINE_ART_MODULE(KalSeedFit) From c44a0eac28f813180e03d5d632f321067cdf4378 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 16:05:13 -0800 Subject: [PATCH 111/174] More fixes --- Analyses/src/SConscript | 1 - Analyses/test/genMixReco.fcl | 199 ------------------------- Analyses/test/readTrackCluster.fcl | 223 ----------------------------- CaloDiag/src/SConscript | 1 - CaloFilters/src/SConscript | 1 - EventDisplay/src/DataInterface.cc | 1 - Trigger/src/SConscript | 1 - 7 files changed, 427 deletions(-) delete mode 100644 Analyses/test/genMixReco.fcl delete mode 100644 Analyses/test/readTrackCluster.fcl diff --git a/Analyses/src/SConscript b/Analyses/src/SConscript index 19db6dbf58..2dd80430db 100644 --- a/Analyses/src/SConscript +++ b/Analyses/src/SConscript @@ -18,7 +18,6 @@ mainlib = helper.make_mainlib ( ['fhiclcpp_types', 'tbb',] ) helper.make_plugins( [ mainlib, - 'mu2e_TrkExt', 'mu2e_TrkDiag', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', diff --git a/Analyses/test/genMixReco.fcl b/Analyses/test/genMixReco.fcl deleted file mode 100644 index 709d8d0891..0000000000 --- a/Analyses/test/genMixReco.fcl +++ /dev/null @@ -1,199 +0,0 @@ -# -*- mode: tcl -*- -#------------------------------------------------------------------------------ -# this example shows how to configure a job to -# -# - generate conversion electron events -# - add accidental background -# - run simulation+reconstruction chain -# - run particle ID -# -# a) to prepare muon stop file for the interactive job: -# -# ln -s /mu2e/data/tdr/beam/g4s3p5/mergedMuonStops -# -# b) when submitting to the grid, comment out the PROLOG definition, -# -# ls /mu2e/data/tdr/beam/g4s3p5/mergedMuonStops/*.root > muStops.txt -# -# and use -# -# --fclinput=@muStops:muStops.txt -#------------------------------------------------------------------------------ - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -#include "Offline/CaloCluster/fcl/prolog.fcl" -#include "Offline/TrackCaloMatching/fcl/prolog.fcl" -#include "Offline/CalPatRec/fcl/prolog.fcl" -#include "Offline/ParticleID/fcl/prolog.fcl" - -process_name : GenReco - -source : { - module_type : EmptyEvent -} - -services : { - - message : @local::default_message - TFileService : { fileName : "genReco.hist" } - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - # Mu2e services - GeometryService : { inputFile : "Production/JobConfig/TDR/geom_MothersToHits.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - Mu2eG4Helper : { } - SeedService : @local::automaticSeeds -} - -physics : { - - producers: { - generate : { -#------------------------------------------------------------------------------ -# for 105 MeV/c electron : E = 105.00130 MeV -# for muon: sqrt(105.*105+105.658*105.658) = 148.9584269653785 -# by default, StoppedParticleReactionGun has 'mean' set to +1, -# which means the Poisson mean of 1 !!! -#------------------------------------------------------------------------------ - module_type : StoppedParticleReactionGun - mean : -1 - physics : { - pdgId : 11 - spectrumVariable : "totalEnergy" - spectrumShape : "flat" - elow : 105.0012 - ehi : 105.0014 - } - muonStops : { -#------------------------------------------------------------------------------ -# use --fclinput=@muStops:datasets/mustops for grid submission -# [ "mergedMuonStops/mustops.1025a_1426a_1504a.15318715.root" ] -#------------------------------------------------------------------------------ - inputFiles : @local::mergedMuonStops - averageNumRecordsToUse: 500000 - treeName : "stoppedMuonDumper/stops" - branchName : "stops" - verbosityLevel : 1 - } - } - - g4run : @local::g4run -#------------------------------------------------------------------------------ -# hit makers -#------------------------------------------------------------------------------ - protonTimeMap : { module_type : GenerateProtonTimes } - muonTimeMap : { module_type : GenerateMuonLife } - makeSD : @local::makeSD - makeSH : @local::makeSHfromSD - @table::CaloDigiMC.producers - @table::CaloReco.producers -#------------------------------------------------------------------------------ -# default tracking -#------------------------------------------------------------------------------ - FSHPreStereo : @local::FSHPreStereo - MakeStereoHits : @local::MakeStereoHits - FlagStrawHits : @local::FlagStrawHits - FlagBkgHits : @local::FlagBkgHits - TrkPatRec : @local::TrkPatRecDeM -#------------------------------------------------------------------------------ -# CalPatRec modules -#------------------------------------------------------------------------------ - @table::CaloCluster.producers - MakeStrawHitPositions: @local::MakeStrawHitPositions - CalPatRec : @local::CalPatRec - MergePatRec : @local::MergePatRec -#------------------------------------------------------------------------------ -# needed for analysis -#------------------------------------------------------------------------------ - CaloMatching : @local::TrackCaloMatching - TrkExtrapol : @local::TrkExtrapol - ParticleID : @local::ParticleID - } - - filters: { -#------------------------------------------------------------------------------ -# Andrej's filter -# Reject events with no hits from signal-like tracks in the detectors. -# The filter does not look at the background hits from mixed events. -#------------------------------------------------------------------------------ - FilterStepPointMomentum: { - module_type : FilterStepPointMomentum - inputs : [ "g4run:tracker", "g4run:calorimeter", "g4run:calorimeterRO"] - cutMomentumMin : 10. # MeV/c - } - } -#------------------------------------------------------------------------------ -# analyzers: -#------------------------------------------------------------------------------ - analyzers: { - -# Read the TrkPatRec output and make diagnostic ntuples. - RKFDeM: { - module_type: ReadKalFits - fitterModuleLabel: TrkPatRec - KalDiag : { - MCPtrLabel : "makeSH" - MCStepsLabel : "g4run" - SimParticleLabel : "g4run" - SimParticleInstance : "" - StrawHitMCLabel : "makeSH" - TimeOffsets : { inputs : [ "protonTimeMap", "muonTimeMap" ] } - } - } - - } -#------------------------------------------------------------------------------ -# paths -# write out ntuple only, so don't need compression modules... -#------------------------------------------------------------------------------ - e1 : [ RKFDeM ] - - p1 : [generate, g4run - , protonTimeMap, muonTimeMap - , makeSD, makeSH - , @sequence::CaloDigiMC.DigiSim - , @sequence::CaloReco.Reco - , @sequence::CaloCluster.Reco -# - , FSHPreStereo, MakeStereoHits, FlagStrawHits, FlagBkgHits, TrkPatRec -# - , TrkExtrapol, CaloMatching, ParticleID - ] - - trigger_paths : [p1] - - out : [detectorOutput] - out : [] -# an : [genCountLogger] - end_paths : [e1, out] -} - -outputs: { - detectorOutput : { - module_type : RootOutput -# SelectEvents: [p1] - outputCommands: [ "keep *_*_*_*", - "drop uintmu2e::PhysicalVolumeInfomvstd::pairs_g4run_*_*" - ] - fileName : "renReco.art" - } -} -#------------------------------------------------------------------------------ -# redefinitions -#------------------------------------------------------------------------------ -# 1. only for interactive submission -#------------------------------------------------------------------------------ -services.SeedService.baseSeed : 8 -services.SeedService.maxUniqueEngines : 20 - -# print per event timing for ::event entry points -# services.Timing: { } -# print -services.scheduler.wantSummary: true - -# Apply the time offsets at the digitization stage -physics.producers.makeSD.TimeOffsets : { inputs : [ "protonTimeMap", "muonTimeMap" ] } diff --git a/Analyses/test/readTrackCluster.fcl b/Analyses/test/readTrackCluster.fcl deleted file mode 100644 index 39a134341b..0000000000 --- a/Analyses/test/readTrackCluster.fcl +++ /dev/null @@ -1,223 +0,0 @@ -# -*- mode: tcl -*- -// 2014-06-02: run local, write output file -// -// Andrei Gaponenko, 2014 -#------------------------------------------------------------------------------ -# quick comments: reads signal MC and also background MC inputs with steppoints -# so need to define input and -#------------------------------------------------------------------------------ - -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/fcl/standardServices.fcl" - -#include "Offline/CaloCluster/fcl/prolog.fcl" -#include "Offline/Analyses/fcl/prolog.fcl" -#include "Offline/TrackCaloMatching/fcl/prolog.fcl" -#include "Offline/CalPatRec/fcl/prolog.fcl" -#include "Offline/ParticleID/fcl/prolog.fcl" -#include "Stntuple/fcl/prolog.fcl" - -process_name : StnMakerEminus - -source : { - module_type : EmptyEvent -} - -services : { - - message : @local::default_message - TFileService : { fileName : "{ART_HIST_FILE}" } - - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - - GeometryService : { inputFile : "Production/JobConfig/TDR/geom_MothersToHits.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - Mu2eG4Helper : { } - SeedService : @local::automaticSeeds -} - -physics : { - - producers: { - generate : { -#------------------------------------------------------------------------------ -# for 105 MeV/c electron : E = 105.00130 MeV -# for muon: sqrt(105.*105+105.658*105.658) = 148.9584269653785 -#------------------------------------------------------------------------------ - module_type : StoppedParticleReactionGun - physics : { - pdgId : 11 - spectrumVariable : "totalEnergy" - spectrumShape : "conversion" -# spectrumResolution : 0.1 -# spectrumShape : "flat" -# elow : 103. -# ehi : 103.01 - } - muonStops : { -#------------------------------------------------------------------------------ -# use --fclinput=@muStops:datasets/mustops for grid submission -# [ "mergedMuonStops/mustops.1025a_1426a_1504a.15318715.root" ] -#------------------------------------------------------------------------------ - inputFiles : @local::mergedMuonStops - averageNumRecordsToUse: 500000 - treeName : "stoppedMuonDumper/stops" - branchName : "stops" - verbosityLevel : 1 - } - } - - g4run : @local::g4run -#------------------------------------------------------------------------------ -# hit makers -#------------------------------------------------------------------------------ - protonTimeMap : { module_type : GenerateProtonTimes } - muonTimeMap : { module_type : GenerateMuonLife } - makeSD : @local::makeSD - makeSH : @local::makeSHfromSD - @table::CaloDigiMC.producers - @table::CaloReco.producers -#------------------------------------------------------------------------------ -# default tracking -#------------------------------------------------------------------------------ - FSHPreStereo : @local::FSHPreStereo - MakeStereoHits : @local::MakeStereoHits - FlagStrawHits : @local::FlagStrawHits - FlagBkgHits : @local::FlagBkgHits - TrkPatRec : @local::TrkPatRecDeM -#------------------------------------------------------------------------------ -# CalPatRec modules -#------------------------------------------------------------------------------ - @table::CaloCluster.producers - MakeStrawHitPositions: @local::MakeStrawHitPositions - CalPatRec : @local::CalPatRec - MergePatRec : @local::MergePatRec -#------------------------------------------------------------------------------ -# needed for analysis -#------------------------------------------------------------------------------ - CaloMatching : @local::TrackCaloMatching - TrkExtrapol : @local::TrkExtrapol - ParticleID : @local::ParticleID - } - - filters: { -#------------------------------------------------------------------------------ -# Stntuple maker sequence -#------------------------------------------------------------------------------ - InitStntuple : @local::InitStntuple - StntupleMaker : @local::StntupleMaker - FillStntuple : @local::FillStntuple -#------------------------------------------------------------------------------ -# Andrej's filter -# Reject events with no hits from signal-like tracks in the detectors. -# The filter does not look at the background hits from mixed events. -#------------------------------------------------------------------------------ - FilterStepPointMomentum: { - module_type : FilterStepPointMomentum - inputs : [ "g4run:tracker", "g4run:calorimeter", "g4run:calorimeterRO"] - cutMomentumMin : 10. # MeV/c - } - } - - analyzers: - { -#----------------------------------------------------------------------------- -# Analyzer module for track extrapolation information -#----------------------------------------------------------------------------- - ReadTrkExtrapol : @local::ReadTrkExtrapol - -#----------------------------------------------------------------------------- -# Analyzer module for track-cluster match information -#----------------------------------------------------------------------------- - ReadTrackCaloMatching : @local::ReadTrackCaloMatching - - - } - -#------------------------------------------------------------------------------ -# paths -# write out ntuple only, so don't need compression modules... -#------------------------------------------------------------------------------ - p1 : [generate, g4run - , FilterStepPointMomentum - , protonTimeMap, muonTimeMap - , makeSD, makeSH - , @sequence::CaloDigiMC.DigiSim - , @sequence::CaloReco.Reco - , @sequence::CaloCluster.Reco -# - , FSHPreStereo, MakeStereoHits, FlagStrawHits, FlagBkgHits, TrkPatRec -# - , MakeStrawHitPositions - , CalPatRec - , MergePatRec -# - , TrkExtrapol, CaloMatching - - , ParticleID -# - , InitStntuple, StntupleMaker, FillStntuple - ] - - trigger_paths : [p1] - -# out : [detectorOutput] - out : [ - ReadTrkExtrapol - , ReadTrackCaloMatching - ] -# an : [genCountLogger] - end_paths : [out] -} - -outputs: { - detectorOutput : { - module_type : RootOutput -# SelectEvents: [p1] - outputCommands: [ "keep *_*_*_*", - "drop uintmu2e::PhysicalVolumeInfomvstd::pairs_g4run_*_*" - ] - fileName : "{OUTPUT_DATA_FILE}" - } -} -#------------------------------------------------------------------------------ -# redefinitions -#------------------------------------------------------------------------------ -# 1. only for interactive submission -#------------------------------------------------------------------------------ -services.SeedService.baseSeed : 8 -services.SeedService.maxUniqueEngines : 20 - -# print per event timing for ::event entry points -# services.Timing: { } -# print -services.scheduler.wantSummary: true -services.TFileService.fileName : "readTrackCluster.hist" - - -physics.filters.InitStntuple.histFileName : "readTrackCluster.stn" - - -# Apply the time offsets in tracker digitization -physics.producers.makeSD.TimeOffsets : { inputs : [ "protonTimeMap", "muonTimeMap" ] } -physics.producers.CaloReadoutHitsMaker.TimeOffsets : { inputs : [ "protonTimeMap", "muonTimeMap" ] } -physics.producers.makeSD.g4ModuleLabel : g4run -physics.producers.makeSH.g4ModuleLabel : g4run -physics.producers.CaloReadoutHitsMaker.g4ModuleLabel : g4run - -physics.producers.CalPatRec.minClusterEnergy : 60. -physics.producers.CalPatRec. minClusterSize : 2 -physics.producers.CalPatRec.HelixFit.distPatRec : 100. -physics.producers.CalPatRec.BackgroundSelectionBits : ["Background","Isolated"] - - -physics.producers.TrkExtrapol.fitterModuleLabel : MergePatRec -physics.producers.CaloMatching.fitterModuleLabel : MergePatRec -physics.producers.ParticleID.fitterModuleLabel : MergePatRec - - physics.filters.StntupleMaker.trkPatRec1 : MergePatRec - physics.filters.StntupleMaker.g4ModuleLabel : g4run - physics.filters.StntupleMaker.trkExtrapol : TrkExtrapol - physics.filters.StntupleMaker.trkCalMatch : CaloMatching diff --git a/CaloDiag/src/SConscript b/CaloDiag/src/SConscript index c2d285a77c..9a507fa2e2 100644 --- a/CaloDiag/src/SConscript +++ b/CaloDiag/src/SConscript @@ -18,7 +18,6 @@ mainlib = helper.make_mainlib ( ['fhiclcpp_types', 'tbb',] ) helper.make_plugins( [ mainlib, - 'mu2e_TrkExt', 'mu2e_TrkDiag', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', diff --git a/CaloFilters/src/SConscript b/CaloFilters/src/SConscript index b55743a885..ce1c23389e 100644 --- a/CaloFilters/src/SConscript +++ b/CaloFilters/src/SConscript @@ -17,7 +17,6 @@ extrarootlibs = [ 'Geom', 'TMVA' , 'Minuit' , 'XMLIO' ] mainlib = helper.make_mainlib ( [] ) helper.make_plugins( [ mainlib, - 'mu2e_TrkExt', 'mu2e_TrkDiag', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index 45dc3f34ba..80608be64f 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -1300,7 +1300,6 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS } } - // TrkExt track trackInfos.clear(); } diff --git a/Trigger/src/SConscript b/Trigger/src/SConscript index a817b61c66..d5d7a8eb9b 100644 --- a/Trigger/src/SConscript +++ b/Trigger/src/SConscript @@ -17,7 +17,6 @@ extrarootlibs = [ 'Geom', 'TMVA' , 'Minuit' , 'XMLIO' ] mainlib = helper.make_mainlib ( [] ) helper.make_plugins( [ mainlib, - 'mu2e_TrkExt', 'mu2e_TrkDiag', 'mu2e_Mu2eUtilities', 'mu2e_CaloCluster', From 2a993529adf09f971b20499a5e601860112c8ec6 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 19:13:59 -0600 Subject: [PATCH 112/174] Protect against 0 prescale --- Trigger/src/PrescaleEvent_module.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Trigger/src/PrescaleEvent_module.cc b/Trigger/src/PrescaleEvent_module.cc index 11d0f07252..0f64fadeb5 100644 --- a/Trigger/src/PrescaleEvent_module.cc +++ b/Trigger/src/PrescaleEvent_module.cc @@ -112,7 +112,9 @@ namespace mu2e bool PrescaleEvent::endSubRun( art::SubRun& subrun ) { for (size_t imode = 0; imode < eventMode_.size(); imode++){ auto const& mode = eventMode_[imode]; - double frac = 1.0/double(mode.prescale_); + double frac = 0.0; + if(mode.prescale_ >= 0.0)frac = 1.0/double(mode.prescale_); + auto ff = std::make_unique(FilterFraction::constant, frac, nevt_[imode],npass_[imode]); subrun.put(std::move(ff),mode.name_,art::fullSubRun()); if(debug_ > 0){ From a46da24a7289b9849cc277cb28d3b156f95a7e79 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 2 Feb 2026 18:09:07 -0800 Subject: [PATCH 113/174] Remove fcl dependencies --- Print/fcl/printLong.fcl | 9 - TrkDiag/fcl/prolog.fcl | 2 +- TrkPatRec/fcl/prolog.fcl | 381 +------------------------------------- fcl/standardProducers.fcl | 2 - 4 files changed, 2 insertions(+), 392 deletions(-) diff --git a/Print/fcl/printLong.fcl b/Print/fcl/printLong.fcl index ec5f74f6bf..5643c9b91f 100644 --- a/Print/fcl/printLong.fcl +++ b/Print/fcl/printLong.fcl @@ -129,15 +129,6 @@ physics :{ timeClusterPrinter : { verbose: 1 # 0, 1 } - trackClusterMatchPrinter : { - verbose: 2 # 0, 1, 2 - #inputTags : [ "TrackCaloMatchingDem" ] # select instances - } - trkCaloIntersectPrinter : { - verbose: 1 # 0, 1 - #inputTags : [ "TrackCaloIntersectionDem" ] # select instances - } - trackSummaryPrinter : { verbose: 4 # 0 - 4 #inputTags : [ "TrackSummaryMaker" ] # select instances diff --git a/TrkDiag/fcl/prolog.fcl b/TrkDiag/fcl/prolog.fcl index 99c7de28d3..a3f395f779 100644 --- a/TrkDiag/fcl/prolog.fcl +++ b/TrkDiag/fcl/prolog.fcl @@ -38,7 +38,7 @@ TCD : { VDStepPointMCCollection : "compressDigiMCs:virtualdetector" MCPrimary : compressDigiMCs T0Calculator : { - TrkToCaloTimeOffset : @local::TrackCaloMatching.DtOffset + TrkToCaloTimeOffset : 0.0 CaloTimeErr : 0.5 StrawHitBeta : 1.0 } diff --git a/TrkPatRec/fcl/prolog.fcl b/TrkPatRec/fcl/prolog.fcl index 6c36561915..a17fe5fe5d 100644 --- a/TrkPatRec/fcl/prolog.fcl +++ b/TrkPatRec/fcl/prolog.fcl @@ -8,7 +8,7 @@ BEGIN_PROLOG TrkPatRec : { TimeCalculator : { - TrkToCaloTimeOffset : @local::TrackCaloMatching.DtOffset + TrkToCaloTimeOffset : 0.0 CaloTimeErr : 0.5 } @@ -279,319 +279,8 @@ TrkPatRec : { @table::TrkPatRec } # pattern recognition internals - # Kalman fit configuration for the seed fit (least squares configuration of Kalman fit) - KFSeed : { - MaxIterations : 3 - fieldCorrection : false - materialCorrection : false - seedsmear : 10000 - maxhitchi : 5.0 - # interate the fit twice: once at the physical size of the straw, once at its RMS - # hiterr : [ 5.0, 1.44 ] - # time external error, assuming s drift velocity of 62.5 #mu m / ns - hiterr : [ 80., 23.04] - ambiguityStrategy : [ 0 , 0 ] - t0Tolerance : [ 5.0, 5.0 ] - weedhits : [ true, true ] - ResolveAfterWeeding : false - AddMaterial : [ false, false ] - # initT0 : true - initT0 : false - useTrkCaloHit : false - updateT0 : [false, false ] - dtOffset : @local::TrackCaloMatching.DtOffset - strawHitT0Weight : 1 - caloHitT0Weight : 10 - caloHitError : 15.0 # mm - T0Calculator : { @table::TrkPatRec.TimeCalculator } - mcTruth : 0 - printUtils : { @table::TrkReco.PrintUtils} - } - - # Kalman fit configuration for the final track fit. This also runs the simulated annealing - KFFinal : { - materialCorrection : true - fieldCorrection : true - initT0 : false - ResolveAfterWeeding : false - # time external error, assuming s drift velocity of 62.5 #mu m / ns - # hiterr : [ 5.0, 1.5, 0.5, 0.25, 0.125, 0.05, 0.0, 0.0, 0.0] - hiterr : [ 32., 16., 8., 4, 2., 1.0, 0.0, 0.0, 0.0] # ns - t0Tolerance : [ 2.0, 1.0, 1.0, 1.0 , 0.5 , 0.5 , 0.2, 0.2, 0.1] - updateT0 : [false, false, false, true, true, true, true, true, true ] - # specific choices for ambiguity resolution - weedhits : @local::PanelAmbig.Weed - AddMaterial : [ false, false, false, true, false, false, false, true, false ] - PanelAmbigResolver : @local::PanelAmbig.Resolver - ambiguityStrategy : @local::PanelAmbig.Strategy - # Extend downstream to the calorimeter by default - DownstreamExtent : 3 - # the following is redundant with the TrkTimeCalculator offset FIXME! - dtOffset : @local::TrackCaloMatching.DtOffset - strawHitT0Weight : 1 # unused? FIXME! - caloHitT0Weight : 10 # unused? FIXME! - caloHitError : 15.0 # mm - T0Calculator : { @table::TrkPatRec.TimeCalculator } - useTrkCaloHit : true - t0window : 4.0 - mcTruth : 0 - printUtils : { @table::TrkReco.PrintUtils } - } - # KalFit (Kalman fiter) configuration for Doublet Ambig Resolver - CprKFFinal : { - debugLevel : 0 - minnstraws : 15 - MaximumMaterialFlightDifference : 1000 # mm separation in flightlength - materialCorrection : true - weedhits : [ true , true , true , true, true , true , true , true, true ] - maxhitchi : 5. # 3.5 - maxPull : 10. - maxweed : 10 - mingap : 1.0 - ambiguityStrategy : [ 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ] - AddMaterial : [ false, false, false, true, false, false, false, true, true ] - hiterr : [ 80. , 24. , 8. , 4. , 2. , 0.8 , 0.0 , 0.0 , 0.0 ] - t0Tolerance : [ 2.0 , 1.0 , 1.0 , 1.0 , 0.5 , 0.5 , 0.2 , 0.2 , 0.1 ] - # not used t0ErrorFactor : 1.2 # scale ? - minT0DOCA : -0.2 # - t0window : 2.5 - dtOffset : @local::TrackCaloMatching.DtOffset - # did Dave mean that? - updateT0 : [ false, true, true, true, true, true, true, true, true ] - DivergeFlt : 1000. - #------------------------------------------------------------------------------ - # KalContext parameters (there are more to define ! ) - #------------------------------------------------------------------------------ - MinNDOF : 10 # this means 15 hits min - #------------------------------------------------------------------------------ - # ambiguity resolver parameters - #------------------------------------------------------------------------------ - FixedAmbigResolver : {} - HitAmbigResolver : {} - PocaAmbigResolver : {} - PanelAmbigResolver : {} - #------------------------------------------------------------------------------ - # doublet-based ambiguity resolver parameters - #------------------------------------------------------------------------------ - DoubletAmbigResolver : { @table::TrkReco.DoubletAmbigResolver } - fieldCorrection : true - # scaleErrDoublet : 5. - # minDriftDoublet : 0.3 - # deltaDriftDoublet : 0.3 - # maxDoubletChi2 : 9 - # sigmaSlope : 0.025 - printUtils : { @table::TrkReco.PrintUtils } - } -} - -TrkPatRec : {@table::TrkPatRec - # Seed fit; this is really a least-squares fit, but uses the Kalman infrastructure - KSF : { - module_type : KalSeedFit - ComboHitCollection : "makeSH" - KalFit : { @table::TrkPatRec.KFSeed } - ParameterErrors : [10.0,0.05,0.001,10.0,0.05] - # ParameterErrors : [1.0,1.0,1.0,1.0,1.0] - MaxAddDoca : 7. # mm - MaxAddChi : 5. # normalized unit - rescueHits : 1 # turned on (CalPatRec style) - } - # Final Kalman fit, including material and magnetic inhomogeneity effects - KFF : { - module_type : KalFinalFit - ComboHitCollection : "makeSH" - CaloClusterCollection : "CaloClusterMaker" - KalFit : { @table::TrkPatRec.KFFinal } - GoodKallSeedFitBits : ["SeedOK"] - AddHitSelectionBits : [] - AddHitBackgroundBits : [ @sequence::TrkPatRec.TrkFitBackground ] - ZSavePositions : [-1631.11, -1522.0, 0.0, 1522.0 ] - } -} -TrkPatRec : { @table::TrkPatRec - # seed Fit configuration for specific particles - # First, downstream electrons - KSFDeM : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderDe:Positive" - fitparticle : @local::Particle.eminus - fitdirection : @local::FitDir.downstream - } - # upstream electrons - KSFUeM : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderUe:Negative" - fitparticle : @local::Particle.eminus - fitdirection : @local::FitDir.upstream - } - # downstream positrons - KSFDeP : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderDe:Negative" - fitparticle : @local::Particle.eplus - fitdirection : @local::FitDir.downstream - } - # upstream positrons - KSFUeP : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderUe:Positive" - fitparticle : @local::Particle.eplus - fitdirection : @local::FitDir.upstream - } - # downstream mu minus - KSFDmuM : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderDmu:Positive" - fitparticle : @local::Particle.muminus - fitdirection : @local::FitDir.downstream - } - # upstream mu minus - KSFUmuM : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderUmu:Negative" - fitparticle : @local::Particle.muminus - fitdirection : @local::FitDir.upstream - } - # downstream mu plus - KSFDmuP : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderDmu:Negative" - fitparticle : @local::Particle.muplus - fitdirection : @local::FitDir.downstream - } - # upstream mu plus - KSFUmuP : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderUmu:Positive" - fitparticle : @local::Particle.muplus - fitdirection : @local::FitDir.upstream - } - # downstream pi minus - KSFDpiM : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderDpi:Positive" - fitparticle : @local::Particle.piminus - fitdirection : @local::FitDir.downstream - } - # upstream pi minus - KSFUpiM : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderUpi:Negative" - fitparticle : @local::Particle.piminus - fitdirection : @local::FitDir.upstream - } - # downstream pi plus - KSFDpiP : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderDpi:Negative" - fitparticle : @local::Particle.piplus - fitdirection : @local::FitDir.downstream - } - # upstream pi plus - KSFUpiP : { - @table::TrkPatRec.KSF - SeedCollection : "HelixFinderUpi:Positive" - fitparticle : @local::Particle.piplus - fitdirection : @local::FitDir.upstream - } - # Final Fit configuration for specific particles - # First, downstream electrons - KFFDeM : { - @table::TrkPatRec.KFF - SeedCollection : "KSFDeM" - fitparticle : @local::Particle.eminus - fitdirection : @local::FitDir.downstream - } - - # upstream electrons - KFFUeM : { - @table::TrkPatRec.KFF - SeedCollection : "KSFUeM" - fitparticle : @local::Particle.eminus - fitdirection : @local::FitDir.upstream - } - - # downstream positrons - KFFDeP : { - @table::TrkPatRec.KFF - SeedCollection : "KSFDeP" - fitparticle : @local::Particle.eplus - fitdirection : @local::FitDir.downstream - } - # upstream positrons - KFFUeP : { - @table::TrkPatRec.KFF - SeedCollection : "KSFUeP" - fitparticle : @local::Particle.eplus - fitdirection : @local::FitDir.upstream - } - - # downstream mu minus - KFFDmuM : { - @table::TrkPatRec.KFF - SeedCollection : "KSFDmuM" - fitparticle : @local::Particle.muminus - fitdirection : @local::FitDir.downstream - } - - # upstream mu minus - KFFUmuM : { - @table::TrkPatRec.KFF - SeedCollection : "KSFUmuM" - fitparticle : @local::Particle.muminus - fitdirection : @local::FitDir.upstream - } - - # downstream mu plus - KFFDmuP : { - @table::TrkPatRec.KFF - SeedCollection : "KSFDmuP" - fitparticle : @local::Particle.muplus - fitdirection : @local::FitDir.downstream - } - - # upstream mu plus - KFFUmuP : { - @table::TrkPatRec.KFF - SeedCollection : "KSFUmuP" - fitparticle : @local::Particle.muplus - fitdirection : @local::FitDir.upstream - } - - # downstream pi minus - KFFDpiM : { - @table::TrkPatRec.KFF - SeedCollection : "KSFDpiM" - fitparticle : @local::Particle.piminus - fitdirection : @local::FitDir.downstream - } - - # upstream pi minus - KFFUpiM : { - @table::TrkPatRec.KFF - SeedCollection : "KSFUpiM" - fitparticle : @local::Particle.piminus - fitdirection : @local::FitDir.upstream - } - - # downstream pi plus - KFFDpiP : { - @table::TrkPatRec.KFF - SeedCollection : "KSFDpiP" - fitparticle : @local::Particle.piplus - fitdirection : @local::FitDir.downstream - } - - # upstream pi plus - KFFUpiP : { - @table::TrkPatRec.KFF - SeedCollection : "KSFUpiP" - fitparticle : @local::Particle.piplus - fitdirection : @local::FitDir.upstream - } -} TrkPatRec : { @table::TrkPatRec # Final fit of merged Helices : these depend on TrkPatRec MHFinalFitDeM : { @@ -640,35 +329,6 @@ TrkPatRec : { @table::TrkPatRec MultiHelixFinderUmu : { @table::TrkPatRec.MultiHelixFinderUmu} MultiHelixFinderUpi : { @table::TrkPatRec.MultiHelixFinderUpi} - - # should add proton FIXME! - # now all the different track fits based on these inputs - # First, seed fits - KSFDeM : { @table::TrkPatRec.KSFDeM} - KSFUeM : { @table::TrkPatRec.KSFUeM} - KSFDeP : { @table::TrkPatRec.KSFDeP} - KSFUeP : { @table::TrkPatRec.KSFUeP} - KSFDmuM : { @table::TrkPatRec.KSFDmuM} - KSFUmuM : { @table::TrkPatRec.KSFUmuM} - KSFDmuP : { @table::TrkPatRec.KSFDmuP} - KSFUmuP : { @table::TrkPatRec.KSFUmuP} - KSFDpiM : { @table::TrkPatRec.KSFDpiM} - KSFUpiM : { @table::TrkPatRec.KSFUpiM} - KSFDpiP : { @table::TrkPatRec.KSFDpiP} - KSFUpiP : { @table::TrkPatRec.KSFUpiP} - # Final Kalman fit - KFFDeM : { @table::TrkPatRec.KFFDeM} - KFFUeM : { @table::TrkPatRec.KFFUeM} - KFFDeP : { @table::TrkPatRec.KFFDeP} - KFFUeP : { @table::TrkPatRec.KFFUeP} - KFFDmuM : { @table::TrkPatRec.KFFDmuM} - KFFUmuM : { @table::TrkPatRec.KFFUmuM} - KFFDmuP : { @table::TrkPatRec.KFFDmuP} - KFFUmuP : { @table::TrkPatRec.KFFUmuP} - KFFDpiM : { @table::TrkPatRec.KFFDpiM} - KFFUpiM : { @table::TrkPatRec.KFFUpiM} - KFFDpiP : { @table::TrkPatRec.KFFDpiP} - KFFUpiP : { @table::TrkPatRec.KFFUpiP} # configuration for using the sequence with MergeHelix # Only downstream: upstream can't be seeded by a cluster! MHFinalFitDeM : { @table::TrkPatRec.MHFinalFitDeM} @@ -676,44 +336,5 @@ TrkPatRec : { @table::TrkPatRec MHFinalFitDmuM : { @table::TrkPatRec.MHFinalFitDmuM} MHFinalFitDmuP : { @table::TrkPatRec.MHFinalFitDmuP } } - - # define standard outputs - Output : { - Digis : [ "keep mu2e::StrawDigis_*_*_*" ] - Hits : [ "keep mu2e::StrawHitFlagDetailmu2e::BitMaps_flagPH_*_*", - "keep mu2e::ComboHitCollection_*_*_*", - "keep mu2e::StrawHits_*_*_*" ] - - Tracks : [ "keep mu2e::StrawHitFlagDetailmu2e::BitMaps_flagPH_StrawHits_*", - "keep mu2e::ComboHitCollection_makePH_*_*", - "keep mu2e::KalSeeds_*_*_*", - "keep mu2e::KalSeeds_*_*_*", - "keep mu2e::HelixSeeds_*_*_*", - "keep mu2e::TimeClusters_*_*_*" ] - - MCTracks : ["keep mu2e::GenParticles_*_*_*", - "keep mu2e::SimParticles_*_*_*" ] - MCDigis : ["keep mu2e::StrawDigiMCs_*_*_*"] - MCHits : [ "keep mu2e::StepPointMCs_*_tracker_*", - "keep mu2e::StepPointMCs_*_virtualdetector_*"] - - } - - # production sequences for tracking specific paricles; first electrons - TPRDeM : [ TimeClusterFinderDe, HelixFinderDe, KSFDeM, KFFDeM ] - TPRUeM : [ TimeClusterFinderUe, HelixFinderUe, KSFUeM, KFFUeM ] - TPRDeP : [ TimeClusterFinderDe, HelixFinderDe, KSFDeP, KFFDeP ] - TPRUeP : [ TimeClusterFinderUe, HelixFinderUe, KSFUeP, KFFUeP ] - #muons - TPRDmuM : [ TimeClusterFinderDmu, HelixFinderDmu, KSFDmuM, KFFDmuM ] - TPRUmuM : [ TimeClusterFinderUmu, HelixFinderUmu, KSFUmuM, KFFUmuM ] - TPRDmuP : [ TimeClusterFinderDmu, HelixFinderDmu, KSFDmuP, KFFDmuP ] - TPRUmuP : [ TimeClusterFinderUmu, HelixFinderUmu, KSFUmuP, KFFUmuP ] - #pions - TPRDpiM : [ TimeClusterFinderDpi, HelixFinderDpi, KSFDpiM, KFFDpiM ] - TPRUpiM : [ TimeClusterFinderUpi, HelixFinderUpi, KSFUpiM, KFFUpiM ] - TPRDpiP : [ TimeClusterFinderDpi, HelixFinderDpi, KSFDpiP, KFFDpiP ] - TPRUpiP : [ TimeClusterFinderUpi, HelixFinderUpi, KSFUpiP, KFFUpiP ] - } END_PROLOG diff --git a/fcl/standardProducers.fcl b/fcl/standardProducers.fcl index d9a9410786..7ac40ebe14 100644 --- a/fcl/standardProducers.fcl +++ b/fcl/standardProducers.fcl @@ -15,8 +15,6 @@ #include "Offline/TrkPatRec/fcl/prolog.fcl" #include "Offline/Mu2eKinKal/fcl/prolog.fcl" #include "Offline/CalPatRec/fcl/prolog.fcl" -#include "Offline/TrackCaloMatching/fcl/prolog.fcl" -#include "Offline/ParticleID/fcl/prolog.fcl" #include "Offline/EventMixing/fcl/prolog.fcl" #include "Offline/CaloMC/fcl/prolog.fcl" #include "Offline/CaloReco/fcl/prolog.fcl" From 4c5637c20e6a5037bae62e46626801f55aaca6d1 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 3 Feb 2026 10:53:53 -0800 Subject: [PATCH 114/174] Small cleanups --- TrkPatRec/fcl/prolog.fcl | 26 -------------------------- TrkReco/CMakeLists.txt | 2 -- 2 files changed, 28 deletions(-) diff --git a/TrkPatRec/fcl/prolog.fcl b/TrkPatRec/fcl/prolog.fcl index a17fe5fe5d..bd74af0ef1 100644 --- a/TrkPatRec/fcl/prolog.fcl +++ b/TrkPatRec/fcl/prolog.fcl @@ -277,32 +277,6 @@ TrkPatRec : { @table::TrkPatRec @table::TrkPatRec.RobustMultiHelixFinder TimeClusterCollection : "TimeClusterFinderUpi" } - - # pattern recognition internals - - -TrkPatRec : { @table::TrkPatRec - # Final fit of merged Helices : these depend on TrkPatRec - MHFinalFitDeM : { - @table::TrkPatRec.KFFDeM - SeedCollection : MHSeedFitDem - } - - MHFinalFitDeP : { - @table::TrkPatRec.KFFDeP - SeedCollection : MHSeedFitDep - } - - MHFinalFitDmuM : { - @table::TrkPatRec.KFFDmuM - SeedCollection : MHSeedFitDmm - } - # - MHFinalFitDmuP : { - @table::TrkPatRec.KFFDmuP - SeedCollection : MHSeedFitDmp - } - } # Declare a table with all the modules needed for track reconstruction diff --git a/TrkReco/CMakeLists.txt b/TrkReco/CMakeLists.txt index fd5c232124..39f7f8349c 100644 --- a/TrkReco/CMakeLists.txt +++ b/TrkReco/CMakeLists.txt @@ -1,7 +1,5 @@ cet_make_library( SOURCE -# src/PanelAmbigStructs.cc -# src/PanelStateIterator.cc src/RobustHelixFinderData.cc src/RobustHelixFit.cc src/TrkTimeCalculator.cc From 6f296817894f0361399ef493b23e6753c4a35f90 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Tue, 3 Feb 2026 14:11:13 -0600 Subject: [PATCH 115/174] Allow angle restriction and force photon generation for CAPHRI studies --- .../src/MuCap1809keVGammaGenerator_tool.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc b/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc index 531606e970..5ab4dd2db8 100644 --- a/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc +++ b/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc @@ -18,13 +18,21 @@ namespace mu2e { struct PhysConfig { using Name=fhicl::Name; using Comment=fhicl::Comment; + fhicl::Atom czMin {Name("czmin") , Comment("Restrict cos(theta_z) minimum"), -1.}; + fhicl::Atom czMax {Name("czmax") , Comment("Restrict cos(theta_z) maximum"), 1.}; + fhicl::Atom fireAll{Name("fireAll"), Comment("Add a photon to all events, otherwise use the branching fraction"), false}; }; typedef art::ToolConfigTable Parameters; explicit MuCap1809keVGammaGenerator(Parameters const& conf) : + _czMin(conf().czMin()), + _czMax(conf().czMax()), + _fireAll(conf().fireAll()), _pdgId(PDGCode::gamma), _mass(GlobalConstantsHandle()->particle(_pdgId).mass()) - {} + { + if(_czMin < -1. || _czMax > 1. || _czMin > _czMax) throw cet::exception("BADCONFIG") << "Cos(theta_z) range unphysical: " << _czMin << " - " << _czMax; + } std::vector generate() override; void generate(std::unique_ptr& out, const IO::StoppedParticleF& stop) override; @@ -32,11 +40,14 @@ namespace mu2e { void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { _energy = GlobalConstantsHandle()->get1809keVGammaEnergy(material); _intensity = GlobalConstantsHandle()->get1809keVGammaIntensity(material); - _randomUnitSphere = new RandomUnitSphere(eng); + _randomUnitSphere = new RandomUnitSphere(eng, _czMin, _czMax); _randFlat = new CLHEP::RandFlat(eng); } private: + double _czMin; + double _czMax; + bool _fireAll; PDGCode::type _pdgId; double _mass; double _energy = 0.; @@ -49,8 +60,8 @@ namespace mu2e { std::vector MuCap1809keVGammaGenerator::generate() { std::vector res; - double rand = _randFlat->fire(); - if (rand < _intensity) { + const bool fire = (_fireAll) ? true : _randFlat->fire() < _intensity; + if (fire) { const double momentum = _energy * sqrt(1 - std::pow(_mass/_energy,2)); CLHEP::Hep3Vector p3 = _randomUnitSphere->fire(momentum); CLHEP::HepLorentzVector fourmom(p3, _energy); From 680c5d0717334ec9ceea4878bc1c026766a8f654 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 3 Feb 2026 15:06:22 -0600 Subject: [PATCH 116/174] restore behavior for negative prescales --- Trigger/src/PrescaleEvent_module.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Trigger/src/PrescaleEvent_module.cc b/Trigger/src/PrescaleEvent_module.cc index 0f64fadeb5..fab5f71d76 100644 --- a/Trigger/src/PrescaleEvent_module.cc +++ b/Trigger/src/PrescaleEvent_module.cc @@ -100,7 +100,7 @@ namespace mu2e if (spillType == ewm.spillType()){ ++nevt_[imode]; // Apply the prescale - bool retval = e.event() % mode.prescale_ == 0; + bool retval = mode.prescale_ > 0 ? e.event() % mode.prescale_ == 0 : false; if (retval) ++npass_[imode]; return retval; } @@ -112,9 +112,7 @@ namespace mu2e bool PrescaleEvent::endSubRun( art::SubRun& subrun ) { for (size_t imode = 0; imode < eventMode_.size(); imode++){ auto const& mode = eventMode_[imode]; - double frac = 0.0; - if(mode.prescale_ >= 0.0)frac = 1.0/double(mode.prescale_); - + double frac = mode.prescale_ > 0 ? 1.0/double(mode.prescale_) : 0; auto ff = std::make_unique(FilterFraction::constant, frac, nevt_[imode],npass_[imode]); subrun.put(std::move(ff),mode.name_,art::fullSubRun()); if(debug_ > 0){ From a3856bccf6f132876eaad990f18f02ed86090ff2 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 3 Feb 2026 13:18:55 -0800 Subject: [PATCH 117/174] more cleanup --- TrkDiag/fcl/prolog.fcl | 2 - TrkDiag/src/TrkRecoDiag_module.cc | 4 +- .../test/kalSeedToTrkQualTree_noFilter.fcl | 2 - TrkFilters/fcl/TTDigis.fcl | 105 ------------------ 4 files changed, 2 insertions(+), 111 deletions(-) delete mode 100644 TrkFilters/fcl/TTDigis.fcl diff --git a/TrkDiag/fcl/prolog.fcl b/TrkDiag/fcl/prolog.fcl index a3f395f779..1b68711475 100644 --- a/TrkDiag/fcl/prolog.fcl +++ b/TrkDiag/fcl/prolog.fcl @@ -72,9 +72,7 @@ TrkPID : { } # this module only makes sense for downstream electron fits TrkPIDDeM : @local::TrkPID -TrkPIDDeM.KalSeedCollection : "KFFDeM" TrkPIDDeP : @local::TrkPID -TrkPIDDeP.KalSeedCollection : "KFFDeP" TrkDiag : { analyzers : { diff --git a/TrkDiag/src/TrkRecoDiag_module.cc b/TrkDiag/src/TrkRecoDiag_module.cc index b34b5d77cd..5dd14b6ab7 100644 --- a/TrkDiag/src/TrkRecoDiag_module.cc +++ b/TrkDiag/src/TrkRecoDiag_module.cc @@ -149,8 +149,8 @@ namespace mu2e { _goodks(pset.get >("GoodKalSeedFlag",vector{"SeedOK"})), _goodhs(pset.get >("GoodHelixFlag",vector{"HelixOK"})), _hsTag(pset.get("HelixSeedCollection","HelixFinder:Positive")), - _ksTag(pset.get("KalSeedFitCollection","KSFDeM")), - _kfTag(pset.get("KalFinalFitCollection","KFFDeM")), + _ksTag(pset.get("KalSeedFitCollection")), + _kfTag(pset.get("KalFinalFitCollection")), _tqTag(pset.get("TrkQualTag","TrkQualDeM")), _tcTag(pset.get("TimeClusterCollection","TimeClusterFinder")), _chTag(pset.get("ComboHitCollection","makePH")), diff --git a/TrkDiag/test/kalSeedToTrkQualTree_noFilter.fcl b/TrkDiag/test/kalSeedToTrkQualTree_noFilter.fcl index 7e410c0b5d..62af4350cd 100644 --- a/TrkDiag/test/kalSeedToTrkQualTree_noFilter.fcl +++ b/TrkDiag/test/kalSeedToTrkQualTree_noFilter.fcl @@ -28,10 +28,8 @@ physics : { kalSeedToTrkQualTree : { module_type: KalSeedToTrkQualTree - kalFinalTag : "KFFDeM" strawDigiMCTag: "makeSD" stepPointMCTag: "detectorFilter:virtualdetector" - trkQualTag : "KFFDeM" usingCondensedCollections : false # indexMapTag : "kalSeedFilter" diff --git a/TrkFilters/fcl/TTDigis.fcl b/TrkFilters/fcl/TTDigis.fcl deleted file mode 100644 index 5c2855af51..0000000000 --- a/TrkFilters/fcl/TTDigis.fcl +++ /dev/null @@ -1,105 +0,0 @@ -# -# Tracker-only trigger based on digis -# -# > mu2e --config TrkFilters/fcl/TTDigis.fcl --source "your digis file" --TFile TTDigis.root --nevts=100 -# -#include "Offline/fcl/minimalMessageService.fcl" -#include "Offline/fcl/standardServices.fcl" -#include "Offline/fcl/standardProducers.fcl" -#include "Offline/TrkHitReco/fcl/prolog.fcl" -#include "Offline/TrkPatRec/fcl/prolog.fcl" -#include "Offline/TrkFilters/fcl/prolog.fcl" -#include "Offline/TrkDiag/fcl/prolog.fcl" - -process_name : TTDigis - -source : -{ - module_type : RootInput -} -# we don't need any simulation services for this job -services : @local::Services.Reco - -services : { - message : @local::default_message - TFileService : { fileName : "TTDigis.hist" } - - RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } - # Timing : { } - - GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } - Mu2eG4Helper : { } - SeedService : { @table::automaticSeeds - baseSeed : 8 - maxUniqueEngines : 20 - } - -} - -# timing information -services.TimeTracker : { - dbOutput : { - filename : "TTDigis.db" - overwrite : true - } -} -# setup modules needed to filter tracks -physics : -{ - producers : { - @table::TrkHitReco.producers - @table::Tracking.TrkTrigger.producers - - TTKSFDeM : @local::TTKSF - TTKSFDeP : @local::TTKSF - RSD : { - module_type : ReadStrawDigi - } - - } - filters : { - @table::TrkTrigger.Filters - @table::CalPatRec.filters - } - # analyzers : { - # TrkTriggerDiag : { - # module_type : TrkTriggerDiag - # } - # } -} - -# physics.filters.PosHelixFilter.MinMomentum : 220.0 -# physics.filters.NegHelixFilter.MinMomentum : 220.0 -# physics.filters.DeMSeedFilter.MinMomentum : 95.0 -# physics.filters.DePSeedFilter.MinMomentum : 95.0 - -physics.filters.PosHelixFilter.MinMomentum : 180.0 -physics.filters.NegHelixFilter.MinMomentum : 180.0 -physics.filters.PosHelixFilter.MinNHits : 15.0 -physics.filters.NegHelixFilter.MinNHits : 15.0 -physics.filters.DeMSeedFilter.MinMomentum : 75.0 -physics.filters.DePSeedFilter.MinMomentum : 75.0 - -physics.producers.TTKSFDeM.SeedCollection : "TThelixFinder:Positive" -physics.producers.TTKSFDeM.fitparticle : @local::Particle.eminus -physics.producers.TTKSFDeM.fitdirection : @local::FitDir.downstream -physics.producers.TTKSFDeM.KalFit.MaxIterations : 1 - -physics.producers.TTKSFDeP.SeedCollection : "TThelixFinder:Negative" -physics.producers.TTKSFDeP.fitparticle : @local::Particle.eplus -physics.producers.TTKSFDeP.fitdirection : @local::FitDir.downstream -physics.producers.TTKSFDeP.KalFit.MaxIterations : 1 - -# create a trigger test path. Note that physics.trigger_paths and physics.end_paths are not used, art will -# create those automatically from all the defined paths - -physics.TCTrigPath : [ RSD, @sequence::TrkTrigger.Sequences.TCFilterSequence ] -physics.PHTrigPath : [ RSD, @sequence::TrkTrigger.Sequences.PosHelixFilterSequence ] -physics.DeMSeedTrigPath : [RSD, @sequence::TrkTrigger.Sequences.DeMSeedFilterSequence ] -physics.DePSeedTrigPath : [RSD, @sequence::TrkTrigger.Sequences.DePSeedFilterSequence ] - -# analysis path: this is for monitoring only -# physics.TTDigisEndPath : [ TrkTriggerDiag ] - From 6aa47d8cf80934fb3d71d6fe738564d0b8417833 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 3 Feb 2026 13:35:27 -0800 Subject: [PATCH 118/174] tweaks --- TrkPatRec/fcl/prolog.fcl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/TrkPatRec/fcl/prolog.fcl b/TrkPatRec/fcl/prolog.fcl index bd74af0ef1..12d6a2a101 100644 --- a/TrkPatRec/fcl/prolog.fcl +++ b/TrkPatRec/fcl/prolog.fcl @@ -303,12 +303,6 @@ TrkPatRec : { @table::TrkPatRec MultiHelixFinderUmu : { @table::TrkPatRec.MultiHelixFinderUmu} MultiHelixFinderUpi : { @table::TrkPatRec.MultiHelixFinderUpi} - # configuration for using the sequence with MergeHelix - # Only downstream: upstream can't be seeded by a cluster! - MHFinalFitDeM : { @table::TrkPatRec.MHFinalFitDeM} - MHFinalFitDeP : { @table::TrkPatRec.MHFinalFitDeP} - MHFinalFitDmuM : { @table::TrkPatRec.MHFinalFitDmuM} - MHFinalFitDmuP : { @table::TrkPatRec.MHFinalFitDmuP } } } END_PROLOG From 3476511eb1a98b9eafa2e3dbb84418ea9ce5767e Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 3 Feb 2026 15:38:31 -0600 Subject: [PATCH 119/174] Add new class --- DataProducts/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DataProducts/CMakeLists.txt b/DataProducts/CMakeLists.txt index e0e4d33c2b..87acfa656d 100644 --- a/DataProducts/CMakeLists.txt +++ b/DataProducts/CMakeLists.txt @@ -6,6 +6,7 @@ cet_make_library( src/CrystalId.cc src/ExtMonFNALChipId.cc src/ExtMonFNALPixelId.cc + src/FilterFraction.cc src/GenVector.cc src/PDGCode.cc src/STMChannel.cc @@ -27,7 +28,7 @@ art_dictionary( NO_CHECK_CLASS_VERSION # For some reason this segfaults Offline::DataProducts ) -if( BUILD_PYTHON_INTERFACE ) +if( BUILD_PYTHON_INTERFACE ) mu2e_swig(DataProducts_swig src/pywrap.i DataProducts) endif() From a14efe1d0c48497356771b8471e8da4c20e34c34 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 3 Feb 2026 18:55:04 -0600 Subject: [PATCH 120/174] Add missing file --- Print/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Print/CMakeLists.txt b/Print/CMakeLists.txt index 01d7deaa37..185295d02d 100644 --- a/Print/CMakeLists.txt +++ b/Print/CMakeLists.txt @@ -19,6 +19,7 @@ cet_make_library( src/CrvStepPrinter.cc src/EventWindowMarkerPrinter.cc src/GenParticlePrinter.cc + src/FilterFractionPrinter.cc src/HelixSeedPrinter.cc src/KalRepPrinter.cc src/KalSeedPrinter.cc @@ -87,21 +88,21 @@ cet_build_plugin(DataProductDump art::module REG_SOURCE src/DataProductDump_module.cc LIBRARIES REG Offline::Print - + ) cet_build_plugin(PrintModule art::module REG_SOURCE src/PrintModule_module.cc LIBRARIES REG Offline::Print - + ) cet_build_plugin(RunSubrunEvent art::module REG_SOURCE src/RunSubrunEvent_module.cc LIBRARIES REG Offline::Print - + ) From 6c18f158a3775e25f19cf45a73bd0707fec5e303 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Thu, 5 Feb 2026 10:25:25 -0600 Subject: [PATCH 121/174] de-clangify a bit --- CaloReco/src/CaloRecoDigiMaker_module.cc | 41 ++++++++++++------------ 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/CaloReco/src/CaloRecoDigiMaker_module.cc b/CaloReco/src/CaloRecoDigiMaker_module.cc index f03ffd8e66..5fc5cf9ce2 100644 --- a/CaloReco/src/CaloRecoDigiMaker_module.cc +++ b/CaloReco/src/CaloRecoDigiMaker_module.cc @@ -26,34 +26,33 @@ class CaloRecoDigiMaker : public art::EDProducer { public: enum processorStrategy { NoChoice, RawExtract, Template }; + //clang-format off struct Config { using Name = fhicl::Name; using Comment = fhicl::Comment; - fhicl::Table proc_raw_conf{Name("RawProcessor"), - Comment("Raw processor config")}; - fhicl::Table proc_templ_conf{ - Name("TemplateProcessor"), Comment("Log normal fit processor config")}; - fhicl::Atom caloDigiCollection{Name("caloDigiCollection"), - Comment("Calo Digi module label")}; - fhicl::Atom pbtTag{Name("ProtonBunchTimeTag"), - Comment("ProtonBunchTime producer")}; - fhicl::Atom usePBT{Name("UseProtonBunchTime"), - Comment("Use the proton bunch time for T0")}; - fhicl::Atom processorStrategy{Name("processorStrategy"), - Comment("Digi reco processor name")}; - fhicl::Atom digiSampling{Name("digiSampling"), Comment("Calo ADC sampling time (ns)")}; - fhicl::Atom maxChi2Cut{Name("maxChi2Cut"), Comment("Chi2 cut for keeping reco digi")}; - fhicl::Atom maxPlots{Name("maxPlots"), Comment("Maximum number of waveform plots")}; - fhicl::Atom diagLevel{Name("diagLevel"), Comment("Diagnosis level")}; + fhicl::Table proc_raw_conf { Name("RawProcessor"), Comment("Raw processor config") }; + fhicl::Table proc_templ_conf { Name("TemplateProcessor"), Comment("Log normal fit processor config") }; + fhicl::Atom caloDigiCollection { Name("caloDigiCollection"), Comment("Calo Digi module label") }; + fhicl::Atom pbtTag { Name("ProtonBunchTimeTag"), Comment("ProtonBunchTime producer") }; + fhicl::Atom usePBT { Name("UseProtonBunchTime"), Comment("Use the proton bunch time for T0") }; + fhicl::Atom processorStrategy { Name("processorStrategy"), Comment("Digi reco processor name") }; + fhicl::Atom digiSampling { Name("digiSampling"), Comment("Calo ADC sampling time (ns)") }; + fhicl::Atom maxChi2Cut { Name("maxChi2Cut"), Comment("Chi2 cut for keeping reco digi") }; + fhicl::Atom maxPlots { Name("maxPlots"), Comment("Maximum number of waveform plots") }; + fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diagnosis level") }; }; + //clang-format on explicit CaloRecoDigiMaker(const art::EDProducer::Table& config) : EDProducer{config}, - caloDigisToken_{consumes(config().caloDigiCollection())}, - pbtTag_{config().pbtTag()}, usePBT_{config().usePBT()}, - processorStrategy_(config().processorStrategy()), digiSampling_(config().digiSampling()), - maxChi2Cut_(config().maxChi2Cut()), maxPlots_(config().maxPlots()), - diagLevel_(config().diagLevel()) { + caloDigisToken_ (consumes(config().caloDigiCollection())), + pbtTag_ (config().pbtTag()), + usePBT_ (config().usePBT()), + processorStrategy_ (config().processorStrategy()), + digiSampling_ (config().digiSampling()), + maxChi2Cut_ (config().maxChi2Cut()), + maxPlots_ (config().maxPlots()), + diagLevel_ (config().diagLevel()) { produces(); if (usePBT_) { From 5b63a678d1f2d726b5edc9336ddd18862ac96256 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Thu, 5 Feb 2026 14:52:16 -0800 Subject: [PATCH 122/174] Remove BTrkData --- BTrkData/src/SConscript | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 BTrkData/src/SConscript diff --git a/BTrkData/src/SConscript b/BTrkData/src/SConscript deleted file mode 100644 index 2aaf9d26e0..0000000000 --- a/BTrkData/src/SConscript +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python -# -# Original author Rob Kutschke. -# - -import os, re -Import('env') - -Import('mu2e_helper') - -helper=mu2e_helper(env) - -babarlibs = env['BABARLIBS'] - -mainlib = helper.make_mainlib ( [ - 'mu2e_TrackerConditions', - 'mu2e_RecoDataProducts', - babarlibs, - 'art_Framework_Services_Registry', - 'art_Utilities', - 'canvas', - 'cetlib', - 'cetlib_except', - 'CLHEP', -] ) - - -# This tells emacs to view this file in python mode. -# Local Variables: -# mode:python -# End: From 84a49b1cef5841988ac05f5eef6a1df7e1156ff6 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 6 Feb 2026 08:23:05 -0800 Subject: [PATCH 123/174] Remove BTRK references --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 054e43d63c..b30a9665ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,8 +108,6 @@ endif() if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../KinKal/KinKalTargets.cmake) include(${CMAKE_CURRENT_BINARY_DIR}/../KinKal/KinKalTargets.cmake) endif() -include_directories($ENV{BTRK_INC}) -link_directories($ENV{BTRK_LIB}) include(ArtDictionary) include(BuildPlugins) From 891aaca8fce8bb066f26d397075afa2254801a53 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 6 Feb 2026 08:28:47 -0800 Subject: [PATCH 124/174] Remove more btrk references --- Print/fcl/print.fcl | 4 +--- Print/src/PrintModule_module.cc | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Print/fcl/print.fcl b/Print/fcl/print.fcl index f4600c07ac..1bc75ed2db 100644 --- a/Print/fcl/print.fcl +++ b/Print/fcl/print.fcl @@ -49,9 +49,7 @@ physics :{ trackSummaryPrinter : { verbose: 3 } - kalRepPrinter : { - verbose: 3 - } + kalSeedPrinter : { verbose: 3 } diff --git a/Print/src/PrintModule_module.cc b/Print/src/PrintModule_module.cc index 6911d2cf59..a0352efcdd 100644 --- a/Print/src/PrintModule_module.cc +++ b/Print/src/PrintModule_module.cc @@ -132,8 +132,6 @@ class PrintModule : public art::EDAnalyzer { fhicl::Name("trkCaloIntersectPrinter")}; fhicl::Table trackSummaryPrinter{ fhicl::Name("trackSummaryPrinter")}; - //fhicl::Table kalRepPrinter{ - // fhicl::Name("kalRepPrinter")}; fhicl::Table comboHitPrinter{ fhicl::Name("comboHitPrinter")}; fhicl::Table timeClusterPrinter{ From 66e911a2d5fbc4a9424ca08e1eae887eaf7c546b Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Fri, 6 Feb 2026 10:40:40 -0600 Subject: [PATCH 125/174] Replace bare pointers with smart pointers in generator tools --- EventGenerator/src/DIOGenerator_tool.cc | 8 +++---- EventGenerator/src/LeadingLog_module.cc | 8 +++---- EventGenerator/src/Mu2eXGenerator_tool.cc | 8 +++---- .../src/MuCap1809keVGammaGenerator_tool.cc | 17 ++++++------- .../src/MuCapDeuteronGenerator_tool.cc | 12 +++++----- .../src/MuCapNeutronGenerator_tool.cc | 12 +++++----- .../src/MuCapPhotonGenerator_tool.cc | 13 +++++----- .../src/MuCapProtonGenerator_tool.cc | 12 +++++----- EventGenerator/src/RMCGenerator_tool.cc | 24 +++++++++---------- .../src/StoppedMuonRMCGun_module.cc | 5 ++-- 10 files changed, 59 insertions(+), 60 deletions(-) diff --git a/EventGenerator/src/DIOGenerator_tool.cc b/EventGenerator/src/DIOGenerator_tool.cc index 7d2c5e61e1..bb0c6091f0 100644 --- a/EventGenerator/src/DIOGenerator_tool.cc +++ b/EventGenerator/src/DIOGenerator_tool.cc @@ -64,8 +64,8 @@ namespace mu2e { void generate(std::unique_ptr& out, const IO::StoppedParticleF& stop) override; void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string&) override { - _randomUnitSphere = new RandomUnitSphere(eng); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _randomUnitSphere = std::make_unique(eng); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } private: @@ -74,8 +74,8 @@ namespace mu2e { BinnedSpectrum _spectrum; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandGeneral* _randSpectrum; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randSpectrum; }; diff --git a/EventGenerator/src/LeadingLog_module.cc b/EventGenerator/src/LeadingLog_module.cc index 1e2e52a80e..422a152d7b 100644 --- a/EventGenerator/src/LeadingLog_module.cc +++ b/EventGenerator/src/LeadingLog_module.cc @@ -78,8 +78,8 @@ namespace mu2e { double _mass; BinnedSpectrum spectrum_; - RandomUnitSphere* randomUnitSphere_; - CLHEP::RandGeneral* randSpectrum_; + std::unique_ptr randomUnitSphere_; + std::unique_ptr randSpectrum_; double endPointEnergy_; }; @@ -109,8 +109,8 @@ namespace mu2e { <<"LeadingLogGenerator::produce(): No process associated with chosen PDG id : "<(eng_); + randSpectrum_ = std::make_unique(eng_, spectrum_.getPDF(), spectrum_.getNbins()); } //================================================================ diff --git a/EventGenerator/src/Mu2eXGenerator_tool.cc b/EventGenerator/src/Mu2eXGenerator_tool.cc index 1df300d766..833017bd53 100644 --- a/EventGenerator/src/Mu2eXGenerator_tool.cc +++ b/EventGenerator/src/Mu2eXGenerator_tool.cc @@ -65,8 +65,8 @@ namespace mu2e { void generate(std::unique_ptr& out, const IO::StoppedParticleF& stop) override; void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string&) override { - _randomUnitSphere = new RandomUnitSphere(eng); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _randomUnitSphere = std::make_unique(eng); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } private: @@ -75,8 +75,8 @@ namespace mu2e { BinnedSpectrum _spectrum; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandGeneral* _randSpectrum; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randSpectrum; }; diff --git a/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc b/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc index 5ab4dd2db8..d0e534c8ac 100644 --- a/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc +++ b/EventGenerator/src/MuCap1809keVGammaGenerator_tool.cc @@ -1,4 +1,5 @@ #include "art/Utilities/ToolMacros.h" +#include "cetlib_except/exception.h" #include "CLHEP/Random/RandFlat.h" @@ -7,7 +8,6 @@ #include "Offline/DataProducts/inc/PDGCode.hh" #include "Offline/MCDataProducts/inc/GenId.hh" #include "Offline/Mu2eUtilities/inc/RandomUnitSphere.hh" -#include "Offline/Mu2eUtilities/inc/BinnedSpectrum.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" #include "Offline/GlobalConstantsService/inc/ParticleDataList.hh" #include "Offline/GlobalConstantsService/inc/PhysicsParams.hh" @@ -29,7 +29,9 @@ namespace mu2e { _czMax(conf().czMax()), _fireAll(conf().fireAll()), _pdgId(PDGCode::gamma), - _mass(GlobalConstantsHandle()->particle(_pdgId).mass()) + _mass(GlobalConstantsHandle()->particle(_pdgId).mass()), + _randomUnitSphere(nullptr), + _randFlat(nullptr) { if(_czMin < -1. || _czMax > 1. || _czMin > _czMax) throw cet::exception("BADCONFIG") << "Cos(theta_z) range unphysical: " << _czMin << " - " << _czMax; } @@ -40,8 +42,8 @@ namespace mu2e { void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { _energy = GlobalConstantsHandle()->get1809keVGammaEnergy(material); _intensity = GlobalConstantsHandle()->get1809keVGammaIntensity(material); - _randomUnitSphere = new RandomUnitSphere(eng, _czMin, _czMax); - _randFlat = new CLHEP::RandFlat(eng); + _randomUnitSphere = std::make_unique(eng, _czMin, _czMax); + _randFlat = std::make_unique(eng); } private: @@ -53,15 +55,14 @@ namespace mu2e { double _energy = 0.; double _intensity = 0.; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandFlat* _randFlat; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randFlat; }; std::vector MuCap1809keVGammaGenerator::generate() { std::vector res; - const bool fire = (_fireAll) ? true : _randFlat->fire() < _intensity; - if (fire) { + if (_fireAll || _randFlat->fire() < _intensity) { const double momentum = _energy * sqrt(1 - std::pow(_mass/_energy,2)); CLHEP::Hep3Vector p3 = _randomUnitSphere->fire(momentum); CLHEP::HepLorentzVector fourmom(p3, _energy); diff --git a/EventGenerator/src/MuCapDeuteronGenerator_tool.cc b/EventGenerator/src/MuCapDeuteronGenerator_tool.cc index dd637d4636..b48081e583 100644 --- a/EventGenerator/src/MuCapDeuteronGenerator_tool.cc +++ b/EventGenerator/src/MuCapDeuteronGenerator_tool.cc @@ -40,9 +40,9 @@ namespace mu2e { void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { _rate = GlobalConstantsHandle()->getCaptureDeuteronRate(material); - _randomUnitSphere = new RandomUnitSphere(eng); - _randomPoissonQ = new CLHEP::RandPoissonQ(eng, _rate); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _randomUnitSphere = std::make_unique(eng); + _randomPoissonQ = std::make_unique(eng, _rate); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } private: @@ -53,9 +53,9 @@ namespace mu2e { BinnedSpectrum _spectrum; SpectrumVar _spectrumVariable; - CLHEP::RandPoissonQ* _randomPoissonQ; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandGeneral* _randSpectrum; + std::unique_ptr _randomPoissonQ; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randSpectrum; }; diff --git a/EventGenerator/src/MuCapNeutronGenerator_tool.cc b/EventGenerator/src/MuCapNeutronGenerator_tool.cc index 8d30a81435..7ee90cff12 100644 --- a/EventGenerator/src/MuCapNeutronGenerator_tool.cc +++ b/EventGenerator/src/MuCapNeutronGenerator_tool.cc @@ -40,9 +40,9 @@ namespace mu2e { void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { _rate = GlobalConstantsHandle()->getCaptureNeutronRate(material); - _randomUnitSphere = new RandomUnitSphere(eng); - _randomPoissonQ = new CLHEP::RandPoissonQ(eng, _rate); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _randomUnitSphere = std::make_unique(eng); + _randomPoissonQ = std::make_unique(eng, _rate); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } private: @@ -53,9 +53,9 @@ namespace mu2e { BinnedSpectrum _spectrum; SpectrumVar _spectrumVariable; - CLHEP::RandPoissonQ* _randomPoissonQ; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandGeneral* _randSpectrum; + std::unique_ptr _randomPoissonQ; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randSpectrum; }; std::vector MuCapNeutronGenerator::generate() { diff --git a/EventGenerator/src/MuCapPhotonGenerator_tool.cc b/EventGenerator/src/MuCapPhotonGenerator_tool.cc index 0cbfd9bd3f..3897583668 100644 --- a/EventGenerator/src/MuCapPhotonGenerator_tool.cc +++ b/EventGenerator/src/MuCapPhotonGenerator_tool.cc @@ -34,9 +34,9 @@ namespace mu2e { void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { _rate = GlobalConstantsHandle()->getCapturePhotonRate(material); - _randomUnitSphere = new RandomUnitSphere(eng); - _randomPoissonQ = new CLHEP::RandPoissonQ(eng, _rate); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _randomUnitSphere = std::make_unique(eng); + _randomPoissonQ = std::make_unique(eng, _rate); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } private: @@ -44,10 +44,9 @@ namespace mu2e { BinnedSpectrum _spectrum; - - CLHEP::RandPoissonQ* _randomPoissonQ; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandGeneral* _randSpectrum; + std::unique_ptr _randomPoissonQ; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randSpectrum; }; diff --git a/EventGenerator/src/MuCapProtonGenerator_tool.cc b/EventGenerator/src/MuCapProtonGenerator_tool.cc index 3e80822135..b9d0b4f74a 100644 --- a/EventGenerator/src/MuCapProtonGenerator_tool.cc +++ b/EventGenerator/src/MuCapProtonGenerator_tool.cc @@ -40,9 +40,9 @@ namespace mu2e { void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { _rate = GlobalConstantsHandle()->getCaptureProtonRate(material); - _randomUnitSphere = new RandomUnitSphere(eng); - _randomPoissonQ = new CLHEP::RandPoissonQ(eng, _rate); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _randomUnitSphere = std::make_unique(eng); + _randomPoissonQ = std::make_unique(eng, _rate); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } private: @@ -53,9 +53,9 @@ namespace mu2e { BinnedSpectrum _spectrum; SpectrumVar _spectrumVariable; - CLHEP::RandPoissonQ* _randomPoissonQ; - RandomUnitSphere* _randomUnitSphere; - CLHEP::RandGeneral* _randSpectrum; + std::unique_ptr _randomPoissonQ; + std::unique_ptr _randomUnitSphere; + std::unique_ptr _randSpectrum; }; std::vector MuCapProtonGenerator::generate() { diff --git a/EventGenerator/src/RMCGenerator_tool.cc b/EventGenerator/src/RMCGenerator_tool.cc index 53c8f278fe..63e804f977 100644 --- a/EventGenerator/src/RMCGenerator_tool.cc +++ b/EventGenerator/src/RMCGenerator_tool.cc @@ -99,13 +99,13 @@ namespace mu2e { void generate(std::unique_ptr& out, const IO::StoppedParticleF& stop) override; void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string& material) override { - _randomUnitSphereExternal = new RandomUnitSphere(eng, _czmin, _czmax); - _randomUnitSphereInternal = new RandomUnitSphere(eng); - _randFlat = new CLHEP::RandFlat(eng); - _randSpectrum = new CLHEP::RandGeneral(eng, _spectrum.getPDF(), _spectrum.getNbins()); - _muonCaptureSpectrum = new MuonCaptureSpectrum(_randFlat, _randomUnitSphereInternal); + _randomUnitSphereExternal = std::make_unique(eng, _czmin, _czmax); + _randomUnitSphereInternal = std::make_unique(eng); + _randFlat = std::make_unique(eng); + _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); + _muonCaptureSpectrum = std::make_unique(_randFlat.get(), _randomUnitSphereInternal.get()); if(_useRate) { - _randomPoissonQ = new CLHEP::RandPoissonQ(eng, GlobalConstantsHandle()->getCaptureRMCRate(material)); + _randomPoissonQ = std::make_unique(eng, GlobalConstantsHandle()->getCaptureRMCRate(material)); _internalRate = GlobalConstantsHandle()->getCaptureRMCInternalRate(material); } } @@ -120,16 +120,16 @@ namespace mu2e { const double _czmin; //range of cos(theta_z) generated const double _czmax; BinnedSpectrum _spectrum; //RMC photon spectrum - MuonCaptureSpectrum* _muonCaptureSpectrum; // internal conversion spectrum + std::unique_ptr _muonCaptureSpectrum; // internal conversion spectrum double _internalRate; const bool _makeHistograms; - RandomUnitSphere* _randomUnitSphereExternal; - RandomUnitSphere* _randomUnitSphereInternal; - CLHEP::RandFlat* _randFlat; - CLHEP::RandGeneral* _randSpectrum; - CLHEP::RandPoissonQ* _randomPoissonQ; + std::unique_ptr _randomUnitSphereExternal; + std::unique_ptr _randomUnitSphereInternal; + std::unique_ptr _randFlat; + std::unique_ptr _randSpectrum; + std::unique_ptr _randomPoissonQ; TH1* _hmomentum; TH1* _hCosz; diff --git a/EventGenerator/src/StoppedMuonRMCGun_module.cc b/EventGenerator/src/StoppedMuonRMCGun_module.cc index d1e4a9b4ba..2f507a38f1 100644 --- a/EventGenerator/src/StoppedMuonRMCGun_module.cc +++ b/EventGenerator/src/StoppedMuonRMCGun_module.cc @@ -65,7 +65,7 @@ namespace mu2e { art::RandomNumberGenerator::base_engine_t& eng_; const double czmax_; const double czmin_; - CLHEP::RandGeneral* randSpectrum_; + std::unique_ptr randSpectrum_; RandomUnitSphere randUnitSphere_; RandomUnitSphere randUnitSphereExt_; //For photons, to limit cosz CLHEP::RandFlat randFlat_; @@ -147,7 +147,7 @@ namespace mu2e { // initialize binned spectrum - this needs to be done right parseSpectrumShape(psphys_); - randSpectrum_ = new CLHEP::RandGeneral(eng_, spectrum_.getPDF(), spectrum_.getNbins()); + randSpectrum_ = std::make_unique(eng_, spectrum_.getPDF(), spectrum_.getNbins()); if ( doHistograms_ ) { art::ServiceHandle tfs; @@ -168,7 +168,6 @@ namespace mu2e { //================================================================ StoppedMuonRMCGun::~StoppedMuonRMCGun() { - delete randSpectrum_; } //================================================================ From c42c9448c6e877b528be582e7064605b36f32543 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Fri, 6 Feb 2026 11:38:44 -0600 Subject: [PATCH 126/174] Fix fragment count check, some minor edits --- DAQ/src/OccupancyFilter_module.cc | 54 +++++++++++++++---------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/DAQ/src/OccupancyFilter_module.cc b/DAQ/src/OccupancyFilter_module.cc index 565143b088..dbd08bac20 100644 --- a/DAQ/src/OccupancyFilter_module.cc +++ b/DAQ/src/OccupancyFilter_module.cc @@ -6,7 +6,6 @@ #include "art/Framework/Core/EDFilter.h" #include "art/Framework/Principal/Event.h" #include "art/Framework/Principal/Handle.h" -#include "art/Framework/Services/Registry/ServiceHandle.h" #include "fhiclcpp/types/Atom.h" #include "fhiclcpp/types/OptionalTable.h" @@ -23,8 +22,6 @@ #include "Offline/RecoDataProducts/inc/CaloDigi.hh" // C++ -#include -#include #include #include @@ -44,17 +41,22 @@ namespace mu2e { fhicl::Atom maxSize{Name("maxSize"), Comment("Maximum collection size")}; }; + struct FragmentCutConfig { // no tag needed here + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Atom maxSize{Name("maxSize"), Comment("Maximum collection size")}; + }; + // Main configuration struct Config { using Name = fhicl::Name; using Comment = fhicl::Comment; - fhicl::OptionalTable comboHits {Name("comboHits") , Comment("Tracker combo hits selection")}; - fhicl::OptionalTable strawHits {Name("strawHits") , Comment("Tracker straw hits selection")}; - fhicl::OptionalTable strawDigis{Name("strawDigis"), Comment("Tracker straw digis selection")}; - fhicl::OptionalTable caloHits {Name("caloHits") , Comment("Calorimeter hits selection")}; - fhicl::OptionalTable caloDigis {Name("caloDigis") , Comment("Calorimeter digis selection")}; - fhicl::OptionalTable fragments {Name("fragments") , Comment("Fragments selection")}; - fhicl::Atom diagLevel {Name("diagLevel") , Comment("Diagnostic printout level"), 0}; + fhicl::OptionalTable comboHits {Name("comboHits") , Comment("Tracker combo hits selection")}; + fhicl::OptionalTable strawHits {Name("strawHits") , Comment("Tracker straw hits selection")}; + fhicl::OptionalTable strawDigis{Name("strawDigis"), Comment("Tracker straw digis selection")}; + fhicl::OptionalTable caloHits {Name("caloHits") , Comment("Calorimeter hits selection")}; + fhicl::OptionalTable caloDigis {Name("caloDigis") , Comment("Calorimeter digis selection")}; + fhicl::OptionalTable fragments {Name("fragments") , Comment("Fragments selection")}; }; using Parameters = art::EDFilter::Table; @@ -77,19 +79,18 @@ namespace mu2e { bool _filterCaloHits; bool _filterCaloDigis; bool _filterFragments; - int _diagLevel; - int _maxComboHits; + int _maxComboHits = -1; std::string _tagComboHits; - int _maxStrawHits; + int _maxStrawHits = -1; std::string _tagStrawHits; - int _maxStrawDigis; + int _maxStrawDigis = -1; std::string _tagStrawDigis; - int _maxCaloHits; + int _maxCaloHits = -1; std::string _tagCaloHits; - int _maxCaloDigis; + int _maxCaloDigis = -1; std::string _tagCaloDigis; - int _maxFragments; + int _maxFragments = -1; // Data int _nevt, _npass; @@ -105,7 +106,6 @@ namespace mu2e { , _filterCaloHits (conf().caloHits ()) , _filterCaloDigis (conf().caloDigis ()) , _filterFragments (conf().fragments ()) - , _diagLevel(conf().diagLevel()) , _nevt(0) , _npass(0) { @@ -135,7 +135,7 @@ namespace mu2e { } TLOG(TLVL_DEBUG + 1) << ":" - << " filter combo hits = " << _filterComboHits << " max = " << _maxComboHits + << " filter combo hits = " << _filterComboHits << " max = " << _maxComboHits << " filter straw hits = " << _filterStrawHits << " max = " << _maxStrawHits << " filter straw digis = " << _filterStrawDigis << " max = " << _maxStrawDigis << " filter calo hits = " << _filterCaloHits << " max = " << _maxCaloHits @@ -157,7 +157,7 @@ namespace mu2e { // Check the collection const T* collection = handle.product(); const size_t nobj = collection->size(); - const bool passed = nobj < max_size; + const bool passed = nobj <= max_size; TLOG(TLVL_DEBUG + 3) << ": handle " << typeid(T).name() << " with tag " << tag << " has size " << nobj << " and result " << passed; if(!passed) TLOG(TLVL_DEBUG + 4) << ": handle " << typeid(T).name() << " with tag " << tag @@ -168,7 +168,6 @@ namespace mu2e { //----------------------------------------------------------------------------- // Check if the fragment collection passes the selection bool OccupancyFilter::check_fragments(const art::Event& event, const size_t max_size) { - if(max_size == 0) return false; // impossible to pass // Get all fragment handles std::vector> fragmentHandles = event.getMany>(); @@ -188,18 +187,16 @@ namespace mu2e { break; } - for (size_t ii = 0; ii < contf.block_count(); ++ii) { - nfragments += contf[ii]->size(); - if(nfragments >= max_size) { - TLOG(TLVL_DEBUG + 10) << ": Reached maximum fragments at " << nfragments; - return false; // stop processing if we ever fail - } + nfragments += contf.block_count(); + if(nfragments > max_size) { + TLOG(TLVL_DEBUG + 10) << ": Reached maximum fragments at " << nfragments; + return false; // stop processing if we ever fail } } } else { // directly a list of fragments if (handle->front().type() == mu2e::FragmentType::DTCEVT) { nfragments += handle->size(); - if(nfragments >= max_size) { + if(nfragments > max_size) { TLOG(TLVL_DEBUG + 10) << ": Reached maximum fragments at " << nfragments; return false; // stop processing if we ever fail } @@ -242,6 +239,7 @@ namespace mu2e { // Print a summary of the filter results const float rate = (_nevt > 0) ? float(_npass)/float(_nevt) : 0.f; TLOG(TLVL_DEBUG + 2) << "passed " << _npass << " events out of " << _nevt << " for a ratio of " << rate; + _nevt = 0; _npass = 0; // reset for the next run return true; } } From abe1ff6f57226f7bc90433fe94d1a9fe7930da70 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Fri, 6 Feb 2026 12:05:19 -0600 Subject: [PATCH 127/174] Only create calibration vector up to nChannel (and skip the spare database rows) --- CaloConditions/src/CalCalibMaker.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CaloConditions/src/CalCalibMaker.cc b/CaloConditions/src/CalCalibMaker.cc index 415b5489a7..fdc2c920a1 100644 --- a/CaloConditions/src/CalCalibMaker.cc +++ b/CaloConditions/src/CalCalibMaker.cc @@ -41,14 +41,15 @@ namespace mu2e { cout << "CalCalibMaker::fromDb making CalCalib\n"; } - size_t nChan = CaloConst::_nChannelDB; + size_t nChan = CaloConst::_nChannel; + size_t nChanDB = CaloConst::_nChannelDB; if (_config.verbose()) { - cout << "CalCalibMaker::fromDb checking for " << nChan << " channels\n"; + cout << "CalCalibMaker::fromDb checking for " << nChanDB << " channels\n"; } - // require the db tables are the same length as geometry - if (ecalib.nrow() != nChan || tcalib.nrow() != nChan) { + // check the db tables length (TODO remove?) + if (ecalib.nrow() != nChanDB || tcalib.nrow() != nChanDB) { throw cet::exception("CALCALIBMAKE_BAD_N_CHANNEL") << "CalCalibMaker::fromDb bad channel counts: " << " geometry: " << nChan @@ -59,6 +60,7 @@ namespace mu2e { CalCalib::CalibVec cvec; + //Loop up to _nChannel (skip the spare DB channels) for (CaloConst::CaloSiPMId_type ind=0; ind Date: Mon, 9 Feb 2026 14:25:04 -0600 Subject: [PATCH 128/174] changing mtp to msd and updating producer to reflect decoder changes --- DAQ/CMakeLists.txt | 4 +- DAQ/src/MTPHitsFromDTCEvents_module.cc | 166 ------------------------- RecoDataProducts/inc/MTPHit.hh | 34 ----- RecoDataProducts/src/classes.h | 4 +- RecoDataProducts/src/classes_def.xml | 6 +- 5 files changed, 8 insertions(+), 206 deletions(-) delete mode 100644 DAQ/src/MTPHitsFromDTCEvents_module.cc delete mode 100644 RecoDataProducts/inc/MTPHit.hh diff --git a/DAQ/CMakeLists.txt b/DAQ/CMakeLists.txt index af44480fa3..4a27ec701c 100644 --- a/DAQ/CMakeLists.txt +++ b/DAQ/CMakeLists.txt @@ -188,8 +188,8 @@ cet_build_plugin(CrvGRdataFromArtdaqFragments art::module artdaq-core-mu2e::Overlays ) -cet_build_plugin(MTPHitsFromDTCEvents art::module - REG_SOURCE src/MTPHitsFromDTCEvents_module.cc +cet_build_plugin(MSDHitsFromDTCEvents art::module + REG_SOURCE src/MSDHitsFromDTCEvents_module.cc LIBRARIES REG Offline::DAQ Offline::RecoDataProducts diff --git a/DAQ/src/MTPHitsFromDTCEvents_module.cc b/DAQ/src/MTPHitsFromDTCEvents_module.cc deleted file mode 100644 index a59363f190..0000000000 --- a/DAQ/src/MTPHitsFromDTCEvents_module.cc +++ /dev/null @@ -1,166 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// MTPHitsFromDTCEvents : add MTPHitCollection to the event -// M. Stortini -/////////////////////////////////////////////////////////////////////////////// - -#include "art/Framework/Core/EDProducer.h" -#include "art/Framework/Principal/Event.h" -#include "fhiclcpp/ParameterSet.h" -#include "fhiclcpp/types/Table.h" - -#include "art/Framework/Principal/Handle.h" -#include "artdaq-core-mu2e/Overlays/Decoders/MTPDataDecoder.hh" -#include "artdaq-core-mu2e/Overlays/DTCEventFragment.hh" -#include "artdaq-core-mu2e/Overlays/FragmentType.hh" - -#include "Offline/RecoDataProducts/inc/MTPHit.hh" - -#include -#include - -#include -#include -#include -#include - -namespace art { - class MTPHitsFromDTCEvents; -} -// ====================================================================== - -class art::MTPHitsFromDTCEvents : public EDProducer { - -public: - - struct Config { - fhicl::Atom debugLevel {fhicl::Name("debugLevel" ), fhicl::Comment("debug level" )}; - fhicl::Atom clockFrequency {fhicl::Name("clockFrequency"), fhicl::Comment("clock frequency in MHz")}; - }; - - explicit MTPHitsFromDTCEvents(const art::EDProducer::Table& config); - virtual ~MTPHitsFromDTCEvents() {} - - // --- overloaded functions of the art producer - virtual void produce (art::Event& ArtEvent) override; - virtual void beginRun(art::Run& ArtRun ) override; - - //----------------------------------------------------------------------------- - // helper functions - //----------------------------------------------------------------------------- - artdaq::Fragments getFragments(art::Event& event); - -private: - - //----------------------------------------------------------------------------- - // fcl parameters - //----------------------------------------------------------------------------- - int _debugLevel; - float _clockFrequency; - -}; - -// ====================================================================== -art::MTPHitsFromDTCEvents::MTPHitsFromDTCEvents(const art::EDProducer::Table& config) : - art::EDProducer{config}, - _debugLevel (config().debugLevel ()), - _clockFrequency(config().clockFrequency()) -{ - produces(); -} - - -//----------------------------------------------------------------------------- -void art::MTPHitsFromDTCEvents::beginRun(art::Run& ArtRun) {} - -// ---------------------------------------------------------------------------- -// event entry point -//----------------------------------------------------------------------------- -void art::MTPHitsFromDTCEvents::produce(Event& event) { - - // Collection of MTPHits for the event - std::unique_ptr mtp_hits(new mu2e::MTPHitCollection); - - // get fragments then loop over them - artdaq::Fragments fragments = getFragments(event); - for (const auto& frag : fragments) { - // from fragment get DTCEventFragment - mu2e::DTCEventFragment eventFragment(frag); - // from DTCEventFragment get the vector of DTC_SubEvents for the given subsystem (MTP) - auto dtcSubEvents = eventFragment.getSubsystemData(DTCLib::DTC_Subsystem::DTC_Subsystem_MTP); - // loop over the DTC_SubEvents - for (auto& dtcSubEvent : dtcSubEvents) { - // get the decoder - mu2e::MTPDataDecoder decoder(dtcSubEvent); - // now loop over the blockIndex's - for (size_t blockIndex = 0; blockIndex < decoder.block_count(); blockIndex++) { - mu2e::MTPDataDecoder::mtp_data_t dataPacketsVec = decoder.GetMTPDataPackets(blockIndex); - // loop over dataPacketsVec and grab products of interest - for (size_t vecIndex = 0; vecIndex < dataPacketsVec.size(); vecIndex++) { - // grap MTPDataPacket and initialize MTPHit, grabbing timeStamp0 and timeStamp1 - const mu2e::MTPDataDecoder::MTPDataPacket* packet = dataPacketsVec.at(vecIndex); - // grab the two time stamp counters, convert them to ns, and save them - unsigned int channelID = 0; // not in payload yet, will be in future - uint16_t counter0 = packet->GetTimestamp(0); - double time0 = counter0*1000.0/_clockFrequency; - mu2e::MTPHit mtpHit0(time0, channelID); - mtp_hits->emplace_back(mtpHit0); - uint16_t counter1 = packet->GetTimestamp(1); - double time1 = counter1*1000.0/_clockFrequency; - mu2e::MTPHit mtpHit1(time1, channelID); - mtp_hits->emplace_back(mtpHit1); - if (_debugLevel == 1) { std::cout << "time0, time1 = " << time0 << ", " << time1 << std::endl; } - } - } - } - } - -//----------------------------------------------------------------------------- -// Store the mtp hits -//----------------------------------------------------------------------------- - event.put(std::move(mtp_hits)); - -} - -// ---------------------------------------------------------------------------- -// get art fragments from event -//----------------------------------------------------------------------------- -artdaq::Fragments art::MTPHitsFromDTCEvents::getFragments(art::Event& event) { - - artdaq::Fragments fragments; - artdaq::FragmentPtrs containerFragments; - - std::vector> fragmentHandles; - fragmentHandles = event.getMany>(); - for (const auto& handle : fragmentHandles) { - if (!handle.isValid() || handle->empty()) { - continue; - } - - if (handle->front().type() == artdaq::Fragment::ContainerFragmentType) { - for (const auto& cont : *handle) { - artdaq::ContainerFragment contf(cont); - if (contf.fragment_type() != mu2e::FragmentType::DTCEVT) { - break; - } - - for (size_t ii = 0; ii < contf.block_count(); ++ii) { - containerFragments.push_back(contf[ii]); - fragments.push_back(*containerFragments.back()); - } - } - } else { - if (handle->front().type() == mu2e::FragmentType::DTCEVT) { - for (auto frag : *handle) { - fragments.emplace_back(frag); - } - } - } - } - return fragments; -} - -// ====================================================================== - -DEFINE_ART_MODULE(art::MTPHitsFromDTCEvents) - -// ====================================================================== diff --git a/RecoDataProducts/inc/MTPHit.hh b/RecoDataProducts/inc/MTPHit.hh deleted file mode 100644 index b6ad55399f..0000000000 --- a/RecoDataProducts/inc/MTPHit.hh +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef RecoDataProducts_MTPHit_hh -#define RecoDataProducts_MTPHit_hh - -#include - -namespace mu2e -{ - - class MTPHit - { - - public: - - // constructors - MTPHit() : _time(0), _channelID(0) {}; - MTPHit(double Time, unsigned int ChannelID) : _time(Time), _channelID(ChannelID) {}; - - // accessors - double const& time() const { return _time; } - unsigned int const& channelID() const { return _channelID; } - - private: - - // data members - double _time; // time of hit - unsigned int _channelID; // paddle - - }; - - typedef std::vector MTPHitCollection; - -} // namespace mu2e - -#endif /* RecoDataProducts_MTPHit_hh */ diff --git a/RecoDataProducts/src/classes.h b/RecoDataProducts/src/classes.h index b95d8f6cd4..d27524d284 100644 --- a/RecoDataProducts/src/classes.h +++ b/RecoDataProducts/src/classes.h @@ -98,7 +98,7 @@ #include "Offline/RecoDataProducts/inc/STMMWDDigi.hh" #include "Offline/RecoDataProducts/inc/STMHit.hh" -// MTP -#include "Offline/RecoDataProducts/inc/MTPHit.hh" +// MSD +#include "Offline/RecoDataProducts/inc/MSDHit.hh" #undef ENABLE_MU2E_GENREFLEX_HACKS diff --git a/RecoDataProducts/src/classes_def.xml b/RecoDataProducts/src/classes_def.xml index 7e239ba0be..fcb68257a5 100644 --- a/RecoDataProducts/src/classes_def.xml +++ b/RecoDataProducts/src/classes_def.xml @@ -452,7 +452,9 @@ - - + + + + From fb1772c4bb82cadd299fab6afef9f6d7da30a653 Mon Sep 17 00:00:00 2001 From: MATTHEW STORTINI Date: Mon, 9 Feb 2026 14:28:39 -0600 Subject: [PATCH 129/174] producer and reco product for MSD hits --- DAQ/src/MSDHitsFromDTCEvents_module.cc | 202 +++++++++++++++++++++++++ RecoDataProducts/inc/MSDHit.hh | 36 +++++ 2 files changed, 238 insertions(+) create mode 100644 DAQ/src/MSDHitsFromDTCEvents_module.cc create mode 100644 RecoDataProducts/inc/MSDHit.hh diff --git a/DAQ/src/MSDHitsFromDTCEvents_module.cc b/DAQ/src/MSDHitsFromDTCEvents_module.cc new file mode 100644 index 0000000000..dd7d40f807 --- /dev/null +++ b/DAQ/src/MSDHitsFromDTCEvents_module.cc @@ -0,0 +1,202 @@ +/////////////////////////////////////////////////////////////////////////////// +// MSDHitsFromDTCEvents : add MSDHitCollection to the event +// M. Stortini +/////////////////////////////////////////////////////////////////////////////// + +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Principal/Event.h" +#include "fhiclcpp/ParameterSet.h" +#include "fhiclcpp/types/Table.h" + +#include "art/Framework/Principal/Handle.h" +#include "artdaq-core-mu2e/Overlays/DTCEventFragment.hh" +#include "artdaq-core-mu2e/Overlays/Decoders/MobileSyncDataDecoder.hh" +#include "artdaq-core-mu2e/Overlays/FragmentType.hh" + +#include "Offline/RecoDataProducts/inc/MSDHit.hh" + +#include +#include + +#include +#include +#include +#include + +namespace art { +class MSDHitsFromDTCEvents; +} +// ====================================================================== + +class art::MSDHitsFromDTCEvents : public EDProducer { + +public: + struct Config { + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Atom debugLevel{Name("debugLevel"), Comment("debug level")}; + }; + + explicit MSDHitsFromDTCEvents(const art::EDProducer::Table& config); + virtual ~MSDHitsFromDTCEvents() {} + + // --- overloaded functions of the art producer + virtual void produce(art::Event& ArtEvent) override; + virtual void beginRun(art::Run& ArtRun) override; + + //----------------------------------------------------------------------------- + // helper functions + //----------------------------------------------------------------------------- + artdaq::Fragments getFragments(art::Event& event); + +private: + //----------------------------------------------------------------------------- + // fcl parameters + //----------------------------------------------------------------------------- + int _debugLevel; +}; + +// ====================================================================== +art::MSDHitsFromDTCEvents::MSDHitsFromDTCEvents(const art::EDProducer::Table& config) : + art::EDProducer{config}, _debugLevel(config().debugLevel()) { + produces(); +} + +//----------------------------------------------------------------------------- +void art::MSDHitsFromDTCEvents::beginRun(art::Run& ArtRun) {} + +// ---------------------------------------------------------------------------- +// event entry point +//----------------------------------------------------------------------------- +void art::MSDHitsFromDTCEvents::produce(Event& event) { + + // Collection of MSDHits for the event + std::unique_ptr msd_hits(new mu2e::MSDHitCollection); + + // get fragments then loop over them + artdaq::Fragments fragments = getFragments(event); + size_t index = 0; + for (const auto& frag : fragments) { + // from fragment get DTCEventFragment + mu2e::DTCEventFragment eventFragment(frag); + // from DTCEventFragment get the vector of DTC_SubEvents for the given subsystem (MSD) + auto dtcSubEvents = + eventFragment.getSubsystemData(DTCLib::DTC_Subsystem::DTC_Subsystem_MobileSync); + if (_debugLevel > 2) { + std::cout << " Fragment " << index << " has " << dtcSubEvents.size() + << " MSD DTC subevents, total sub events = " + << eventFragment.getData().GetSubEvents().size() << std::endl; + ++index; + } + // loop over the DTC_SubEvents + size_t index_subevt = 0; + for (auto& dtcSubEvent : dtcSubEvents) { + // get the decoder + mu2e::MobileSyncDataDecoder decoder(dtcSubEvent); + // now loop over the blockIndex's + if (_debugLevel > 3) { + std::cout << " Sub event " << index_subevt << " has " << decoder.block_count() + << " blocks\n"; + ++index_subevt; + } + for (size_t blockIndex = 0; blockIndex < decoder.block_count(); blockIndex++) { + mu2e::MobileSyncDataDecoder::sync_data_t dataPacketsVec = + decoder.GetMobileSyncPackets(blockIndex); + // get number of hits in packet + const unsigned nHitsInPacket = decoder.GetNHitsPerPacket(); + std::cout << "firmware version has " << nHitsInPacket << " hits per packet" << std::endl; + if (_debugLevel > 4) { + std::cout << " block " << blockIndex << " has " << dataPacketsVec.size() + << " packets\n"; + } + // loop over dataPacketsVec and grab products of interest + for (const auto& packet : dataPacketsVec) { + // loop over hits in packet and fill msd_hits + for (unsigned hit = 0; hit < nHitsInPacket; hit++) { + double hitTime = 0; + double hitTOT = 0; + mu2e::MSDHit msdHit; + if (decoder.GetHitTime(&packet, hit, hitTime)) { + msdHit.setTime(hitTime); + } + if (decoder.GetHitTOT(&packet, hit, hitTOT)) { + msdHit.setTOT(hitTOT); + } + if (msdHit.hasTime() || msdHit.hasTOT()) { + msd_hits->emplace_back(msdHit); + if (_debugLevel > 0) { + std::cout << "Hit " << hit << " in packet: time = " << msdHit.time() + << " ns, TOT = " << msdHit.tot() << " ns" << std::endl; + } + } else if (_debugLevel > 1) { + std::cout << "Hit " << hit << " in packet is invalid: time = " << hitTime + << " ns, TOT = " << hitTOT << " ns" << std::endl; + } + } + } + } + } + } + + //----------------------------------------------------------------------------- + // Store the msd hits + //----------------------------------------------------------------------------- + if (_debugLevel > 1) { + std::cout << "[MSDHitsFromDTCEvents::" << __func__ << "] Event " << event.id() << " has " + << msd_hits->size() << " MSD hits\n"; + } + event.put(std::move(msd_hits)); +} + +// ---------------------------------------------------------------------------- +// get art fragments from event +//----------------------------------------------------------------------------- +artdaq::Fragments art::MSDHitsFromDTCEvents::getFragments(art::Event& event) { + + artdaq::Fragments fragments; + artdaq::FragmentPtrs containerFragments; + + std::vector> fragmentHandles; + fragmentHandles = event.getMany>(); + if (_debugLevel > 1) { + std::cout << "[MSDHitsFromDTCEvents::" << __func__ << "] Event " << event.id() << " has " + << fragmentHandles.size() << " fragment handles\n"; + } + for (const auto& handle : fragmentHandles) { + if (!handle.isValid() || handle->empty()) { + continue; + } + + if (handle->front().type() == artdaq::Fragment::ContainerFragmentType) { + for (const auto& cont : *handle) { + artdaq::ContainerFragment contf(cont); + if (contf.fragment_type() != mu2e::FragmentType::DTCEVT) { + break; + } + + for (size_t ii = 0; ii < contf.block_count(); ++ii) { + containerFragments.push_back(contf[ii]); + fragments.push_back(*containerFragments.back()); + } + } + } else { + if (handle->front().type() == mu2e::FragmentType::DTCEVT) { + for (auto frag : *handle) { + fragments.emplace_back(frag); + } + } + } + } + if (_debugLevel > 2) { + std::cout << "[MSDHitsFromDTCEvents::" << __func__ << "] Found " << fragments.size() + << " fragments\n"; + } + return fragments; +} + +// ====================================================================== + +DEFINE_ART_MODULE(art::MSDHitsFromDTCEvents) + +// ====================================================================== + diff --git a/RecoDataProducts/inc/MSDHit.hh b/RecoDataProducts/inc/MSDHit.hh new file mode 100644 index 0000000000..ba4d8707fd --- /dev/null +++ b/RecoDataProducts/inc/MSDHit.hh @@ -0,0 +1,36 @@ +#ifndef RecoDataProducts_MSDHit_hh +#define RecoDataProducts_MSDHit_hh + +#include + +namespace mu2e { + +class MSDHit { +public: + // constructors + MSDHit() = default; + + // setters + void setTime(double time) { _time = time; } + void setTOT(double tot) { _tot = tot; } + + // accessors + double time() const { return _time; } + double tot() const { return _tot; } + + // check if field is present in payload + bool hasTime() const { return _time >= 0; } + bool hasTOT() const { return _tot >= 0; } + +private: + // data members + double _time{-1.0}; // time of hit + double _tot{-1.0}; // time-over-threshold +}; + +typedef std::vector MSDHitCollection; + +} // namespace mu2e + +#endif /* RecoDataProducts_MSDHit_hh */ + From 53852f391965242fdf8c20f329b5606aa713bf65 Mon Sep 17 00:00:00 2001 From: MATTHEW STORTINI Date: Mon, 9 Feb 2026 14:37:33 -0600 Subject: [PATCH 130/174] removing print statement --- DAQ/src/MSDHitsFromDTCEvents_module.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/DAQ/src/MSDHitsFromDTCEvents_module.cc b/DAQ/src/MSDHitsFromDTCEvents_module.cc index dd7d40f807..261ef30136 100644 --- a/DAQ/src/MSDHitsFromDTCEvents_module.cc +++ b/DAQ/src/MSDHitsFromDTCEvents_module.cc @@ -104,7 +104,6 @@ void art::MSDHitsFromDTCEvents::produce(Event& event) { decoder.GetMobileSyncPackets(blockIndex); // get number of hits in packet const unsigned nHitsInPacket = decoder.GetNHitsPerPacket(); - std::cout << "firmware version has " << nHitsInPacket << " hits per packet" << std::endl; if (_debugLevel > 4) { std::cout << " block " << blockIndex << " has " << dataPacketsVec.size() << " packets\n"; From def696ca74bc63e7cb469c738e3490debc1c62e0 Mon Sep 17 00:00:00 2001 From: MATTHEW STORTINI Date: Tue, 10 Feb 2026 11:55:27 -0600 Subject: [PATCH 131/174] GetHitTime is the ultimate check if hit is valid or not --- DAQ/src/MSDHitsFromDTCEvents_module.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/DAQ/src/MSDHitsFromDTCEvents_module.cc b/DAQ/src/MSDHitsFromDTCEvents_module.cc index 261ef30136..1e887a0895 100644 --- a/DAQ/src/MSDHitsFromDTCEvents_module.cc +++ b/DAQ/src/MSDHitsFromDTCEvents_module.cc @@ -117,19 +117,14 @@ void art::MSDHitsFromDTCEvents::produce(Event& event) { mu2e::MSDHit msdHit; if (decoder.GetHitTime(&packet, hit, hitTime)) { msdHit.setTime(hitTime); - } - if (decoder.GetHitTOT(&packet, hit, hitTOT)) { - msdHit.setTOT(hitTOT); - } - if (msdHit.hasTime() || msdHit.hasTOT()) { + if (decoder.GetHitTOT(&packet, hit, hitTOT)) { + msdHit.setTOT(hitTOT); + } msd_hits->emplace_back(msdHit); if (_debugLevel > 0) { std::cout << "Hit " << hit << " in packet: time = " << msdHit.time() << " ns, TOT = " << msdHit.tot() << " ns" << std::endl; } - } else if (_debugLevel > 1) { - std::cout << "Hit " << hit << " in packet is invalid: time = " << hitTime - << " ns, TOT = " << hitTOT << " ns" << std::endl; } } } From 667fcbe15aa331d9856d7766fed13e233e62beee Mon Sep 17 00:00:00 2001 From: echenard Date: Tue, 10 Feb 2026 23:22:56 -0600 Subject: [PATCH 132/174] Remove Calorimeter conditions txt file --- Analyses/src/CaloHitFinderInspect_module.cc | 1 - CaloMC/fcl/prolog.fcl | 31 +++++++--- CaloMC/inc/CaloNoiseSimGenerator.hh | 22 ++++--- CaloMC/inc/CaloPhotonPropagation.hh | 4 +- CaloMC/src/CaloDigiMaker_module.cc | 34 ++++++----- CaloMC/src/CaloHitTruthMatch_module.cc | 19 +++--- CaloMC/src/CaloNoiseSimGenerator.cc | 8 +-- CaloMC/src/CaloPhotonPropagation.cc | 20 +++---- CaloMC/src/CaloShowerROMaker_module.cc | 51 ++++++++-------- CaloReco/fcl/common.fcl | 8 ++- CaloReco/fcl/prolog.fcl | 4 ++ CaloReco/inc/CaloTemplateWFProcessor.hh | 24 ++++---- CaloReco/inc/CaloTemplateWFUtil.hh | 3 +- CaloReco/src/CaloHitMakerFast_module.cc | 9 ++- CaloReco/src/CaloTemplateWFProcessor.cc | 3 +- CaloReco/src/CaloTemplateWFUtil.cc | 5 +- .../inc/CalorimeterCalibrations.hh | 58 ------------------- .../src/CalorimeterCalibrations.cc | 46 --------------- ConditionsService/src/ConditionsService.cc | 6 -- Mu2eUtilities/inc/CaloPulseShape.hh | 5 +- Mu2eUtilities/src/CaloPulseShape.cc | 28 +++++---- 21 files changed, 165 insertions(+), 224 deletions(-) delete mode 100755 ConditionsService/inc/CalorimeterCalibrations.hh delete mode 100644 ConditionsService/src/CalorimeterCalibrations.cc diff --git a/Analyses/src/CaloHitFinderInspect_module.cc b/Analyses/src/CaloHitFinderInspect_module.cc index ce4dac1069..b3a8dfb604 100644 --- a/Analyses/src/CaloHitFinderInspect_module.cc +++ b/Analyses/src/CaloHitFinderInspect_module.cc @@ -17,7 +17,6 @@ #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" diff --git a/CaloMC/fcl/prolog.fcl b/CaloMC/fcl/prolog.fcl index 24c99ebde3..bbb1bc3bcc 100644 --- a/CaloMC/fcl/prolog.fcl +++ b/CaloMC/fcl/prolog.fcl @@ -13,12 +13,16 @@ CaloMC : { NoiseGenerator : { noiseWFSize : 10000 + pulseFileName : @local::pulseFileName + pulseHistName : @local::pulseHistName elecNphotPerNs : 0.18 rinNphotPerNs : 0.36 darkNphotPerNs : 0.60 digiSampling : @local::HitMakerDigiSampling nMaxFragment : 1000 minPeakADC : @local::HitMakerMinPeakADC + readoutPEPerMeV : @local::readoutPEPerMeV + ADCToMeV : @local::ADCToMeV diagLevel : 0 } } @@ -43,11 +47,15 @@ CaloMC : { @table::CaloMC { module_type : CaloShowerROMaker caloShowerStepCollection : ["CaloShowerStepMaker"] + propagationFileName : "OfflineData/ConditionsService/CsI-propag-2020-07-29.root" + propagationHistName : "h_zposTime" eventWindowMarker : EWMProducer protonBunchTimeMC : EWMProducer digitizationStart : @local::HitMakerDigitizationStart digitizationEnd : @local::HitMakerDigitizationEnd digitizationBuffer : 10 + crystalNonUniformity : 1.05 + readoutPEPerMeV : @local::readoutPEPerMeV LRUCorrection : true BirksCorrection : true PEStatCorrection : true @@ -61,6 +69,8 @@ CaloMC : { @table::CaloMC caloShowerROCollection : CaloShowerROMaker eventWindowMarker : EWMProducer protonBunchTimeMC : EWMProducer + pulseFileName : @local::pulseFileName + pulseHistName : @local::pulseHistName digitizationStart : @local::HitMakerDigitizationStart digitizationEnd : @local::HitMakerDigitizationEnd addNoise : true @@ -71,19 +81,24 @@ CaloMC : { @table::CaloMC minPeakADC : @local::HitMakerMinPeakADC nBinsPeak : 2 bufferDigi : 16 + readoutPEPerMeV : @local::readoutPEPerMeV + ADCToMeV : @local::ADCToMeV diagLevel : 0 } CaloHitTruthMatch: { - module_type : CaloHitTruthMatch - caloShowerSimCollection : CaloShowerROMaker - caloHitCollection : CaloHitMaker - primaryParticle : FindMCPrimary - digiSampling : @local::HitMakerDigiSampling - minAmplitude : 32 - fillDetailedMC : false - diagLevel : 0 + module_type : CaloHitTruthMatch + caloShowerSimCollection : CaloShowerROMaker + caloHitCollection : CaloHitMaker + primaryParticle : FindMCPrimary + pulseFileName : @local::pulseFileName + pulseHistName : @local::pulseHistName + digiSampling : @local::HitMakerDigiSampling + minAmplitude : 32 + ADCToMeV : @local::ADCToMeV + fillDetailedMC : false + diagLevel : 0 } CaloClusterTruthMatch: diff --git a/CaloMC/inc/CaloNoiseSimGenerator.hh b/CaloMC/inc/CaloNoiseSimGenerator.hh index 8e1f72980c..eddce1df64 100644 --- a/CaloMC/inc/CaloNoiseSimGenerator.hh +++ b/CaloMC/inc/CaloNoiseSimGenerator.hh @@ -25,14 +25,18 @@ namespace mu2e { { using Name = fhicl::Name; using Comment = fhicl::Comment; - fhicl::Atom elecNphotPerNs { Name("elecNphotPerNs"), Comment("Electronics noise number of PE / ns ") }; - fhicl::Atom rinNphotPerNs { Name("rinNphotPerNs"), Comment("RIN noise number of PE / ns ") }; - fhicl::Atom darkNphotPerNs { Name("darkNphotPerNs"), Comment("SiPM Dark noise number of PE / ns ") }; - fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; - fhicl::Atom noiseWFSize { Name("noiseWFSize"), Comment("Noise WF size") }; - fhicl::Atom nMaxFragment { Name("nMaxFragment"), Comment("maximum number of wf generated for extracting noise fragments ") }; - fhicl::Atom minPeakADC { Name("minPeakADC"), Comment("Minimum ADC hits of local peak to digitize") }; - fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diag Level"),0 }; + fhicl::Atom pulseFileName { Name("pulseFileName"), Comment("Calo pulse file name") }; + fhicl::Atom pulseHistName { Name("pulseHistName"), Comment("Calo pulse hist name") }; + fhicl::Atom elecNphotPerNs { Name("elecNphotPerNs"), Comment("Electronics noise number of PE / ns ") }; + fhicl::Atom rinNphotPerNs { Name("rinNphotPerNs"), Comment("RIN noise number of PE / ns ") }; + fhicl::Atom darkNphotPerNs { Name("darkNphotPerNs"), Comment("SiPM Dark noise number of PE / ns ") }; + fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; + fhicl::Atom pePerMeV { Name("readoutPEPerMeV"),Comment("Number of pe / MeV for Readout") }; + fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; + fhicl::Atom noiseWFSize { Name("noiseWFSize"), Comment("Noise WF size") }; + fhicl::Atom nMaxFragment { Name("nMaxFragment"), Comment("maximum number of wf generated for extracting noise fragments ") }; + fhicl::Atom minPeakADC { Name("minPeakADC"), Comment("Minimum ADC hits of local peak to digitize") }; + fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diag Level"),0 }; }; @@ -64,6 +68,8 @@ namespace mu2e { double noiseRinDark_; double noiseElec_; double minPeakADC_; + double pePerMeV_; + double MeVToADC_; CLHEP::RandPoissonQ randPoisson_; CLHEP::RandGaussQ randGauss_; CLHEP::RandFlat randFlat_; diff --git a/CaloMC/inc/CaloPhotonPropagation.hh b/CaloMC/inc/CaloPhotonPropagation.hh index 36ad82109b..8bd4c55077 100644 --- a/CaloMC/inc/CaloPhotonPropagation.hh +++ b/CaloMC/inc/CaloPhotonPropagation.hh @@ -13,7 +13,7 @@ namespace mu2e { class CaloPhotonPropagation { public: - CaloPhotonPropagation(CLHEP::HepRandomEngine& engine); + CaloPhotonPropagation(const std::string& fileName, const std::string& histName, CLHEP::HepRandomEngine& engine); void buildTable (); float propTimeSimu(float z); @@ -26,6 +26,8 @@ namespace mu2e { unsigned nZDiv_; float dzTime_; CLHEP::RandFlat randFlat_; + std::string fileName_; + std::string histName_; float lightSpeed_; }; diff --git a/CaloMC/src/CaloDigiMaker_module.cc b/CaloMC/src/CaloDigiMaker_module.cc index 5e9705b687..8850141b4f 100644 --- a/CaloMC/src/CaloDigiMaker_module.cc +++ b/CaloMC/src/CaloDigiMaker_module.cc @@ -19,7 +19,6 @@ #include "Offline/CaloMC/inc/CaloWFExtractor.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/DAQConditions/inc/EventTiming.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" @@ -60,11 +59,15 @@ namespace mu2e { fhicl::Atom caloShowerCollection { Name("caloShowerROCollection"), Comment("CaloShowerRO collection name") }; fhicl::Atom ewMarkerTag { Name("eventWindowMarker"), Comment("EventWindowMarker producer") }; fhicl::Atom pbtmcTag { Name("protonBunchTimeMC"), Comment("ProtonBunchTimeMC producer") }; + fhicl::Atom pulseFileName { Name("pulseFileName"), Comment("Calo pulse file name") }; + fhicl::Atom pulseHistName { Name("pulseHistName"), Comment("Calo pulse hist name") }; fhicl::Atom digitizationStart { Name("digitizationStart"), Comment("Start of digitization window relative to nominal pb time") }; fhicl::Atom digitizationEnd { Name("digitizationEnd"), Comment("End of digitization window relative to nominal pb time")}; fhicl::Atom addNoise { Name("addNoise"), Comment("Add noise to waveform") }; fhicl::Atom addRandomNoise { Name("addRandomNoise"), Comment("Add random salt and pepper noise") }; fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; + fhicl::Atom pePerMeV { Name("readoutPEPerMeV"), Comment("Number of pe / MeV for Readout") }; + fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; fhicl::Atom nBits { Name("nBits"), Comment("ADC Number of bits") }; fhicl::Atom nBinsPeak { Name("nBinsPeak"), Comment("Window size for finding local maximum to digitize wf") }; fhicl::Atom minPeakADC { Name("minPeakADC"), Comment("Minimum ADC hits of local peak to digitize") }; @@ -82,8 +85,9 @@ namespace mu2e { digiSampling_ (config().digiSampling()), bufferDigi_ (config().bufferDigi()), startTimeBuffer_ (config().digiSampling()*config().bufferDigi()), - maxADCCounts_ ((1 << config().nBits()) - 1), - pulseShape_ (CaloPulseShape(config().digiSampling())), + pePerMeV_ (config().pePerMeV()), + MeVToADC_ (1.0/config().ADCToMeV()), + pulseShape_ (CaloPulseShape(config().pulseFileName(),config().pulseHistName(),config().digiSampling())), wfExtractor_ (config().bufferDigi(),config().nBinsPeak(),config().minPeakADC(),config().bufferDigi()), engine_ (createEngine(art::ServiceHandle()->getSeed())), addNoise_ (config().addNoise()), @@ -107,9 +111,8 @@ namespace mu2e { private: void makeDigitization (const CaloShowerROCollection&, CaloDigiCollection&, const EventWindowMarker&, const ProtonBunchTimeMC&); - bool fillROHits (unsigned iRO, std::vector& waveform, const CaloShowerROCollection&, - const ConditionsHandle&, const ProtonBunchTimeMC&); - void generateSpotNoise (std::vector& waveform, unsigned iRO, const ConditionsHandle&); + bool fillROHits (unsigned iRO, std::vector& waveform, const CaloShowerROCollection&, const ProtonBunchTimeMC&); + void generateSpotNoise (std::vector& waveform); void buildOutputDigi (unsigned iRO, std::vector& waveform, int pedestal, CaloDigiCollection&); void diag0 (unsigned, const std::vector&); void diag1 (unsigned, double, size_t, const std::vector&, int); @@ -126,6 +129,8 @@ namespace mu2e { unsigned bufferDigi_; double startTimeBuffer_; int maxADCCounts_; + double pePerMeV_; + double MeVToADC_; CaloPulseShape pulseShape_; CaloWFExtractor wfExtractor_; CLHEP::HepRandomEngine& engine_; @@ -184,8 +189,6 @@ namespace mu2e { mu2e::GeomHandle ch; calorimeter_ = ch.get(); - ConditionsHandle calorimeterCalibrations("ignored"); - if (calorimeter_->nCrystals()<1 || calorimeter_->caloInfo().getInt("nSiPMPerCrystal")<1) return; int waveformSize = (digitizationEnd_ - digitizationStart_ + startTimeBuffer_) / digiSampling_; if (ewMarker.spillType() != EventWindowMarker::SpillType::onspill) @@ -201,19 +204,19 @@ namespace mu2e { for (int iRO=0;iRO& waveform, const CaloShowerROCollection& CaloShowerROs, - const ConditionsHandle& calorimeterCalibrations, const ProtonBunchTimeMC& pbtmc) + const ProtonBunchTimeMC& pbtmc) { bool isEmpty(true); - float scaleFactor = calorimeterCalibrations->MeV2ADC(iRO)/calorimeterCalibrations->peMeV(iRO); + float scaleFactor(MeVToADC_/pePerMeV_); for (const auto& CaloShowerRO : CaloShowerROs) { @@ -250,10 +253,9 @@ namespace mu2e { //---------------------------------------------------------------------------------------------------------- - void CaloDigiMaker::generateSpotNoise(std::vector& waveform, unsigned iRO, - const ConditionsHandle& calorimeterCalibrations) + void CaloDigiMaker::generateSpotNoise(std::vector& waveform) { - double minAmplitude = 0.1*calorimeterCalibrations->MeV2ADC(iRO); + double minAmplitude = 0.1*MeVToADC_; size_t timeSample(0); std::vector hitStarts{}, hitStops{}; diff --git a/CaloMC/src/CaloHitTruthMatch_module.cc b/CaloMC/src/CaloHitTruthMatch_module.cc index 64107520c3..0178ed9023 100644 --- a/CaloMC/src/CaloHitTruthMatch_module.cc +++ b/CaloMC/src/CaloHitTruthMatch_module.cc @@ -8,7 +8,6 @@ #include "fhiclcpp/types/Atom.h" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/MCDataProducts/inc/CaloEDepMC.hh" #include "Offline/MCDataProducts/inc/CaloHitMC.hh" #include "Offline/MCDataProducts/inc/CaloShowerSim.hh" @@ -40,9 +39,12 @@ namespace mu2e { using Comment = fhicl::Comment; fhicl::Atom caloShowerSimCollection { Name("caloShowerSimCollection"), Comment("Name of caloShowerSim Collection") }; fhicl::Atom caloHitCollection { Name("caloHitCollection"), Comment("Name of CaloHit collection") }; - fhicl::Atom primaryParticle { Name("primaryParticle"), Comment("PrimaryParticle producer")}; + fhicl::Atom primaryParticle { Name("primaryParticle"), Comment("PrimaryParticle producer")}; + fhicl::Atom pulseFileName { Name("pulseFileName"), Comment("Calo pulse file name") }; + fhicl::Atom pulseHistName { Name("pulseHistName"), Comment("Calo pulse hist name") }; fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; fhicl::Atom minAmplitude { Name("minAmplitude"), Comment("Minimum amplitude of waveform to define hit length") }; + fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; fhicl::Atom fillDetailedMC { Name("fillDetailedMC"), Comment("Fill SimParticle - SimShower Assn map")}; fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diag Level"),0 }; }; @@ -53,8 +55,11 @@ namespace mu2e { caloShowerSimToken_ {consumes (config().caloShowerSimCollection())}, caloHitToken_ {consumes(config().caloHitCollection())}, ppToken_ {consumes(config().primaryParticle())}, + pulseFileName_ (config().pulseFileName()), + pulseHistName_ (config().pulseHistName()), digiSampling_ (config().digiSampling()), minAmplitude_ (config().minAmplitude()), + MeVToADC_ (1.0/config().ADCToMeV()), fillDetailedMC_ (config().fillDetailedMC()), diagLevel_ (config().diagLevel()) { @@ -79,9 +84,12 @@ namespace mu2e { const art::ProductToken caloShowerSimToken_; const art::ProductToken caloHitToken_; const art::ProductToken ppToken_; + std::string pulseFileName_; + std::string pulseHistName_; double deltaTimeMinus_; double digiSampling_; double minAmplitude_; + double MeVToADC_; bool fillDetailedMC_; std::vector wf_; size_t wfBinMax_; @@ -122,14 +130,11 @@ namespace mu2e { //----------------------------------------------------------------------------- void CaloHitTruthMatch::beginRun(art::Run& aRun) { - CaloPulseShape cps(digiSampling_); + CaloPulseShape cps(pulseFileName_,pulseHistName_,digiSampling_); cps.buildShapes(); - ConditionsHandle calorimeterCalibrations("ignored"); - double MeVToADC = calorimeterCalibrations->MeV2ADC(0); - wf_ = cps.digitizedPulse(0); - for (auto& v : wf_) v *= MeVToADC; + for (auto& v : wf_) v *= MeVToADC_; wfBinMax_ = std::distance(wf_.begin(),std::max_element(wf_.begin(),wf_.end())); } diff --git a/CaloMC/src/CaloNoiseSimGenerator.cc b/CaloMC/src/CaloNoiseSimGenerator.cc index 1c5bf16d5f..8bfe3d87a8 100644 --- a/CaloMC/src/CaloNoiseSimGenerator.cc +++ b/CaloMC/src/CaloNoiseSimGenerator.cc @@ -1,6 +1,5 @@ #include "Offline/CaloMC/inc/CaloNoiseSimGenerator.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "art_root_io/TFileService.h" #include "art_root_io/TFileDirectory.h" #include "art/Framework/Services/Optional/RandomNumberGenerator.h" @@ -32,11 +31,13 @@ namespace mu2e { noiseRinDark_ (config.rinNphotPerNs() + config.darkNphotPerNs()), noiseElec_ (config.elecNphotPerNs()), minPeakADC_ (config.minPeakADC()), + pePerMeV_ (config.pePerMeV()), + MeVToADC_ (1.0/config.ADCToMeV()), randPoisson_ (engine), randGauss_ (engine), randFlat_ (engine), nMaxFragment_ (config.nMaxFragment()), - pulseShape_ (digiSampling_), + pulseShape_ (config.pulseFileName(),config.pulseHistName(),digiSampling_), diagLevel_ (config.diagLevel()) {} @@ -52,8 +53,7 @@ namespace mu2e { //------------------------------------------------------------------------------------------------------------------ void CaloNoiseSimGenerator::generateWF(std::vector& wfVector) { - ConditionsHandle calorimeterCalibrations("ignored"); - double scaleFactor = calorimeterCalibrations->MeV2ADC(iRO_)/calorimeterCalibrations->peMeV(iRO_); + float scaleFactor(MeVToADC_/pePerMeV_); std::fill(wfVector.begin(),wfVector.end(),0); diff --git a/CaloMC/src/CaloPhotonPropagation.cc b/CaloMC/src/CaloPhotonPropagation.cc index 07df0b101f..ff97891379 100644 --- a/CaloMC/src/CaloPhotonPropagation.cc +++ b/CaloMC/src/CaloPhotonPropagation.cc @@ -1,6 +1,6 @@ #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/CaloMC/inc/CaloPhotonPropagation.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" +#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/SeedService/inc/SeedService.hh" @@ -14,29 +14,29 @@ namespace mu2e { - CaloPhotonPropagation::CaloPhotonPropagation(CLHEP::HepRandomEngine& engine) : + CaloPhotonPropagation::CaloPhotonPropagation(const std::string& fileName, const std::string& histName, CLHEP::HepRandomEngine& engine) : timeProp_ (), cdf_ (), nTimeDiv_ (0), nZDiv_ (0), dzTime_ (0), randFlat_ (engine), + fileName_(fileName), + histName_(histName), lightSpeed_(300) {} //---------------------------------------------------------------------------------------------------------------------- void CaloPhotonPropagation::buildTable() { - //prepare structure for scintillating photon time propagation generation - ConditionsHandle calorimeterCalibrations("ignored"); - std::string fileName = calorimeterCalibrations->propagFileName(); - std::string histName = calorimeterCalibrations->propagHistName(); + ConfigFileLookupPolicy resolveFullPath; + std::string fullFileName = resolveFullPath(fileName_); TH2F *hist(0); - TFile file(fileName.c_str()); - if (file.IsOpen()) hist = (TH2F*) file.Get(histName.c_str()); - if (!hist) throw cet::exception("CATEGORY")<<"CaloROStepMaker:: Hitsogram "<SetDirectory(0); file.Close(); diff --git a/CaloMC/src/CaloShowerROMaker_module.cc b/CaloMC/src/CaloShowerROMaker_module.cc index 271b8e3c7e..dbc805176c 100644 --- a/CaloMC/src/CaloShowerROMaker_module.cc +++ b/CaloMC/src/CaloShowerROMaker_module.cc @@ -15,7 +15,6 @@ #include "Offline/DataProducts/inc/CrystalId.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" #include "Offline/DAQConditions/inc/EventTiming.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" @@ -92,9 +91,13 @@ namespace mu2e { fhicl::Sequence caloShowerStepCollection { Name("caloShowerStepCollection"), Comment("Compressed shower inputs for calo crystals") }; fhicl::Atom ewMarkerTag { Name("eventWindowMarker"), Comment("EventWindowMarker producer") }; fhicl::Atom pbtmcTag { Name("protonBunchTimeMC"), Comment("ProtonBunchTimeMC producer") }; + fhicl::Atom propagationFileName { Name("propagationFileName"), Comment("Photon propagation file name")}; + fhicl::Atom propagationHistName { Name("propagationHistName"), Comment("Photon propagation hist name")}; fhicl::Atom digitizationStart { Name("digitizationStart"), Comment("Minimum time of hit to be digitized") }; fhicl::Atom digitizationEnd { Name("digitizationEnd"), Comment("Maximum time of hit to be digitized") }; fhicl::Atom digitizationBuffer { Name("digitizationBuffer"), Comment("Digi time buffer for photon propagation inside crystal") }; + fhicl::Atom crystalNonUniformity { Name("crystalNonUniformity"), Comment("LRU parameter 0") }; + fhicl::Atom pePerMeV { Name("readoutPEPerMeV"), Comment("Number of pe / MeV for Readout") }; fhicl::Atom LRUCorrection { Name("LRUCorrection"), Comment("Include LRU corrections") }; fhicl::Atom BirksCorrection { Name("BirksCorrection"), Comment("Include Birks corrections") }; fhicl::Atom PEStatCorrection { Name("PEStatCorrection"), Comment("Include PE Poisson fluctuations") }; @@ -104,19 +107,21 @@ namespace mu2e { explicit CaloShowerROMaker(const art::EDProducer::Table& config) : EDProducer{config}, - ewMarkerTag_ (config().ewMarkerTag()), - pbtmcTag_ (config().pbtmcTag()), - digitizationStart_ (config().digitizationStart()), - digitizationEnd_ (config().digitizationEnd()), - digitizationBuffer_ (config().digitizationEnd()), - LRUCorrection_ (config().LRUCorrection()), - BirksCorrection_ (config().BirksCorrection()), - PEStatCorrection_ (config().PEStatCorrection()), - addTravelTime_ (config().addTravelTime()), - diagLevel_ (config().diagLevel()), - engine_ (createEngine(art::ServiceHandle()->getSeed())), - randPoisson_ (engine_), - photonProp_ (engine_) + ewMarkerTag_ (config().ewMarkerTag()), + pbtmcTag_ (config().pbtmcTag()), + digitizationStart_ (config().digitizationStart()), + digitizationEnd_ (config().digitizationEnd()), + digitizationBuffer_ (config().digitizationEnd()), + crystalNonUniformity_(config().crystalNonUniformity()), + pePerMeV_ (config().pePerMeV()), + LRUCorrection_ (config().LRUCorrection()), + BirksCorrection_ (config().BirksCorrection()), + PEStatCorrection_ (config().PEStatCorrection()), + addTravelTime_ (config().addTravelTime()), + diagLevel_ (config().diagLevel()), + engine_ (createEngine(art::ServiceHandle()->getSeed())), + randPoisson_ (engine_), + photonProp_ (config().propagationFileName(),config().propagationHistName(),engine_) { for (auto const& tag : config().caloShowerStepCollection()) crystalShowerTokens_.push_back(consumes(tag)); @@ -137,7 +142,7 @@ namespace mu2e { void makeReadoutHits (const StepHandles&, CaloShowerROCollection&, CaloShowerSimCollection&, const EventWindowMarker&, const ProtonBunchTimeMC&, float timeFromProtonsToDRMarker); - float LRUCorrection (int crystalID, float normalizedPosZ, float edepInit, const ConditionsHandle&); + float LRUCorrection (int crystalID, float normalizedPosZ, float edepInit); void dumpCaloShowerSim (const CaloShowerSimCollection& caloShowerSims); std::vector> crystalShowerTokens_; @@ -146,6 +151,8 @@ namespace mu2e { float digitizationStart_; float digitizationEnd_; float digitizationBuffer_; + float crystalNonUniformity_; + float pePerMeV_; bool LRUCorrection_; bool BirksCorrection_; bool PEStatCorrection_; @@ -222,7 +229,6 @@ namespace mu2e { const ProtonBunchTimeMC& pbtmc, float timeFromProtonsToDRMarker) { GlobalConstantsHandle pdt; - ConditionsHandle calorimeterCalibrations("ignored"); float mbtime = GlobalConstantsHandle()->getNominalDRPeriod(); @@ -267,14 +273,13 @@ namespace mu2e { float edep_corr(step.energyDepG4()); if (BirksCorrection_) edep_corr = step.energyDepBirks(); - if (LRUCorrection_) edep_corr = LRUCorrection(crystalID, posZ/cryhalflength, edep_corr, calorimeterCalibrations); + if (LRUCorrection_) edep_corr = LRUCorrection(crystalID, posZ/cryhalflength, edep_corr); // Generate individual PEs and their arrival times for (int i=0; ipeMeV(SiPMID); - int NPE = randPoisson_.fire(edep_corr*peMeV); + int NPE = randPoisson_.fire(edep_corr*pePerMeV_); if (NPE==0) continue; std::vector PETime(NPE,hitTime); @@ -289,7 +294,7 @@ namespace mu2e { if (diagLevel_ > 1) for (const auto& time : PETime) hTime_->Fill(2.0*cryhalflength-posZ,time-hitTime); diagSum.totNPE += NPE; - diagSum.totEdepNPE += double(NPE)/peMeV/2.0; //average between the two RO + diagSum.totEdepNPE += double(NPE)/pePerMeV_/2.0; //average between the two RO } diagSum.totEdep += step.energyDepG4(); diagSum.totEdepCorr += edep_corr; @@ -359,11 +364,9 @@ namespace mu2e { //---------------------------------------------------------------------------------------------------------------------------------- // apply a correction of type Energy = ((1-s)*Z/HL+s)*energy where Z position along the crystal, HL is the crystal half-length // and s is the intercept at Z=0 (i.e. non-uniformity factor, e.g. 5% -> s = 1.05) - float CaloShowerROMaker::LRUCorrection(int crystalID, float normalizedPosZ, float edepInit, - const ConditionsHandle& calorimeterCalibrations) + float CaloShowerROMaker::LRUCorrection(int crystalID, float normalizedPosZ, float edepInit) { - float alpha = calorimeterCalibrations->LRUpar0(crystalID); - float factor = (1.0-alpha)*normalizedPosZ +alpha; + float factor = (1.0-crystalNonUniformity_)*normalizedPosZ + crystalNonUniformity_; float edep = edepInit*factor; if (diagLevel_ > 2) std::cout<<"[CaloShowerROMaker::LRUCorrection] before / after LRU -> edep_corr = " diff --git a/CaloReco/fcl/common.fcl b/CaloReco/fcl/common.fcl index 5ba5541c6b..c36630269a 100644 --- a/CaloReco/fcl/common.fcl +++ b/CaloReco/fcl/common.fcl @@ -1,7 +1,11 @@ BEGIN_PROLOG HitMakerDigitizationStart : 450. HitMakerDigitizationEnd : 1795 - HitMakerDigiSampling : 5 - HitMakerMinPeakADC : 16 + HitMakerDigiSampling : 5 + HitMakerMinPeakADC : 16 + pulseFileName : "OfflineData/ConditionsService/CsI-waveform-2020-02-12.root" + pulseHistName : "h_waveform" + readoutPEPerMeV : 30.0 + ADCToMeV : 0.0625 END_PROLOG diff --git a/CaloReco/fcl/prolog.fcl b/CaloReco/fcl/prolog.fcl index 7e893263d9..ac4e76237c 100644 --- a/CaloReco/fcl/prolog.fcl +++ b/CaloReco/fcl/prolog.fcl @@ -1,6 +1,8 @@ #------------------------------------------------------------------------------ # this file is included by fcl/standardProducers.fcl inside the PROLOG section #------------------------------------------------------------------------------ +#include "Offline/CaloReco/fcl/common.fcl" + BEGIN_PROLOG @@ -16,6 +18,8 @@ CaloReco : { TemplateProcessor : { + pulseFileName : @local::pulseFileName + pulseHistName : @local::pulseHistName windowPeak : 3 minPeakAmplitude : 24 numNoiseBins : 5 diff --git a/CaloReco/inc/CaloTemplateWFProcessor.hh b/CaloReco/inc/CaloTemplateWFProcessor.hh index cdc561585c..0f9abd1541 100644 --- a/CaloReco/inc/CaloTemplateWFProcessor.hh +++ b/CaloReco/inc/CaloTemplateWFProcessor.hh @@ -33,17 +33,19 @@ namespace mu2e { { using Name = fhicl::Name; using Comment = fhicl::Comment; - fhicl::Atom windowPeak { Name("windowPeak"), Comment("Number of bins around central value to inspect") }; - fhicl::Atom minPeakAmplitude { Name("minPeakAmplitude"), Comment("Minimum peak amplitude") }; - fhicl::Atom minDTPeaks { Name("minDTPeaks"), Comment("Minimum time difference between consecutive peaks") }; - fhicl::Atom numNoiseBins { Name("numNoiseBins"), Comment("Number of bins to estimate noise") }; - fhicl::Atom psdThreshold { Name("psdThreshold"), Comment("Pulse shape discrimination threshold for secondary peaks") }; - fhicl::Atom chiThreshold { Name("chiThreshold"), Comment("Min chi2 for refit strategy") }; - fhicl::Atom refitLeadingEdge { Name("refitLeadingEdge"), Comment("Refit the leading edge to extract peak time") }; - fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; - fhicl::Atom fitPrintLevel { Name("fitPrintLevel"), Comment("minuit fit print level") }; - fhicl::Atom fitStrategy { Name("fitStrategy"), Comment("Minuit fit strategy") }; - fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diagnosis level") }; + fhicl::Atom pulseFileName { Name("pulseFileName"), Comment("Calo pulse file name") }; + fhicl::Atom pulseHistName { Name("pulseHistName"), Comment("Calo pulse hist name") }; + fhicl::Atom windowPeak { Name("windowPeak"), Comment("Number of bins around central value to inspect") }; + fhicl::Atom minPeakAmplitude { Name("minPeakAmplitude"), Comment("Minimum peak amplitude") }; + fhicl::Atom minDTPeaks { Name("minDTPeaks"), Comment("Minimum time difference between consecutive peaks") }; + fhicl::Atom numNoiseBins { Name("numNoiseBins"), Comment("Number of bins to estimate noise") }; + fhicl::Atom psdThreshold { Name("psdThreshold"), Comment("Pulse shape discrimination threshold for secondary peaks") }; + fhicl::Atom chiThreshold { Name("chiThreshold"), Comment("Min chi2 for refit strategy") }; + fhicl::Atom refitLeadingEdge { Name("refitLeadingEdge"), Comment("Refit the leading edge to extract peak time") }; + fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; + fhicl::Atom fitPrintLevel { Name("fitPrintLevel"), Comment("minuit fit print level") }; + fhicl::Atom fitStrategy { Name("fitStrategy"), Comment("Minuit fit strategy") }; + fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diagnosis level") }; }; diff --git a/CaloReco/inc/CaloTemplateWFUtil.hh b/CaloReco/inc/CaloTemplateWFUtil.hh index 6a5895adff..01687c829f 100644 --- a/CaloReco/inc/CaloTemplateWFUtil.hh +++ b/CaloReco/inc/CaloTemplateWFUtil.hh @@ -11,7 +11,8 @@ namespace mu2e { class CaloTemplateWFUtil { public: - CaloTemplateWFUtil(double minPeakAmplitude, double digiSampling, double minDTPeaks, int printLevel=-1); + CaloTemplateWFUtil(const std::string& pulseFileName, const std::string& pulseHistName, + double minPeakAmplitude, double digiSampling, double minDTPeaks, int printLevel=-1); void initialize (); void setXYVector (const std::vector& xvec, const std::vector& yvec); diff --git a/CaloReco/src/CaloHitMakerFast_module.cc b/CaloReco/src/CaloHitMakerFast_module.cc index 4a67161562..aeab7d95e8 100644 --- a/CaloReco/src/CaloHitMakerFast_module.cc +++ b/CaloReco/src/CaloHitMakerFast_module.cc @@ -5,7 +5,6 @@ #include "fhiclcpp/types/Sequence.h" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/DataProducts/inc/CaloConst.hh" #include "Offline/DataProducts/inc/CaloSiPMId.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" @@ -50,6 +49,7 @@ namespace mu2e { fhicl::Atom nSigmaNoise { Name("nSigmaNoise"), Comment("Maxnumber of sigma Noise to combine digi") }; fhicl::Atom caphriEDepMax { Name("caphriEDepMax"), Comment("Maximum CAPHRI hit energy in MeV")}; fhicl::Atom caphriEDepMin { Name("caphriEDepMin"), Comment("Minimum CAPHRI hit energy in MeV")}; + fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diag Level"),0 }; }; @@ -64,6 +64,7 @@ namespace mu2e { nSigmaNoise_ (config().nSigmaNoise()), caphriEDepMax_ (config().caphriEDepMax()), caphriEDepMin_ (config().caphriEDepMin()), + ADCToMeV_ (config().ADCToMeV()), diagLevel_ (config().diagLevel()) { produces("calo"); @@ -89,6 +90,7 @@ namespace mu2e { double nSigmaNoise_; float caphriEDepMax_; float caphriEDepMin_; + double ADCToMeV_; int diagLevel_; }; @@ -123,9 +125,6 @@ namespace mu2e { //-------------------------------------------------------------------------------------------------------------- void CaloHitMakerFast::extractHits(const CaloDigiCollection& caloDigis, CaloHitCollection& caloHitsColl, CaloHitCollection& caphriHitsColl, IntensityInfoCalo& intInfo, double pbtOffset) { - - ConditionsHandle calorimeterCalibrations("ignored"); - pulseMapType pulseMap; for (const auto& caloDigi : caloDigis) { @@ -135,7 +134,7 @@ namespace mu2e { double baseline(0); for (size_t i=0; iADC2MeV(caloDigi.SiPMID());//FIXME! we should use the function ::Peak2MeV, I also think that we should: (i) discard the hit if eDep is <0 (noise/stange pulse), (ii) require a minimum pulse length. gianipez + double eDep = (caloDigi.waveform().at(caloDigi.peakpos())-baseline)*ADCToMeV_;//FIXME! we should use the function ::Peak2MeV, I also think that we should: (i) discard the hit if eDep is <0 (noise/stange pulse), (ii) require a minimum pulse length. gianipez double time = caloDigi.t0() + caloDigi.peakpos()*digiSampling_ - pbtOffset; //Giani's definition //double time = caloDigi.t0() + (caloDigi.peakpos()+0.5)*digiSampling_ - shiftTime_; //Bertrand's definition diff --git a/CaloReco/src/CaloTemplateWFProcessor.cc b/CaloReco/src/CaloTemplateWFProcessor.cc index 1b343ef0a2..fc23dd57a3 100644 --- a/CaloReco/src/CaloTemplateWFProcessor.cc +++ b/CaloReco/src/CaloTemplateWFProcessor.cc @@ -25,7 +25,8 @@ namespace mu2e { chiThreshold_ (config.chiThreshold()), refitLeadingEdge_(config.refitLeadingEdge()), diagLevel_ (config.diagLevel()), - fmutil_ (minPeakAmplitude_,config.digiSampling(),minDTPeaks_,config.fitPrintLevel()), + fmutil_ (config.pulseFileName(),config.pulseHistName(),minPeakAmplitude_, + config.digiSampling(),minDTPeaks_,config.fitPrintLevel()), chi2_ (999.), ndf_ (-1), resAmp_ (), diff --git a/CaloReco/src/CaloTemplateWFUtil.cc b/CaloReco/src/CaloTemplateWFUtil.cc index e5e9ec842a..183770fc56 100644 --- a/CaloReco/src/CaloTemplateWFUtil.cc +++ b/CaloReco/src/CaloTemplateWFUtil.cc @@ -57,8 +57,9 @@ namespace namespace mu2e { - CaloTemplateWFUtil::CaloTemplateWFUtil(double minPeakAmplitude, double digiSampling, double minDTPeaks, int printLevel) : - pulseCache_(CaloPulseShape(digiSampling)), + CaloTemplateWFUtil::CaloTemplateWFUtil(const std::string& pulseFileName, const std::string& pulseHistName, + double minPeakAmplitude, double digiSampling, double minDTPeaks, int printLevel) : + pulseCache_(CaloPulseShape(pulseFileName, pulseHistName, digiSampling)), minPeakAmplitude_(minPeakAmplitude), minDTPeaks_(minDTPeaks), fitStrategy_(1), diff --git a/ConditionsService/inc/CalorimeterCalibrations.hh b/ConditionsService/inc/CalorimeterCalibrations.hh deleted file mode 100755 index cf4e92f8a8..0000000000 --- a/ConditionsService/inc/CalorimeterCalibrations.hh +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef ConditionsService_CalorimeterCalibrations_hh -#define ConditionsService_CalorimeterCalibrations_hh - - -// C++ includes. -#include -#include - -// Mu2e includes. -#include "Offline/Mu2eInterfaces/inc/ConditionsEntity.hh" -#include "CLHEP/Vector/ThreeVector.h" - - -namespace mu2e -{ - - class SimpleConfig; - - - class CalorimeterCalibrations: public ConditionsEntity { - - public: - - explicit CalorimeterCalibrations ( SimpleConfig const& config ); - ~CalorimeterCalibrations(){}; - - const std::string& pulseFileName() const {return _pulseFileName;} - const std::string& pulseHistName() const {return _pulseHistName;} - const std::string& propagFileName() const {return _propagFileName;} - const std::string& propagHistName() const {return _propagHistName;} - - double BirkCorrHadron() const {return _BirkCorrHadron;} - double LRUpar0(int crystalId) const {return _LRUpar0;} - double peMeV(int crystalId) const {return _peMeV;} - double ROnoise(int roId) const {return _ROnoise;} - double ADC2MeV(int roId) const {return _ADC2MeV;} - double MeV2ADC(int roId) const {return 1.0/_ADC2MeV;} - double Peak2MeV(int roId) const {return _Peak2MeV;} - - private: - - std::string _pulseFileName; - std::string _pulseHistName; - std::string _propagFileName; - std::string _propagHistName; - - double _LRUpar0; - double _BirkCorrHadron; - double _peMeV; - double _ROnoise; - double _ADC2MeV; - double _Peak2MeV; - }; - - -} - -#endif /* ConditionsService_CalorimeterCalibrations_hh */ diff --git a/ConditionsService/src/CalorimeterCalibrations.cc b/ConditionsService/src/CalorimeterCalibrations.cc deleted file mode 100644 index a1ee522fee..0000000000 --- a/ConditionsService/src/CalorimeterCalibrations.cc +++ /dev/null @@ -1,46 +0,0 @@ -// -// Parameters for calorimeter calibrations. -// -// - -// Mu2e include files -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" -#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" -#include "Offline/ConfigTools/inc/SimpleConfig.hh" - -#include - - - -namespace mu2e { - - CalorimeterCalibrations::CalorimeterCalibrations( SimpleConfig const& config ) - { - ConfigFileLookupPolicy configFile; - - _pulseFileName = configFile(config.getString("calorimeter.pulseFileName")); - _pulseHistName = config.getString("calorimeter.pulseHistName"); - _propagFileName = configFile(config.getString("calorimeter.propagFileName")); - _propagHistName = config.getString("calorimeter.propagHistName"); - - // Here we should eventually interface to some database - _LRUpar0 = config.getDouble("CrystalNonUniformity_0"); - - // Here we should eventually interface to some database - _BirkCorrHadron = config.getDouble("BirkCorrHadron"); - - //RO photo-statistic number - _peMeV = config.getDouble("ROphotostatistic");//p.e. / MeV - - //value of the sigma used to do the Gaussian smearing due to the electronic noise - _ROnoise = config.getDouble("ReadOutElectronicNoise");//MeV - - //conversion factor between ADC counts and MeV for a specific RO - _ADC2MeV = config.getDouble("ADC2MeVConversionFactor"); - - //conversion factor between ADC counts and MeV for Fast clustering - _Peak2MeV = config.getDouble("Peak2MeVConversionFactor"); - - } -} - diff --git a/ConditionsService/src/ConditionsService.cc b/ConditionsService/src/ConditionsService.cc index 5dc26533bd..5b43cdb288 100644 --- a/ConditionsService/src/ConditionsService.cc +++ b/ConditionsService/src/ConditionsService.cc @@ -17,9 +17,6 @@ #include "Offline/ConditionsService/inc/ConditionsService.hh" #include "Offline/GeometryService/inc/GeometryService.hh" -// Calibration entities. -// Would like to break the coupling to these. -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" using namespace std; @@ -77,9 +74,6 @@ namespace mu2e { if ( _printConfig ){ _config.print(cout, "Conditions: "); } checkConsistency(); - - // Can we break the coupling to the entities? - addEntity( std::unique_ptr( new CalorimeterCalibrations(_config)) ); } // Check that the configuration is self consistent. diff --git a/Mu2eUtilities/inc/CaloPulseShape.hh b/Mu2eUtilities/inc/CaloPulseShape.hh index 5f600cc3eb..394a4a30e9 100644 --- a/Mu2eUtilities/inc/CaloPulseShape.hh +++ b/Mu2eUtilities/inc/CaloPulseShape.hh @@ -19,13 +19,14 @@ // linear piecewise approxmiation are problematic for the minimization #include +#include namespace mu2e { class CaloPulseShape { public: - CaloPulseShape(double digiSampling); + CaloPulseShape(const std::string& fileName, const std::string& histName, double digiSampling); ~CaloPulseShape() {}; void buildShapes(); @@ -36,6 +37,8 @@ namespace mu2e { void diag (bool fullDiag=false) const; private: + std::string fileName_; + std::string histName_; int nSteps_; double digiStep_; int nBinShape_; diff --git a/Mu2eUtilities/src/CaloPulseShape.cc b/Mu2eUtilities/src/CaloPulseShape.cc index 660ae8df2c..406a7e7d04 100644 --- a/Mu2eUtilities/src/CaloPulseShape.cc +++ b/Mu2eUtilities/src/CaloPulseShape.cc @@ -1,6 +1,6 @@ #include "Offline/Mu2eUtilities/inc/CaloPulseShape.hh" -#include "Offline/ConditionsService/inc/CalorimeterCalibrations.hh" #include "Offline/ConditionsService/inc/ConditionsHandle.hh" +#include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "TFile.h" #include "TH2F.h" @@ -11,9 +11,15 @@ namespace mu2e { - - CaloPulseShape::CaloPulseShape(double digiSampling) : - nSteps_(100), digiStep_(digiSampling/double(nSteps_)),nBinShape_(0), pulseVec_(), deltaT_(0.), digitizedPulse_() + CaloPulseShape::CaloPulseShape(const std::string& fileName, const std::string& histName, double digiSampling) : + fileName_(fileName), + histName_(histName), + nSteps_(100), + digiStep_(digiSampling/double(nSteps_)), + nBinShape_(0), + pulseVec_(), + deltaT_(0.), + digitizedPulse_() {} //---------------------------------------------------------------------------------------------------------------------- @@ -22,16 +28,14 @@ namespace mu2e { pulseVec_.clear(); - // Get the pulse shape histogram - ConditionsHandle calorimeterCalibrations("ignored"); - std::string fileName = calorimeterCalibrations->pulseFileName(); - std::string histName = calorimeterCalibrations->pulseHistName(); + ConfigFileLookupPolicy resolveFullPath; + std::string fullFileName = resolveFullPath(fileName_); std::unique_ptr pshape(nullptr); - TFile pulseFile(fileName.c_str()); - if (pulseFile.IsOpen()) pshape.reset((TH1F*) pulseFile.Get(histName.c_str())); - if (!pshape) throw cet::exception("CATEGORY")<<"CaloPulseShape:: Hitsogram "<SetDirectory(0); pulseFile.Close(); From 5ec3ee4e067caca2843a6162aecf5af7b2bd9033 Mon Sep 17 00:00:00 2001 From: echenard Date: Wed, 11 Feb 2026 14:23:12 -0600 Subject: [PATCH 133/174] Fixed bug in CaloDigiMaker --- CaloMC/inc/CaloNoiseSimGenerator.hh | 2 +- CaloMC/src/CaloDigiMaker_module.cc | 9 ++++++--- CaloMC/src/CaloNoiseSimGenerator.cc | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CaloMC/inc/CaloNoiseSimGenerator.hh b/CaloMC/inc/CaloNoiseSimGenerator.hh index eddce1df64..f9b08f1796 100644 --- a/CaloMC/inc/CaloNoiseSimGenerator.hh +++ b/CaloMC/inc/CaloNoiseSimGenerator.hh @@ -50,7 +50,7 @@ namespace mu2e { void plotNoise(const std::string& name); const std::vector& noise() const {return waveform_;} - int pedestal() const {return pedestal_;} + double pedestal() const {return pedestal_;} private: diff --git a/CaloMC/src/CaloDigiMaker_module.cc b/CaloMC/src/CaloDigiMaker_module.cc index 8850141b4f..b1a10f1978 100644 --- a/CaloMC/src/CaloDigiMaker_module.cc +++ b/CaloMC/src/CaloDigiMaker_module.cc @@ -85,6 +85,7 @@ namespace mu2e { digiSampling_ (config().digiSampling()), bufferDigi_ (config().bufferDigi()), startTimeBuffer_ (config().digiSampling()*config().bufferDigi()), + maxADCCounts_ ((1 << config().nBits()) -1), pePerMeV_ (config().pePerMeV()), MeVToADC_ (1.0/config().ADCToMeV()), pulseShape_ (CaloPulseShape(config().pulseFileName(),config().pulseHistName(),config().digiSampling())), @@ -113,7 +114,7 @@ namespace mu2e { void makeDigitization (const CaloShowerROCollection&, CaloDigiCollection&, const EventWindowMarker&, const ProtonBunchTimeMC&); bool fillROHits (unsigned iRO, std::vector& waveform, const CaloShowerROCollection&, const ProtonBunchTimeMC&); void generateSpotNoise (std::vector& waveform); - void buildOutputDigi (unsigned iRO, std::vector& waveform, int pedestal, CaloDigiCollection&); + void buildOutputDigi (unsigned iRO, std::vector& waveform, double pedestal, CaloDigiCollection&); void diag0 (unsigned, const std::vector&); void diag1 (unsigned, double, size_t, const std::vector&, int); void plotWF (const std::vector& waveform, const std::string& pname, int pedestal); @@ -296,11 +297,13 @@ namespace mu2e { //------------------------------------------------------------------------------------------------------------------- - void CaloDigiMaker::buildOutputDigi(unsigned iRO, std::vector& waveform, int pedestal, CaloDigiCollection& caloDigiColl) + void CaloDigiMaker::buildOutputDigi(unsigned iRO, std::vector& waveform, double pedestal, CaloDigiCollection& caloDigiColl) { // round the waveform into non-null integers and apply maxADC cut std::vector wf(waveform.size(),0); - for (unsigned i=0; i pedestal) wf[i] = std::min(maxADCCounts_, int(waveform[i] - pedestal));} + for (size_t i=0; i pedestal) wf[i] = std::min(maxADCCounts_, int(waveform[i] - pedestal)); + } if (diagLevel_ > 2) diag0(iRO, wf); //extract hits start / stop times diff --git a/CaloMC/src/CaloNoiseSimGenerator.cc b/CaloMC/src/CaloNoiseSimGenerator.cc index 8bfe3d87a8..dc8208528f 100644 --- a/CaloMC/src/CaloNoiseSimGenerator.cc +++ b/CaloMC/src/CaloNoiseSimGenerator.cc @@ -82,7 +82,7 @@ namespace mu2e { for (auto& val : wfVector) val += randGauss_.fire(0.0,noiseADC); //estimate pedestal for this waveform - set it to theoretical value for the time being - pedestal_ = int(noiseRinDark_*digiSampling_*std::accumulate(pulse.begin(),pulse.end(),0.0)*scaleFactor); + pedestal_ = std::floor(noiseRinDark_*digiSampling_*std::accumulate(pulse.begin(),pulse.end(),0.0)*scaleFactor); } //------------------------------------------------------------------------------------------------------------------ From 01e646a21e7be8f19d038e091394eb970729aba1 Mon Sep 17 00:00:00 2001 From: echenard Date: Wed, 11 Feb 2026 18:13:48 -0600 Subject: [PATCH 134/174] More cleanup and fixed CMake files --- CaloCluster/test/CaloClusterProduction.fcl | 5 ----- CaloCluster/test/ClusterTrajectory.fcl | 5 ----- CaloCluster/test/readCaloCluster.fcl | 5 ----- CaloCluster/test/readCaloClusterEff.fcl | 5 ----- CaloCluster/test/readCaloClusterEnergyResolMap.fcl | 5 ----- CaloCluster/test/readCogRecFunc.fcl | 5 ----- CaloCluster/test/readCrystalHit.fcl | 5 ----- CaloCluster/test/readOffSetCog.fcl | 5 ----- CaloMC/src/CaloDigiMaker_module.cc | 1 - CaloMC/src/CaloHitTruthMatch_module.cc | 1 - CaloMC/src/CaloNoiseSimGenerator.cc | 1 - CaloMC/src/CaloPhotonPropagation.cc | 1 - CaloMC/src/CaloShowerROMaker_module.cc | 1 - CaloMC/src/SConscript | 3 +-- CaloReco/src/CaloHitMakerFast_module.cc | 1 - CaloReco/src/SConscript | 3 +-- ConditionsService/CMakeLists.txt | 2 -- 17 files changed, 2 insertions(+), 52 deletions(-) diff --git a/CaloCluster/test/CaloClusterProduction.fcl b/CaloCluster/test/CaloClusterProduction.fcl index a01e5bd565..9c4d66cc82 100644 --- a/CaloCluster/test/CaloClusterProduction.fcl +++ b/CaloCluster/test/CaloClusterProduction.fcl @@ -35,11 +35,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CaloCluster/test/ClusterTrajectory.fcl b/CaloCluster/test/ClusterTrajectory.fcl index 7423155a9a..0218e3a50c 100644 --- a/CaloCluster/test/ClusterTrajectory.fcl +++ b/CaloCluster/test/ClusterTrajectory.fcl @@ -35,11 +35,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/CaloCluster/test/readCaloCluster.fcl b/CaloCluster/test/readCaloCluster.fcl index 881cb075d6..44bd693208 100644 --- a/CaloCluster/test/readCaloCluster.fcl +++ b/CaloCluster/test/readCaloCluster.fcl @@ -35,11 +35,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CaloCluster/test/readCaloClusterEff.fcl b/CaloCluster/test/readCaloClusterEff.fcl index c3fb14c4a4..f410c0fce7 100644 --- a/CaloCluster/test/readCaloClusterEff.fcl +++ b/CaloCluster/test/readCaloClusterEff.fcl @@ -34,11 +34,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CaloCluster/test/readCaloClusterEnergyResolMap.fcl b/CaloCluster/test/readCaloClusterEnergyResolMap.fcl index 12b551c8fd..58d68d51a5 100644 --- a/CaloCluster/test/readCaloClusterEnergyResolMap.fcl +++ b/CaloCluster/test/readCaloClusterEnergyResolMap.fcl @@ -35,11 +35,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CaloCluster/test/readCogRecFunc.fcl b/CaloCluster/test/readCogRecFunc.fcl index 7a883ac8e5..51e4946047 100644 --- a/CaloCluster/test/readCogRecFunc.fcl +++ b/CaloCluster/test/readCogRecFunc.fcl @@ -103,11 +103,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CaloCluster/test/readCrystalHit.fcl b/CaloCluster/test/readCrystalHit.fcl index 0318ac320c..99ba9945a7 100644 --- a/CaloCluster/test/readCrystalHit.fcl +++ b/CaloCluster/test/readCrystalHit.fcl @@ -34,11 +34,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/CaloCluster/test/readOffSetCog.fcl b/CaloCluster/test/readOffSetCog.fcl index a7340b1a7c..e4da47fdaa 100644 --- a/CaloCluster/test/readOffSetCog.fcl +++ b/CaloCluster/test/readOffSetCog.fcl @@ -35,11 +35,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CaloMC/src/CaloDigiMaker_module.cc b/CaloMC/src/CaloDigiMaker_module.cc index b1a10f1978..e609391e69 100644 --- a/CaloMC/src/CaloDigiMaker_module.cc +++ b/CaloMC/src/CaloDigiMaker_module.cc @@ -17,7 +17,6 @@ #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/CaloMC/inc/CaloNoiseSimGenerator.hh" #include "Offline/CaloMC/inc/CaloWFExtractor.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/DAQConditions/inc/EventTiming.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" diff --git a/CaloMC/src/CaloHitTruthMatch_module.cc b/CaloMC/src/CaloHitTruthMatch_module.cc index 0178ed9023..93a92e15a4 100644 --- a/CaloMC/src/CaloHitTruthMatch_module.cc +++ b/CaloMC/src/CaloHitTruthMatch_module.cc @@ -7,7 +7,6 @@ #include "art_root_io/TFileDirectory.h" #include "fhiclcpp/types/Atom.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/MCDataProducts/inc/CaloEDepMC.hh" #include "Offline/MCDataProducts/inc/CaloHitMC.hh" #include "Offline/MCDataProducts/inc/CaloShowerSim.hh" diff --git a/CaloMC/src/CaloNoiseSimGenerator.cc b/CaloMC/src/CaloNoiseSimGenerator.cc index dc8208528f..fb1a391d03 100644 --- a/CaloMC/src/CaloNoiseSimGenerator.cc +++ b/CaloMC/src/CaloNoiseSimGenerator.cc @@ -1,5 +1,4 @@ #include "Offline/CaloMC/inc/CaloNoiseSimGenerator.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "art_root_io/TFileService.h" #include "art_root_io/TFileDirectory.h" #include "art/Framework/Services/Optional/RandomNumberGenerator.h" diff --git a/CaloMC/src/CaloPhotonPropagation.cc b/CaloMC/src/CaloPhotonPropagation.cc index ff97891379..42ff6d82a0 100644 --- a/CaloMC/src/CaloPhotonPropagation.cc +++ b/CaloMC/src/CaloPhotonPropagation.cc @@ -1,7 +1,6 @@ #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/CaloMC/inc/CaloPhotonPropagation.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/SeedService/inc/SeedService.hh" diff --git a/CaloMC/src/CaloShowerROMaker_module.cc b/CaloMC/src/CaloShowerROMaker_module.cc index dbc805176c..9dfd7fd9ad 100644 --- a/CaloMC/src/CaloShowerROMaker_module.cc +++ b/CaloMC/src/CaloShowerROMaker_module.cc @@ -13,7 +13,6 @@ #include "Offline/CaloMC/inc/CaloPhotonPropagation.hh" #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/DataProducts/inc/CrystalId.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ProditionsService/inc/ProditionsHandle.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" #include "Offline/DAQConditions/inc/EventTiming.hh" diff --git a/CaloMC/src/SConscript b/CaloMC/src/SConscript index 4a464b1f87..b2361fbb90 100644 --- a/CaloMC/src/SConscript +++ b/CaloMC/src/SConscript @@ -18,8 +18,7 @@ helper=mu2e_helper(env); rootlibs = env['ROOTLIBS'] -mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', - 'mu2e_GeometryService', +mainlib = helper.make_mainlib ( ['mu2e_GeometryService', 'mu2e_Mu2eUtilities', 'mu2e_MCDataProducts', 'mu2e_CalorimeterGeom', diff --git a/CaloReco/src/CaloHitMakerFast_module.cc b/CaloReco/src/CaloHitMakerFast_module.cc index aeab7d95e8..7f4ff2e3f3 100644 --- a/CaloReco/src/CaloHitMakerFast_module.cc +++ b/CaloReco/src/CaloHitMakerFast_module.cc @@ -4,7 +4,6 @@ #include "art/Framework/Principal/Handle.h" #include "fhiclcpp/types/Sequence.h" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/DataProducts/inc/CaloConst.hh" #include "Offline/DataProducts/inc/CaloSiPMId.hh" #include "Offline/RecoDataProducts/inc/CaloDigi.hh" diff --git a/CaloReco/src/SConscript b/CaloReco/src/SConscript index a53ddd46b0..c969965cb7 100644 --- a/CaloReco/src/SConscript +++ b/CaloReco/src/SConscript @@ -13,8 +13,7 @@ helper=mu2e_helper(env); rootlibs = env['ROOTLIBS'] -mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService', - 'mu2e_GeometryService', +mainlib = helper.make_mainlib ( [ 'mu2e_GeometryService', 'mu2e_RecoDataProducts', 'mu2e_Mu2eUtilities', 'mu2e_CalorimeterGeom', diff --git a/ConditionsService/CMakeLists.txt b/ConditionsService/CMakeLists.txt index 37e05d7522..b144cd344c 100644 --- a/ConditionsService/CMakeLists.txt +++ b/ConditionsService/CMakeLists.txt @@ -1,7 +1,6 @@ cet_make_library( SOURCE src/ConditionsService.cc - src/CalorimeterCalibrations.cc LIBRARIES PUBLIC Offline::ConfigTools @@ -18,7 +17,6 @@ cet_build_plugin(ConditionsService art::service ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/conditions_01.txt ${CURRENT_BINARY_DIR} data/conditions_01.txt ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_dt_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_dt_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_ep_vs_path_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_ep_vs_path_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_xs_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_xs_v4_2_4.tab ) From 0551d3af47c7d438da3060416ed83fd4d62b0032 Mon Sep 17 00:00:00 2001 From: echenard Date: Wed, 11 Feb 2026 19:33:44 -0600 Subject: [PATCH 135/174] Added comment in CaloInfo about valid keys --- CalorimeterGeom/inc/CaloInfo.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CalorimeterGeom/inc/CaloInfo.hh b/CalorimeterGeom/inc/CaloInfo.hh index 3d5cba9afa..e4f95b5173 100644 --- a/CalorimeterGeom/inc/CaloInfo.hh +++ b/CalorimeterGeom/inc/CaloInfo.hh @@ -2,6 +2,8 @@ // Contains data for the calorimeter class. The non-critical fields are saved into maps, and a few performance critical fields // accessed throughout the code are cached for efficiency. // +// See wiki for list of valid keys +// // Original author B. Echenard // #ifndef CalorimeterGeom_CaloInfo_hh From 82d70f5e36de7c279ffbf103ab80ac500ea71bef Mon Sep 17 00:00:00 2001 From: echenard Date: Thu, 12 Feb 2026 00:01:57 -0600 Subject: [PATCH 136/174] More scrubbing with AI and small bug fix --- Analyses/fcl/simParticleAnalyzer.fcl | 1 - Analyses/test/ConversionEnergyLoss.fcl | 1 - Analyses/test/InteractiveRoot.fcl | 1 - Analyses/test/InteractiveRoot2.fcl | 1 - Analyses/test/PionMomentumAnalyzer.fcl | 1 - Analyses/test/SelectiveStepPtPrinter_g4s1.fcl | 1 - Analyses/test/TVirtDebug.fcl | 1 - Analyses/test/TestTO.fcl | 1 - Analyses/test/cosmicFilter.fcl | 1 - Analyses/test/extmon_uci_readback.fcl | 1 - Analyses/test/histforpabs.fcl | 1 - Analyses/test/hitDisplay.fcl | 1 - Analyses/test/isoRPCtest.fcl | 1 - Analyses/test/materailsPropStudy.fcl | 1 - Analyses/test/mixPointsDump.fcl | 1 - Analyses/test/pbars1hist.fcl | 1 - Analyses/test/printStrawHits.fcl | 1 - Analyses/test/printTrackerGeom.fcl | 1 - Analyses/test/psVacuum_readback.fcl | 1 - Analyses/test/readCaloDigi.fcl | 1 - Analyses/test/readMCTrajectories.fcl | 1 - Analyses/test/readStoppedPis.fcl | 1 - Analyses/test/readback0.fcl | 1 - Analyses/test/simParticleCheck00.fcl | 1 - Analyses/test/simParticlesWithHitsExample.fcl | 1 - Analyses/test/stoppingTarget00.fcl | 1 - Analyses/test/transportMuonStudy.fcl | 1 - .../test/transportMuonStudy_onlyTransport.fcl | 1 - Analyses/test/vd_readStage2.fcl | 1 - BFieldGeom/test/makeBinaryMaps.fcl | 1 - BFieldGeom/test/readBinaryMaps.fcl | 1 - BFieldTest/test/BFieldSymmetry.fcl | 1 - BFieldTest/test/BFieldTest.fcl | 1 - CRVResponse/test/CRVResponseDAQ.fcl | 1 - CRVResponse/test/CRVResponsePlot_v05.fcl | 1 - ...CRVResponse_RadiationBackgroundStudies.fcl | 1 - CRVResponse/test/CRVResponse_v05.fcl | 1 - CRVResponse/test/CRVResponse_v07.fcl | 1 - CalPatRec/test/calPatRec.fcl | 1 - CalPatRec/test/calPatRec_01.fcl | 1 - CalPatRec/test/calPatRec_02.fcl | 1 - CalPatRec/test/calPatRec_display.fcl | 1 - CalPatRec/test/calPatRec_display_cnv00502.fcl | 1 - CalPatRec/test/calPatRec_display_read.fcl | 1 - CalPatRec/test/deltaFinder_debug_ce.fcl | 1 - CalPatRec/test/mergePatRec.fcl | 1 - CalPatRec/test/mergePatRec_02.fcl | 1 - CalPatRec/test/mergePatRec_03.fcl | 1 - CalPatRec/test/mergePatRec_display.fcl | 1 - CalPatRec/test/mergePatRec_display_read.fcl | 1 - CalPatRec/test/printTrackerNumerology.fcl | 1 - CalPatRec/test/trkPatRec_01.fcl | 1 - CalPatRec/test/trkPatRec_02.fcl | 1 - CalPatRec/test/trkPatRec_display.fcl | 1 - CalPatRec/test/trkPatRec_display_read.fcl | 1 - CaloMC/fcl/prolog.fcl | 6 +-- CaloMC/inc/CaloNoiseSimGenerator.hh | 2 +- CaloMC/src/CaloDigiMaker_module.cc | 4 +- CaloMC/src/CaloHitTruthMatch_module.cc | 4 +- CaloMC/src/CaloNoiseSimGenerator.cc | 2 +- CaloMC/src/CaloShowerROMaker_module.cc | 2 +- CaloReco/fcl/common.fcl | 1 + CaloReco/fcl/prolog.fcl | 2 +- ConditionsService/data/conditions_01.txt | 38 ------------------- EventGenerator/test/FromStepPointMCs.fcl | 1 - EventGenerator/test/ceLeadingLog_test.fcl | 1 - EventGenerator/test/ceMEndpoint_test.fcl | 1 - EventGenerator/test/cePEndpoint_test.fcl | 1 - EventGenerator/test/cePLeadingLog_test.fcl | 1 - EventGenerator/test/corsikaTest.fcl | 1 - EventGenerator/test/cryTest.fcl | 1 - .../test/g4test_FromStepPointMCs.fcl | 1 - EventGenerator/test/rpc_int_test.fcl | 1 - EventMixing/test/inspectMixed.fcl | 1 - EventMixing/test/inspectUnMixed.fcl | 1 - EventMixing/test/mixProducer_01.fcl | 1 - ExtinctionMonitorFNAL/test/digiDefsCommon.fcl | 1 - ExtinctionMonitorFNAL/test/digiTuning.fcl | 1 - .../test/emfRecoTrackAnalysis.fcl | 1 - .../test/extMonFNALDefsCommon.fcl | 1 - .../test/g4detectorDefsCommon.fcl | 1 - .../test/g4s1_channelTest.fcl | 1 - ExtinctionMonitorFNAL/test/recoDefsCommon.fcl | 1 - ExtinctionMonitorFNAL/test/trajectoryIn.fcl | 1 - Mu2eG4/fcl/rantest.fcl | 1 - Mu2eG4/fcl/replayWithSkip.fcl | 1 - Mu2eUtilities/src/CaloPulseShape.cc | 3 +- ParticleID/test/test.fcl | 1 - fcl/standardServices.fcl | 1 - 89 files changed, 14 insertions(+), 129 deletions(-) delete mode 100644 ConditionsService/data/conditions_01.txt diff --git a/Analyses/fcl/simParticleAnalyzer.fcl b/Analyses/fcl/simParticleAnalyzer.fcl index 45aa56fdcf..6a8995a345 100644 --- a/Analyses/fcl/simParticleAnalyzer.fcl +++ b/Analyses/fcl/simParticleAnalyzer.fcl @@ -9,7 +9,6 @@ process_name : SimParticleAnalyzer services : { message : @local::default_message GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService :{ conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/ConversionEnergyLoss.fcl b/Analyses/test/ConversionEnergyLoss.fcl index 715ff55e73..89a88be41c 100644 --- a/Analyses/test/ConversionEnergyLoss.fcl +++ b/Analyses/test/ConversionEnergyLoss.fcl @@ -47,7 +47,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/InteractiveRoot.fcl b/Analyses/test/InteractiveRoot.fcl index f6ebaf5c72..23efc2e837 100644 --- a/Analyses/test/InteractiveRoot.fcl +++ b/Analyses/test/InteractiveRoot.fcl @@ -25,7 +25,6 @@ services : { TFileService : { fileName : "interactiveRoot.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/InteractiveRoot2.fcl b/Analyses/test/InteractiveRoot2.fcl index 414f515465..761c8965df 100644 --- a/Analyses/test/InteractiveRoot2.fcl +++ b/Analyses/test/InteractiveRoot2.fcl @@ -25,7 +25,6 @@ services : { TFileService : { fileName : "interactiveRoot.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/PionMomentumAnalyzer.fcl b/Analyses/test/PionMomentumAnalyzer.fcl index 279d3d99d0..ec84006dd3 100644 --- a/Analyses/test/PionMomentumAnalyzer.fcl +++ b/Analyses/test/PionMomentumAnalyzer.fcl @@ -8,7 +8,6 @@ source: { module_type: RootInput } services: { message: @local::default_message TFileService: { fileName: "nts.owner.pionMomentum.ver.seq.root" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService: { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } } diff --git a/Analyses/test/SelectiveStepPtPrinter_g4s1.fcl b/Analyses/test/SelectiveStepPtPrinter_g4s1.fcl index f73c0d18ba..52966a52ec 100644 --- a/Analyses/test/SelectiveStepPtPrinter_g4s1.fcl +++ b/Analyses/test/SelectiveStepPtPrinter_g4s1.fcl @@ -22,7 +22,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng"} GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common_current.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds Mu2eG4Helper : { } diff --git a/Analyses/test/TVirtDebug.fcl b/Analyses/test/TVirtDebug.fcl index ac46bc8442..bb9556fb3e 100644 --- a/Analyses/test/TVirtDebug.fcl +++ b/Analyses/test/TVirtDebug.fcl @@ -20,7 +20,6 @@ services : { TFileService : { fileName : "readback.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/TestTO.fcl b/Analyses/test/TestTO.fcl index f7777ca7a9..2561840547 100644 --- a/Analyses/test/TestTO.fcl +++ b/Analyses/test/TestTO.fcl @@ -35,7 +35,6 @@ services : ConditionsService : { - conditionsfile : "Offline/Mu2eG4/test/conditions_01_it.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/cosmicFilter.fcl b/Analyses/test/cosmicFilter.fcl index c52a9267ab..7febf55b07 100644 --- a/Analyses/test/cosmicFilter.fcl +++ b/Analyses/test/cosmicFilter.fcl @@ -34,7 +34,6 @@ services : { } ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/extmon_uci_readback.fcl b/Analyses/test/extmon_uci_readback.fcl index 1cd2d648b1..dc0c134f26 100644 --- a/Analyses/test/extmon_uci_readback.fcl +++ b/Analyses/test/extmon_uci_readback.fcl @@ -33,7 +33,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/histforpabs.fcl b/Analyses/test/histforpabs.fcl index e941fb9209..d140ec26df 100644 --- a/Analyses/test/histforpabs.fcl +++ b/Analyses/test/histforpabs.fcl @@ -40,7 +40,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/hitDisplay.fcl b/Analyses/test/hitDisplay.fcl index 3be76e66ea..0593617f9d 100644 --- a/Analyses/test/hitDisplay.fcl +++ b/Analyses/test/hitDisplay.fcl @@ -38,7 +38,6 @@ services : } ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/isoRPCtest.fcl b/Analyses/test/isoRPCtest.fcl index 1d2d44c605..57a9fd1ace 100644 --- a/Analyses/test/isoRPCtest.fcl +++ b/Analyses/test/isoRPCtest.fcl @@ -45,7 +45,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/materailsPropStudy.fcl b/Analyses/test/materailsPropStudy.fcl index de97f7cf2f..e10fec7449 100644 --- a/Analyses/test/materailsPropStudy.fcl +++ b/Analyses/test/materailsPropStudy.fcl @@ -25,7 +25,6 @@ services : GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/mixPointsDump.fcl b/Analyses/test/mixPointsDump.fcl index 8693242090..1d88cd26f1 100644 --- a/Analyses/test/mixPointsDump.fcl +++ b/Analyses/test/mixPointsDump.fcl @@ -11,7 +11,6 @@ services: { TFileService: { fileName: "stepPoints.root" } message: @local::default_message RandomNumberGenerator: {defaultEngineKind: "MixMaxRng" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService: { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService: @local::automaticSeeds } diff --git a/Analyses/test/pbars1hist.fcl b/Analyses/test/pbars1hist.fcl index 84558db67a..9936525bc6 100644 --- a/Analyses/test/pbars1hist.fcl +++ b/Analyses/test/pbars1hist.fcl @@ -8,7 +8,6 @@ source: { module_type: RootInput } services: { message: @local::default_message TFileService: { fileName: "pbars1hist.root" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService: { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } } diff --git a/Analyses/test/printStrawHits.fcl b/Analyses/test/printStrawHits.fcl index dc00f57c27..1092db7720 100644 --- a/Analyses/test/printStrawHits.fcl +++ b/Analyses/test/printStrawHits.fcl @@ -18,7 +18,6 @@ services : { message : @local::default_message GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/printTrackerGeom.fcl b/Analyses/test/printTrackerGeom.fcl index 851738c8c0..2019481d0e 100644 --- a/Analyses/test/printTrackerGeom.fcl +++ b/Analyses/test/printTrackerGeom.fcl @@ -19,7 +19,6 @@ services : { # GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } GeometryService : { inputFile : "gtest1.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/psVacuum_readback.fcl b/Analyses/test/psVacuum_readback.fcl index 004c2ee380..c595cefb65 100644 --- a/Analyses/test/psVacuum_readback.fcl +++ b/Analyses/test/psVacuum_readback.fcl @@ -35,7 +35,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/readCaloDigi.fcl b/Analyses/test/readCaloDigi.fcl index c1cf21b2cd..92239fe87f 100644 --- a/Analyses/test/readCaloDigi.fcl +++ b/Analyses/test/readCaloDigi.fcl @@ -22,7 +22,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/Analyses/test/readMCTrajectories.fcl b/Analyses/test/readMCTrajectories.fcl index e7019eedc7..c60aedd67c 100644 --- a/Analyses/test/readMCTrajectories.fcl +++ b/Analyses/test/readMCTrajectories.fcl @@ -22,7 +22,6 @@ services : TFileService : { fileName : "readMCTrajectories.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/readStoppedPis.fcl b/Analyses/test/readStoppedPis.fcl index 8cb493b83a..4da6713760 100644 --- a/Analyses/test/readStoppedPis.fcl +++ b/Analyses/test/readStoppedPis.fcl @@ -35,7 +35,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : {inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt"} diff --git a/Analyses/test/readback0.fcl b/Analyses/test/readback0.fcl index 91dfb9bdf6..b0c6ccfeaa 100644 --- a/Analyses/test/readback0.fcl +++ b/Analyses/test/readback0.fcl @@ -33,7 +33,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/simParticleCheck00.fcl b/Analyses/test/simParticleCheck00.fcl index 21839fc69e..d803ade965 100644 --- a/Analyses/test/simParticleCheck00.fcl +++ b/Analyses/test/simParticleCheck00.fcl @@ -50,7 +50,6 @@ services : { TFileService : { fileName : "simParticleCheck00.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/simParticlesWithHitsExample.fcl b/Analyses/test/simParticlesWithHitsExample.fcl index 0fa9548a15..8a89d811f4 100644 --- a/Analyses/test/simParticlesWithHitsExample.fcl +++ b/Analyses/test/simParticlesWithHitsExample.fcl @@ -25,7 +25,6 @@ services : GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/stoppingTarget00.fcl b/Analyses/test/stoppingTarget00.fcl index ccdf7bae61..e6529fa4db 100644 --- a/Analyses/test/stoppingTarget00.fcl +++ b/Analyses/test/stoppingTarget00.fcl @@ -34,7 +34,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/transportMuonStudy.fcl b/Analyses/test/transportMuonStudy.fcl index a117e2ecc0..5db9d19f6b 100644 --- a/Analyses/test/transportMuonStudy.fcl +++ b/Analyses/test/transportMuonStudy.fcl @@ -28,7 +28,6 @@ services : GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/transportMuonStudy_onlyTransport.fcl b/Analyses/test/transportMuonStudy_onlyTransport.fcl index 2b59ba8490..b3dc82aa5e 100644 --- a/Analyses/test/transportMuonStudy_onlyTransport.fcl +++ b/Analyses/test/transportMuonStudy_onlyTransport.fcl @@ -28,7 +28,6 @@ services : GeometryService : { inputFile : "Offline/Analyses/test/geom_transportOnly.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/vd_readStage2.fcl b/Analyses/test/vd_readStage2.fcl index c367e9529e..6ab1512a1b 100644 --- a/Analyses/test/vd_readStage2.fcl +++ b/Analyses/test/vd_readStage2.fcl @@ -26,7 +26,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/BFieldGeom/test/makeBinaryMaps.fcl b/BFieldGeom/test/makeBinaryMaps.fcl index 72d60944b5..6423d145d4 100644 --- a/BFieldGeom/test/makeBinaryMaps.fcl +++ b/BFieldGeom/test/makeBinaryMaps.fcl @@ -21,7 +21,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/BFieldGeom/test/geom_makeBinaries.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : {} SeedService : @local::automaticSeeds diff --git a/BFieldGeom/test/readBinaryMaps.fcl b/BFieldGeom/test/readBinaryMaps.fcl index dd8b5dda3b..1de47519cb 100644 --- a/BFieldGeom/test/readBinaryMaps.fcl +++ b/BFieldGeom/test/readBinaryMaps.fcl @@ -20,7 +20,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/BFieldGeom/test/geom_readBinaries.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : {} SeedService : @local::automaticSeeds diff --git a/BFieldTest/test/BFieldSymmetry.fcl b/BFieldTest/test/BFieldSymmetry.fcl index 3995627bf5..10654e795d 100644 --- a/BFieldTest/test/BFieldSymmetry.fcl +++ b/BFieldTest/test/BFieldSymmetry.fcl @@ -16,7 +16,6 @@ services: { scheduler : { defaultExceptions : false } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/BFieldTest/test/BFieldTest.fcl b/BFieldTest/test/BFieldTest.fcl index 4bc7ad32c8..6daf578425 100644 --- a/BFieldTest/test/BFieldTest.fcl +++ b/BFieldTest/test/BFieldTest.fcl @@ -14,7 +14,6 @@ services: { scheduler : { defaultExceptions : false } GeometryService : { inputFile : "Offline/Mu2eG4/test/geom_mau10_custom.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/CRVResponse/test/CRVResponseDAQ.fcl b/CRVResponse/test/CRVResponseDAQ.fcl index 9d673e2b2a..a48eaef60e 100644 --- a/CRVResponse/test/CRVResponseDAQ.fcl +++ b/CRVResponse/test/CRVResponseDAQ.fcl @@ -15,7 +15,6 @@ services : { RandomNumberGenerator: {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/CRVResponse/test/CRVResponsePlot_v05.fcl b/CRVResponse/test/CRVResponsePlot_v05.fcl index cef37d6764..4461ee1634 100644 --- a/CRVResponse/test/CRVResponsePlot_v05.fcl +++ b/CRVResponse/test/CRVResponsePlot_v05.fcl @@ -17,7 +17,6 @@ services : RandomNumberGenerator: {defaultEngineKind: "MixMaxRng" } TFileService : { fileName: "test.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/studies/geom_cosmic_v05.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/CRVResponse/test/CRVResponse_RadiationBackgroundStudies.fcl b/CRVResponse/test/CRVResponse_RadiationBackgroundStudies.fcl index 1a25e51cc6..358a3bc520 100644 --- a/CRVResponse/test/CRVResponse_RadiationBackgroundStudies.fcl +++ b/CRVResponse/test/CRVResponse_RadiationBackgroundStudies.fcl @@ -13,7 +13,6 @@ services : { RandomNumberGenerator: {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/CRVResponse/test/CRVResponse_v05.fcl b/CRVResponse/test/CRVResponse_v05.fcl index 56770be046..4db036b4da 100644 --- a/CRVResponse/test/CRVResponse_v05.fcl +++ b/CRVResponse/test/CRVResponse_v05.fcl @@ -16,7 +16,6 @@ services : { RandomNumberGenerator: {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/studies/geom_cosmic_v05.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/CRVResponse/test/CRVResponse_v07.fcl b/CRVResponse/test/CRVResponse_v07.fcl index 740d99dd48..8eeadc0585 100644 --- a/CRVResponse/test/CRVResponse_v07.fcl +++ b/CRVResponse/test/CRVResponse_v07.fcl @@ -15,7 +15,6 @@ services : { RandomNumberGenerator: {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common_crv_v07.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/CalPatRec/test/calPatRec.fcl b/CalPatRec/test/calPatRec.fcl index daac3c359b..b1c28ba4d3 100644 --- a/CalPatRec/test/calPatRec.fcl +++ b/CalPatRec/test/calPatRec.fcl @@ -38,7 +38,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/calPatRec_01.fcl b/CalPatRec/test/calPatRec_01.fcl index d7fcdeb625..5ecfccc30b 100644 --- a/CalPatRec/test/calPatRec_01.fcl +++ b/CalPatRec/test/calPatRec_01.fcl @@ -40,7 +40,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/calPatRec_02.fcl b/CalPatRec/test/calPatRec_02.fcl index d7b1e957f8..b0c33b14d8 100644 --- a/CalPatRec/test/calPatRec_02.fcl +++ b/CalPatRec/test/calPatRec_02.fcl @@ -39,7 +39,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CalPatRec/test/calPatRec_display.fcl b/CalPatRec/test/calPatRec_display.fcl index a75f2ec66e..7f7e092842 100644 --- a/CalPatRec/test/calPatRec_display.fcl +++ b/CalPatRec/test/calPatRec_display.fcl @@ -50,7 +50,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } #GeometryService : { inputFile : "murat/geom/geom_common_BaF2_r_1_1.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/calPatRec_display_cnv00502.fcl b/CalPatRec/test/calPatRec_display_cnv00502.fcl index ac729dbddb..6b2219746a 100644 --- a/CalPatRec/test/calPatRec_display_cnv00502.fcl +++ b/CalPatRec/test/calPatRec_display_cnv00502.fcl @@ -50,7 +50,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } #GeometryService : { inputFile : "murat/geom/geom_common_BaF2_r_1_1.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/calPatRec_display_read.fcl b/CalPatRec/test/calPatRec_display_read.fcl index 98c00fbe36..2fd9df5fcc 100644 --- a/CalPatRec/test/calPatRec_display_read.fcl +++ b/CalPatRec/test/calPatRec_display_read.fcl @@ -50,7 +50,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } #GeometryService : { inputFile : "murat/geom/geom_common_BaF2_r_1_1.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/deltaFinder_debug_ce.fcl b/CalPatRec/test/deltaFinder_debug_ce.fcl index 86c0a67753..9f8e5ff9fe 100644 --- a/CalPatRec/test/deltaFinder_debug_ce.fcl +++ b/CalPatRec/test/deltaFinder_debug_ce.fcl @@ -18,7 +18,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } # Timing : { } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/CalPatRec/test/mergePatRec.fcl b/CalPatRec/test/mergePatRec.fcl index dabda57bcc..a82d459be5 100644 --- a/CalPatRec/test/mergePatRec.fcl +++ b/CalPatRec/test/mergePatRec.fcl @@ -32,7 +32,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CalPatRec/test/mergePatRec_02.fcl b/CalPatRec/test/mergePatRec_02.fcl index 14664e5fcb..7f5daa2379 100644 --- a/CalPatRec/test/mergePatRec_02.fcl +++ b/CalPatRec/test/mergePatRec_02.fcl @@ -41,7 +41,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/mergePatRec_03.fcl b/CalPatRec/test/mergePatRec_03.fcl index 0bf5169b6f..db6613a250 100644 --- a/CalPatRec/test/mergePatRec_03.fcl +++ b/CalPatRec/test/mergePatRec_03.fcl @@ -42,7 +42,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CalPatRec/test/mergePatRec_display.fcl b/CalPatRec/test/mergePatRec_display.fcl index 005f6a816f..66c5c61b86 100644 --- a/CalPatRec/test/mergePatRec_display.fcl +++ b/CalPatRec/test/mergePatRec_display.fcl @@ -49,7 +49,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/mergePatRec_display_read.fcl b/CalPatRec/test/mergePatRec_display_read.fcl index b334a0679e..f3cb96ea91 100644 --- a/CalPatRec/test/mergePatRec_display_read.fcl +++ b/CalPatRec/test/mergePatRec_display_read.fcl @@ -48,7 +48,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/printTrackerNumerology.fcl b/CalPatRec/test/printTrackerNumerology.fcl index f8c68b27b2..f762ff5288 100644 --- a/CalPatRec/test/printTrackerNumerology.fcl +++ b/CalPatRec/test/printTrackerNumerology.fcl @@ -20,7 +20,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } # Timing : { } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/CalPatRec/test/trkPatRec_01.fcl b/CalPatRec/test/trkPatRec_01.fcl index 6a53694858..e2b28ff1b1 100644 --- a/CalPatRec/test/trkPatRec_01.fcl +++ b/CalPatRec/test/trkPatRec_01.fcl @@ -38,7 +38,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CalPatRec/test/trkPatRec_02.fcl b/CalPatRec/test/trkPatRec_02.fcl index 4e39a4fa16..052a5e1828 100644 --- a/CalPatRec/test/trkPatRec_02.fcl +++ b/CalPatRec/test/trkPatRec_02.fcl @@ -37,7 +37,6 @@ services : { GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/CalPatRec/test/trkPatRec_display.fcl b/CalPatRec/test/trkPatRec_display.fcl index a6c8553784..92514ba05d 100644 --- a/CalPatRec/test/trkPatRec_display.fcl +++ b/CalPatRec/test/trkPatRec_display.fcl @@ -38,7 +38,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/CalPatRec/test/trkPatRec_display_read.fcl b/CalPatRec/test/trkPatRec_display_read.fcl index d7e4a3e551..b13c22bc74 100644 --- a/CalPatRec/test/trkPatRec_display_read.fcl +++ b/CalPatRec/test/trkPatRec_display_read.fcl @@ -42,7 +42,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } # Mu2eG4Helper : { } # SeedService : @local::automaticSeeds diff --git a/CaloMC/fcl/prolog.fcl b/CaloMC/fcl/prolog.fcl index bbb1bc3bcc..8020baa350 100644 --- a/CaloMC/fcl/prolog.fcl +++ b/CaloMC/fcl/prolog.fcl @@ -22,7 +22,7 @@ CaloMC : { nMaxFragment : 1000 minPeakADC : @local::HitMakerMinPeakADC readoutPEPerMeV : @local::readoutPEPerMeV - ADCToMeV : @local::ADCToMeV + MeVToADC : @local::MeVToADC diagLevel : 0 } } @@ -82,7 +82,7 @@ CaloMC : { @table::CaloMC nBinsPeak : 2 bufferDigi : 16 readoutPEPerMeV : @local::readoutPEPerMeV - ADCToMeV : @local::ADCToMeV + MeVToADC : @local::MeVToADC diagLevel : 0 } @@ -96,7 +96,7 @@ CaloMC : { @table::CaloMC pulseHistName : @local::pulseHistName digiSampling : @local::HitMakerDigiSampling minAmplitude : 32 - ADCToMeV : @local::ADCToMeV + MeVToADC : @local::MeVToADC fillDetailedMC : false diagLevel : 0 } diff --git a/CaloMC/inc/CaloNoiseSimGenerator.hh b/CaloMC/inc/CaloNoiseSimGenerator.hh index f9b08f1796..4d66cd59cb 100644 --- a/CaloMC/inc/CaloNoiseSimGenerator.hh +++ b/CaloMC/inc/CaloNoiseSimGenerator.hh @@ -32,7 +32,7 @@ namespace mu2e { fhicl::Atom darkNphotPerNs { Name("darkNphotPerNs"), Comment("SiPM Dark noise number of PE / ns ") }; fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; fhicl::Atom pePerMeV { Name("readoutPEPerMeV"),Comment("Number of pe / MeV for Readout") }; - fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; + fhicl::Atom MeVToADC { Name("MeVToADC"), Comment("MeV to ADC conversion factor") }; fhicl::Atom noiseWFSize { Name("noiseWFSize"), Comment("Noise WF size") }; fhicl::Atom nMaxFragment { Name("nMaxFragment"), Comment("maximum number of wf generated for extracting noise fragments ") }; fhicl::Atom minPeakADC { Name("minPeakADC"), Comment("Minimum ADC hits of local peak to digitize") }; diff --git a/CaloMC/src/CaloDigiMaker_module.cc b/CaloMC/src/CaloDigiMaker_module.cc index e609391e69..cfec407e3c 100644 --- a/CaloMC/src/CaloDigiMaker_module.cc +++ b/CaloMC/src/CaloDigiMaker_module.cc @@ -66,7 +66,7 @@ namespace mu2e { fhicl::Atom addRandomNoise { Name("addRandomNoise"), Comment("Add random salt and pepper noise") }; fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; fhicl::Atom pePerMeV { Name("readoutPEPerMeV"), Comment("Number of pe / MeV for Readout") }; - fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; + fhicl::Atom MeVToADC { Name("MeVToADC"), Comment("MeV to ADC conversion factor") }; fhicl::Atom nBits { Name("nBits"), Comment("ADC Number of bits") }; fhicl::Atom nBinsPeak { Name("nBinsPeak"), Comment("Window size for finding local maximum to digitize wf") }; fhicl::Atom minPeakADC { Name("minPeakADC"), Comment("Minimum ADC hits of local peak to digitize") }; @@ -86,7 +86,7 @@ namespace mu2e { startTimeBuffer_ (config().digiSampling()*config().bufferDigi()), maxADCCounts_ ((1 << config().nBits()) -1), pePerMeV_ (config().pePerMeV()), - MeVToADC_ (1.0/config().ADCToMeV()), + MeVToADC_ (config().MeVToADC()), pulseShape_ (CaloPulseShape(config().pulseFileName(),config().pulseHistName(),config().digiSampling())), wfExtractor_ (config().bufferDigi(),config().nBinsPeak(),config().minPeakADC(),config().bufferDigi()), engine_ (createEngine(art::ServiceHandle()->getSeed())), diff --git a/CaloMC/src/CaloHitTruthMatch_module.cc b/CaloMC/src/CaloHitTruthMatch_module.cc index 93a92e15a4..f572e40670 100644 --- a/CaloMC/src/CaloHitTruthMatch_module.cc +++ b/CaloMC/src/CaloHitTruthMatch_module.cc @@ -43,7 +43,7 @@ namespace mu2e { fhicl::Atom pulseHistName { Name("pulseHistName"), Comment("Calo pulse hist name") }; fhicl::Atom digiSampling { Name("digiSampling"), Comment("Digitization time sampling") }; fhicl::Atom minAmplitude { Name("minAmplitude"), Comment("Minimum amplitude of waveform to define hit length") }; - fhicl::Atom ADCToMeV { Name("ADCToMeV"), Comment("ADC to MeV conversion factor") }; + fhicl::Atom MeVToADC { Name("MeVToADC"), Comment("MeV to ADC conversion factor") }; fhicl::Atom fillDetailedMC { Name("fillDetailedMC"), Comment("Fill SimParticle - SimShower Assn map")}; fhicl::Atom diagLevel { Name("diagLevel"), Comment("Diag Level"),0 }; }; @@ -58,7 +58,7 @@ namespace mu2e { pulseHistName_ (config().pulseHistName()), digiSampling_ (config().digiSampling()), minAmplitude_ (config().minAmplitude()), - MeVToADC_ (1.0/config().ADCToMeV()), + MeVToADC_ (config().MeVToADC()), fillDetailedMC_ (config().fillDetailedMC()), diagLevel_ (config().diagLevel()) { diff --git a/CaloMC/src/CaloNoiseSimGenerator.cc b/CaloMC/src/CaloNoiseSimGenerator.cc index fb1a391d03..db9133d0f5 100644 --- a/CaloMC/src/CaloNoiseSimGenerator.cc +++ b/CaloMC/src/CaloNoiseSimGenerator.cc @@ -31,7 +31,7 @@ namespace mu2e { noiseElec_ (config.elecNphotPerNs()), minPeakADC_ (config.minPeakADC()), pePerMeV_ (config.pePerMeV()), - MeVToADC_ (1.0/config.ADCToMeV()), + MeVToADC_ (config.MeVToADC()), randPoisson_ (engine), randGauss_ (engine), randFlat_ (engine), diff --git a/CaloMC/src/CaloShowerROMaker_module.cc b/CaloMC/src/CaloShowerROMaker_module.cc index 9dfd7fd9ad..11f719b69b 100644 --- a/CaloMC/src/CaloShowerROMaker_module.cc +++ b/CaloMC/src/CaloShowerROMaker_module.cc @@ -110,7 +110,7 @@ namespace mu2e { pbtmcTag_ (config().pbtmcTag()), digitizationStart_ (config().digitizationStart()), digitizationEnd_ (config().digitizationEnd()), - digitizationBuffer_ (config().digitizationEnd()), + digitizationBuffer_ (config().digitizationBuffer()), crystalNonUniformity_(config().crystalNonUniformity()), pePerMeV_ (config().pePerMeV()), LRUCorrection_ (config().LRUCorrection()), diff --git a/CaloReco/fcl/common.fcl b/CaloReco/fcl/common.fcl index c36630269a..c82cde0c56 100644 --- a/CaloReco/fcl/common.fcl +++ b/CaloReco/fcl/common.fcl @@ -6,6 +6,7 @@ BEGIN_PROLOG pulseFileName : "OfflineData/ConditionsService/CsI-waveform-2020-02-12.root" pulseHistName : "h_waveform" readoutPEPerMeV : 30.0 + MeVToADC : 16 ADCToMeV : 0.0625 END_PROLOG diff --git a/CaloReco/fcl/prolog.fcl b/CaloReco/fcl/prolog.fcl index ac4e76237c..2e4bf67905 100644 --- a/CaloReco/fcl/prolog.fcl +++ b/CaloReco/fcl/prolog.fcl @@ -12,7 +12,7 @@ CaloReco : { windowPeak : 3 minPeakAmplitude : 5 shiftTime : 57.5 - scaleFactor : 0.0625 + scaleFactor : @local::ADCToMeV diagLevel : 0 } diff --git a/ConditionsService/data/conditions_01.txt b/ConditionsService/data/conditions_01.txt deleted file mode 100644 index 28634595d4..0000000000 --- a/ConditionsService/data/conditions_01.txt +++ /dev/null @@ -1,38 +0,0 @@ -// -// Input file for the prototype conditions system. -// -// - -//Calorimeter calibration information - -// Longitudinal non-uniformity response, see Mu2e doc ... -double CrystalNonUniformity_0 = 1.05; - -//Birks correction for neutrons -double BirkCorrHadron = 4.0; - -//APD photo-statistic number -double ROphotostatistic = 30.0;//p.e / MeV - -//conversion factor from ADC counts to MeV -//double ADC2MeVConversionFactor = 1.6e-03; -double ADC2MeVConversionFactor = 0.0625; - - -//conversion factor from ADC counts to MeV -//double Peak2MeVConversionFactor = 0.0459634; -double Peak2MeVConversionFactor = 0.022981700; - -//value of the sigma used to do the Gaussian smearing due to the electronic noise, -//this is the quadratic sum of all APDs..... -double ReadOutElectronicNoise = 0.15;//MeV - -string calorimeter.pulseFileName = "OfflineData/ConditionsService/CsI-waveform-2020-02-12.root"; -string calorimeter.pulseHistName = "h_waveform"; -string calorimeter.propagFileName = "OfflineData/ConditionsService/CsI-propag-2020-07-29.root"; -string calorimeter.propagHistName = "h_zposTime"; - -// This tells emacs to view this file in c++ mode. -// Local Variables: -// mode:c++ -// End: diff --git a/EventGenerator/test/FromStepPointMCs.fcl b/EventGenerator/test/FromStepPointMCs.fcl index aaef1d6a32..4124d8ab0f 100644 --- a/EventGenerator/test/FromStepPointMCs.fcl +++ b/EventGenerator/test/FromStepPointMCs.fcl @@ -14,7 +14,6 @@ services: { message: @local::default_message scheduler: { defaultExceptions : false } - GlobalConstantsService : { inputFile : "Offline/ConditionsService/data/conditions_01.txt" } } physics: { diff --git a/EventGenerator/test/ceLeadingLog_test.fcl b/EventGenerator/test/ceLeadingLog_test.fcl index 295592346a..7fe25e85e9 100644 --- a/EventGenerator/test/ceLeadingLog_test.fcl +++ b/EventGenerator/test/ceLeadingLog_test.fcl @@ -22,7 +22,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/EventGenerator/test/ceMEndpoint_test.fcl b/EventGenerator/test/ceMEndpoint_test.fcl index 1abf6b6a3f..21f8fa7a09 100644 --- a/EventGenerator/test/ceMEndpoint_test.fcl +++ b/EventGenerator/test/ceMEndpoint_test.fcl @@ -19,7 +19,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/EventGenerator/test/cePEndpoint_test.fcl b/EventGenerator/test/cePEndpoint_test.fcl index 97137762aa..e2b7f8657d 100644 --- a/EventGenerator/test/cePEndpoint_test.fcl +++ b/EventGenerator/test/cePEndpoint_test.fcl @@ -19,7 +19,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/EventGenerator/test/cePLeadingLog_test.fcl b/EventGenerator/test/cePLeadingLog_test.fcl index 08181f8723..03e0aca38f 100644 --- a/EventGenerator/test/cePLeadingLog_test.fcl +++ b/EventGenerator/test/cePLeadingLog_test.fcl @@ -19,7 +19,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/EventGenerator/test/corsikaTest.fcl b/EventGenerator/test/corsikaTest.fcl index 167e8be4d9..55a7202151 100644 --- a/EventGenerator/test/corsikaTest.fcl +++ b/EventGenerator/test/corsikaTest.fcl @@ -54,7 +54,6 @@ services : { TFileService : { fileName : "nts.corsikaHist.owner.version.sequencer.root" } GeometryService : @local::Services.Core.GeometryService - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/EventGenerator/test/cryTest.fcl b/EventGenerator/test/cryTest.fcl index e8b8c05646..e8ad5770e8 100644 --- a/EventGenerator/test/cryTest.fcl +++ b/EventGenerator/test/cryTest.fcl @@ -38,7 +38,6 @@ services : { TFileService : { fileName : "nts.cryHist.owner.version.sequencer.root" } GeometryService : @local::Services.Core.GeometryService - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } diff --git a/EventGenerator/test/g4test_FromStepPointMCs.fcl b/EventGenerator/test/g4test_FromStepPointMCs.fcl index 47e0a9fc6f..6542f0eec7 100644 --- a/EventGenerator/test/g4test_FromStepPointMCs.fcl +++ b/EventGenerator/test/g4test_FromStepPointMCs.fcl @@ -23,7 +23,6 @@ services: { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/EventGenerator/test/rpc_int_test.fcl b/EventGenerator/test/rpc_int_test.fcl index 57fcdfeb47..06e679a43d 100644 --- a/EventGenerator/test/rpc_int_test.fcl +++ b/EventGenerator/test/rpc_int_test.fcl @@ -24,7 +24,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : { @table::automaticSeeds diff --git a/EventMixing/test/inspectMixed.fcl b/EventMixing/test/inspectMixed.fcl index 49fc8787aa..a3bc635ef0 100644 --- a/EventMixing/test/inspectMixed.fcl +++ b/EventMixing/test/inspectMixed.fcl @@ -31,7 +31,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/EventMixing/test/inspectUnMixed.fcl b/EventMixing/test/inspectUnMixed.fcl index 20a7a13292..86a47e1690 100644 --- a/EventMixing/test/inspectUnMixed.fcl +++ b/EventMixing/test/inspectUnMixed.fcl @@ -31,7 +31,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/EventMixing/test/mixProducer_01.fcl b/EventMixing/test/mixProducer_01.fcl index 2e096cd9f8..0c0ba8b681 100644 --- a/EventMixing/test/mixProducer_01.fcl +++ b/EventMixing/test/mixProducer_01.fcl @@ -24,7 +24,6 @@ services : GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/ExtinctionMonitorFNAL/test/digiDefsCommon.fcl b/ExtinctionMonitorFNAL/test/digiDefsCommon.fcl index b2d891566f..cc1ceceb17 100644 --- a/ExtinctionMonitorFNAL/test/digiDefsCommon.fcl +++ b/ExtinctionMonitorFNAL/test/digiDefsCommon.fcl @@ -14,7 +14,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng"} GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds Mu2eG4Helper : { } diff --git a/ExtinctionMonitorFNAL/test/digiTuning.fcl b/ExtinctionMonitorFNAL/test/digiTuning.fcl index cd74bcd07d..4bcf7c2214 100644 --- a/ExtinctionMonitorFNAL/test/digiTuning.fcl +++ b/ExtinctionMonitorFNAL/test/digiTuning.fcl @@ -18,7 +18,6 @@ services : { TFileService : { fileName : "digiTuning.root" } RandomNumberGenerator : {defaultEngineKind: "MixMaxRng"} - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds } diff --git a/ExtinctionMonitorFNAL/test/emfRecoTrackAnalysis.fcl b/ExtinctionMonitorFNAL/test/emfRecoTrackAnalysis.fcl index ad68302a7b..737e494a47 100644 --- a/ExtinctionMonitorFNAL/test/emfRecoTrackAnalysis.fcl +++ b/ExtinctionMonitorFNAL/test/emfRecoTrackAnalysis.fcl @@ -14,7 +14,6 @@ services: { TFileService: { fileName: "hist_emfRecoTracks.root" } message: @local::default_message GeometryService : { inputFile : "Production/JobConfig/common/geom_baseline.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService: { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/ExtinctionMonitorFNAL/test/extMonFNALDefsCommon.fcl b/ExtinctionMonitorFNAL/test/extMonFNALDefsCommon.fcl index 214dc672a0..cb8a17318d 100644 --- a/ExtinctionMonitorFNAL/test/extMonFNALDefsCommon.fcl +++ b/ExtinctionMonitorFNAL/test/extMonFNALDefsCommon.fcl @@ -28,7 +28,6 @@ services : { } ConditionsService: { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" printConfig : true configStatsVerbosity : 0 } diff --git a/ExtinctionMonitorFNAL/test/g4detectorDefsCommon.fcl b/ExtinctionMonitorFNAL/test/g4detectorDefsCommon.fcl index e78e19afa9..d3e7318880 100644 --- a/ExtinctionMonitorFNAL/test/g4detectorDefsCommon.fcl +++ b/ExtinctionMonitorFNAL/test/g4detectorDefsCommon.fcl @@ -36,7 +36,6 @@ services : { RandomNumberGenerator: {defaultEngineKind: "MixMaxRng"} GeometryService: {@table::Services.Core.GeometryService} - ConditionsService: { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService: { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService: @local::automaticSeeds Mu2eG4Helper: { } diff --git a/ExtinctionMonitorFNAL/test/g4s1_channelTest.fcl b/ExtinctionMonitorFNAL/test/g4s1_channelTest.fcl index 69990f4200..29339c6c01 100644 --- a/ExtinctionMonitorFNAL/test/g4s1_channelTest.fcl +++ b/ExtinctionMonitorFNAL/test/g4s1_channelTest.fcl @@ -22,7 +22,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng"} GeometryService : { inputFile : "Offline/ExtinctionMonitorFNAL/test/geom_channelTest.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } SeedService : @local::automaticSeeds Mu2eG4Helper : { } diff --git a/ExtinctionMonitorFNAL/test/recoDefsCommon.fcl b/ExtinctionMonitorFNAL/test/recoDefsCommon.fcl index e9705f23c7..d1e84e756e 100644 --- a/ExtinctionMonitorFNAL/test/recoDefsCommon.fcl +++ b/ExtinctionMonitorFNAL/test/recoDefsCommon.fcl @@ -25,7 +25,6 @@ services: { scheduler: { defaultExceptions : false } TFileService: {} GeometryService: { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService: { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService: { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/ExtinctionMonitorFNAL/test/trajectoryIn.fcl b/ExtinctionMonitorFNAL/test/trajectoryIn.fcl index 158d54b189..0dc5bde38f 100644 --- a/ExtinctionMonitorFNAL/test/trajectoryIn.fcl +++ b/ExtinctionMonitorFNAL/test/trajectoryIn.fcl @@ -17,7 +17,6 @@ services : { RandomNumberGenerator : {defaultEngineKind: "MixMaxRng" } GeometryService : { inputFile : "Offline/ExtinctionMonitorFNAL/test/geom_Mau11.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } SeedService : @local::automaticSeeds diff --git a/Mu2eG4/fcl/rantest.fcl b/Mu2eG4/fcl/rantest.fcl index 9e9eb7cfa0..9ce17e3286 100644 --- a/Mu2eG4/fcl/rantest.fcl +++ b/Mu2eG4/fcl/rantest.fcl @@ -33,7 +33,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Mu2eG4/fcl/replayWithSkip.fcl b/Mu2eG4/fcl/replayWithSkip.fcl index bb7517bf6e..f6c79d8c5e 100644 --- a/Mu2eG4/fcl/replayWithSkip.fcl +++ b/Mu2eG4/fcl/replayWithSkip.fcl @@ -40,7 +40,6 @@ services : ConditionsService : { - conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Mu2eUtilities/src/CaloPulseShape.cc b/Mu2eUtilities/src/CaloPulseShape.cc index 406a7e7d04..118b665357 100644 --- a/Mu2eUtilities/src/CaloPulseShape.cc +++ b/Mu2eUtilities/src/CaloPulseShape.cc @@ -1,5 +1,5 @@ +#include "cetlib_except/exception.h" #include "Offline/Mu2eUtilities/inc/CaloPulseShape.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/ConfigTools/inc/ConfigFileLookupPolicy.hh" #include "TFile.h" @@ -7,6 +7,7 @@ #include #include +#include namespace mu2e { diff --git a/ParticleID/test/test.fcl b/ParticleID/test/test.fcl index 76c1ec45ce..821220eb59 100644 --- a/ParticleID/test/test.fcl +++ b/ParticleID/test/test.fcl @@ -21,7 +21,6 @@ services : { TFileService : { fileName : "testpid.root" } GeometryService : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/fcl/standardServices.fcl b/fcl/standardServices.fcl index 067fa359d6..bbbc18dbab 100644 --- a/fcl/standardServices.fcl +++ b/fcl/standardServices.fcl @@ -43,7 +43,6 @@ Services : { bFieldFile : "Offline/Mu2eG4/geom/bfgeom_v01.txt" simulatedDetector : { tool_type: "Mu2e" } } - ConditionsService : { conditionsfile : "Offline/ConditionsService/data/conditions_01.txt" } GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } DbService : @local::DbEmpty ProditionsService: @local::Proditions From cc9c3aed716514ce70879f407bd0e705aee36238 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Thu, 12 Feb 2026 16:15:39 -0800 Subject: [PATCH 137/174] Address AI comments --- DataProducts/CMakeLists.txt | 1 + DataProducts/inc/FilterFraction.hh | 22 +++--- DataProducts/inc/PrescaleFilterFraction.hh | 26 +++++++ DataProducts/src/FilterFraction.cc | 6 +- DataProducts/src/PrescaleFilterFraction.cc | 24 +++++++ DataProducts/src/classes.h | 1 + DataProducts/src/classes_def.xml | 2 + Filters/src/RandomPrescaleFilter_module.cc | 13 ++-- Print/fcl/printFilterFraction.fcl | 3 + Print/inc/PrescaleFilterFractionPrinter.hh | 37 ++++++++++ Print/src/FilterFractionPrinter.cc | 12 ++-- Print/src/PrescaleFilterFractionPrinter.cc | 80 ++++++++++++++++++++++ Print/src/PrintModule_module.cc | 5 ++ Trigger/src/PrescaleEvent_module.cc | 18 ++--- 14 files changed, 213 insertions(+), 37 deletions(-) create mode 100644 DataProducts/inc/PrescaleFilterFraction.hh create mode 100644 DataProducts/src/PrescaleFilterFraction.cc create mode 100644 Print/inc/PrescaleFilterFractionPrinter.hh create mode 100644 Print/src/PrescaleFilterFractionPrinter.cc diff --git a/DataProducts/CMakeLists.txt b/DataProducts/CMakeLists.txt index 87acfa656d..9c60a43ad0 100644 --- a/DataProducts/CMakeLists.txt +++ b/DataProducts/CMakeLists.txt @@ -9,6 +9,7 @@ cet_make_library( src/FilterFraction.cc src/GenVector.cc src/PDGCode.cc + src/PrescaleFilterFraction.cc src/STMChannel.cc src/StrawEnd.cc src/StrawId.cc diff --git a/DataProducts/inc/FilterFraction.hh b/DataProducts/inc/FilterFraction.hh index 77751a2151..e0d27795bd 100644 --- a/DataProducts/inc/FilterFraction.hh +++ b/DataProducts/inc/FilterFraction.hh @@ -9,32 +9,26 @@ namespace mu2e { class FilterFraction { public: - enum FilterType { constant=0, nonominal, chained, unknown}; - // chained means multiple filtering steps have been chained together - FilterFraction(FilterType type, double nominal, uint64_t nseen, uint64_t npassed) : - type_(type),nominal_(nominal), nseen_(nseen), npassed_(npassed) {} - // use this constructor when there is no nominal selection fraction - FilterFraction(uint64_t nseen, uint64_t npassed) : - type_(nonominal),nominal_(-1.0), nseen_(nseen), npassed_(npassed) {} + FilterFraction(uint64_t nseen, uint64_t npassed) : nseen_(nseen), npassed_(npassed) {} // default FilterFraction(){} + virtual ~FilterFraction(){} // accessors - FilterType type() const { return type_; } - bool hasNominalValue() const { return type() == nonominal; } - double nominalFraction() const { return nominal_; } - double actualFraction() const { return nseen_ > 0 ? double(npassed_)/double(nseen_) : 0.0; } + double filterFraction() const { return nseen_ > 0 ? double(npassed_)/double(nseen_) : 0.0; } uint64_t nSeen() const { return nseen_; } uint64_t nPassed() const { return npassed_; } + bool chained() const { return chained_; } // concatenate multiple subruns in the same path FilterFraction& operator +=(FilterFraction const& other); FilterFraction operator + (FilterFraction const& other) const; - // concatenate with an upstream filter. The values must match! + // concatenate with an upstream filter FilterFraction chain(FilterFraction const& upstream) const; private: - FilterType type_ = unknown; // type of filtering performed - double nominal_ = -1; // nominal fraction (<1) of events expected to be kept by the filter uint64_t nseen_ = 0; // number of events processed by this filter uint64_t npassed_ = 0; // number of events passed by this filter + bool chained_ = false; // is this product the result of a chain of filters? + protected: + void setChained() { chained_ = true; } }; } #endif diff --git a/DataProducts/inc/PrescaleFilterFraction.hh b/DataProducts/inc/PrescaleFilterFraction.hh new file mode 100644 index 0000000000..971dfbec07 --- /dev/null +++ b/DataProducts/inc/PrescaleFilterFraction.hh @@ -0,0 +1,26 @@ +// +// art product to record the prescale filter fraction. +// Original author: Dave Brown (LBNL) 2026 +// +#ifndef DataProducts_PrescaleFilterFraction_hh +#define DataProducts_PrescaleFilterFraction_hh +#include "Offline/DataProducts/inc/FilterFraction.hh" +namespace mu2e { + class PrescaleFilterFraction : public FilterFraction { + public: + PrescaleFilterFraction(uint32_t prescale, uint64_t nseen, uint64_t npassed) : FilterFraction(nseen, npassed), prescale_(prescale) {} + PrescaleFilterFraction(uint32_t prescale) : prescale_(prescale) {} + PrescaleFilterFraction(){} + // accessors + uint32_t prescale() const { return prescale_; } + double prescaleFraction() const { return 1.0/double(prescale_); } + // concatenate multiple subruns in the same path + PrescaleFilterFraction& operator +=(PrescaleFilterFraction const& other); + PrescaleFilterFraction operator + (PrescaleFilterFraction const& other) const; + // concatenate with an upstream prescale filter + PrescaleFilterFraction chain(PrescaleFilterFraction const& upstream) const; + private: + uint32_t prescale_ = 0; // number of events to process for 1 to pass (on average) + }; +} +#endif diff --git a/DataProducts/src/FilterFraction.cc b/DataProducts/src/FilterFraction.cc index dc5c083ee3..ee36f8aecc 100644 --- a/DataProducts/src/FilterFraction.cc +++ b/DataProducts/src/FilterFraction.cc @@ -3,8 +3,6 @@ namespace mu2e { FilterFraction& FilterFraction::operator +=(FilterFraction const& other) { - if(other.type() != type() || (type()<= nonominal && other.nominalFraction() != nominalFraction())) - throw std::runtime_error("nominal filter fractions conflict"); nseen_ += other.nSeen(); npassed_ += other.nPassed(); return *this; @@ -17,6 +15,8 @@ namespace mu2e { // concatenate with an upstream filter. The values must match! FilterFraction FilterFraction::chain(FilterFraction const& upstream) const { if(upstream.nPassed() != nSeen())throw std::runtime_error("Filter counts conflict"); - return FilterFraction(chained,-1.0,upstream.nSeen(),nPassed()); + auto retval = FilterFraction(upstream.nSeen(),nPassed()); + retval.setChained(); + return retval; } } diff --git a/DataProducts/src/PrescaleFilterFraction.cc b/DataProducts/src/PrescaleFilterFraction.cc new file mode 100644 index 0000000000..6a1c404136 --- /dev/null +++ b/DataProducts/src/PrescaleFilterFraction.cc @@ -0,0 +1,24 @@ +#include "Offline/DataProducts/inc/PrescaleFilterFraction.hh" +#include + +namespace mu2e { + PrescaleFilterFraction& PrescaleFilterFraction::operator +=(PrescaleFilterFraction const& other) { + if(other.prescale() != prescale())throw std::runtime_error("Prescale values conflict"); + // invoke base class + (static_cast(this))->operator+=(other); + return *this; + } + PrescaleFilterFraction PrescaleFilterFraction::operator + (PrescaleFilterFraction const& other) const { + auto retval = *this; + retval += other; + return retval; + } + // concatenate with an upstream filter + PrescaleFilterFraction PrescaleFilterFraction::chain(PrescaleFilterFraction const& upstream) const { + if(upstream.nPassed() != nSeen())throw std::runtime_error("Filter counts conflict"); + // the net prescale of a chain is the product of the individual prescale values + auto retval = PrescaleFilterFraction(prescale()*upstream.prescale(),upstream.nSeen(),nPassed()); + retval.setChained(); + return retval; + } +} diff --git a/DataProducts/src/classes.h b/DataProducts/src/classes.h index f8c9f08ff9..69c9411e58 100644 --- a/DataProducts/src/classes.h +++ b/DataProducts/src/classes.h @@ -63,6 +63,7 @@ // Filter #include "Offline/DataProducts/inc/FilterFraction.hh" +#include "Offline/DataProducts/inc/PrescaleFilterFraction.hh" // General #include "Offline/DataProducts/inc/SurfaceId.hh" diff --git a/DataProducts/src/classes_def.xml b/DataProducts/src/classes_def.xml index 2f94e99895..5d0e04e9a6 100644 --- a/DataProducts/src/classes_def.xml +++ b/DataProducts/src/classes_def.xml @@ -62,6 +62,8 @@ + + diff --git a/Filters/src/RandomPrescaleFilter_module.cc b/Filters/src/RandomPrescaleFilter_module.cc index f4657391b7..80ad88dcb7 100644 --- a/Filters/src/RandomPrescaleFilter_module.cc +++ b/Filters/src/RandomPrescaleFilter_module.cc @@ -13,7 +13,7 @@ #include "messagefacility/MessageLogger/MessageLogger.h" #include "Offline/SeedService/inc/SeedService.hh" #include "CLHEP/Random/RandFlat.h" -#include "Offline/DataProducts/inc/FilterFraction.hh" +#include "Offline/DataProducts/inc/PrescaleFilterFraction.hh" namespace mu2e { @@ -23,7 +23,7 @@ namespace mu2e public: struct Config { - fhicl::Atom nPrescale { fhicl::Name("nPrescale"), fhicl::Comment("Average number of events to process for 1 to pass the filter"), 1.0}; + fhicl::Atom nPrescale { fhicl::Name("nPrescale"), fhicl::Comment("Average number of events to process for 1 to pass the filter")}; fhicl::Atom debugLevel{ fhicl::Name("debugLevel"),fhicl::Comment("debug level"),0 }; }; using Parameters = art::EDFilter::Table; @@ -46,7 +46,7 @@ namespace mu2e art::RandomNumberGenerator::base_engine_t& engine_; CLHEP::RandFlat randflat_; int debug_; - double frac_; + uint32_t prescale_; uint64_t nevt_, npass_; }; @@ -55,7 +55,7 @@ namespace mu2e engine_(createEngine( art::ServiceHandle()->getSeed())), randflat_( engine_, 0.0, conf().nPrescale() ), debug_(conf().debugLevel()), - frac_(1.0/double(conf().nPrescale())), + prescale_(conf().nPrescale()), nevt_(0), npass_(0) { produces(); @@ -70,10 +70,11 @@ namespace mu2e } bool RandomPrescaleFilter::endSubRun( art::SubRun& subrun ) { - auto ff = std::make_unique(FilterFraction::constant,frac_, nevt_,npass_); + auto ff = std::make_unique(prescale_, nevt_,npass_); subrun.put(std::move(ff),"",art::fullSubRun()); if(debug_ > 0 && nevt_ > 0){ - std::cout << moduleDescription().moduleLabel() << " passed " << npass_ << " events out of " << nevt_ << " for a ratio of " << float(npass_)/float(nevt_) << std::endl; + double frac = prescale_ > 0 ? 1.0/double(prescale_) : 0.0; + std::cout << moduleDescription().moduleLabel() << " passed " << npass_ << " events out of " << nevt_ << " for a ratio of " << float(npass_)/float(nevt_) << " with an expected fraction of " << frac << std::endl; } // reset npass_ = 0; nevt_ = 0; diff --git a/Print/fcl/printFilterFraction.fcl b/Print/fcl/printFilterFraction.fcl index eb682d909f..16016e0c60 100644 --- a/Print/fcl/printFilterFraction.fcl +++ b/Print/fcl/printFilterFraction.fcl @@ -23,6 +23,9 @@ physics :{ FilterFractionPrinter : { verbose : 1 } + PrescaleFilterFractionPrinter : { + verbose : 1 + } } # printModule diff --git a/Print/inc/PrescaleFilterFractionPrinter.hh b/Print/inc/PrescaleFilterFractionPrinter.hh new file mode 100644 index 0000000000..ba4c95a215 --- /dev/null +++ b/Print/inc/PrescaleFilterFractionPrinter.hh @@ -0,0 +1,37 @@ +// +// Utility class to print PrescaleFilterFraction +// +#ifndef Print_inc_PrescaleFilterFractionPrinter_hh +#define Print_inc_PrescaleFilterFractionPrinter_hh + +#include +#include + +#include "Offline/DataProducts/inc/PrescaleFilterFraction.hh" +#include "Offline/Print/inc/ProductPrinter.hh" +#include "art/Framework/Principal/Handle.h" +#include "canvas/Persistency/Common/Ptr.h" + +namespace mu2e { + +class PrescaleFilterFractionPrinter : public ProductPrinter { + public: + PrescaleFilterFractionPrinter() {} + PrescaleFilterFractionPrinter(const Config& conf) : ProductPrinter(conf) {} + + // all the ways to request a printout + void Print(art::Event const& event, std::ostream& os = std::cout) override; + void PrintSubRun(art::SubRun const& subrun, + std::ostream& os = std::cout) override; + void Print(const art::Handle& handle, + std::ostream& os = std::cout); + void Print(const art::ValidHandle& handle, + std::ostream& os = std::cout); + void Print(const mu2e::PrescaleFilterFraction& obj, int ind = -1, + std::ostream& os = std::cout); + void PrintHeader(const std::string& tag, std::ostream& os = std::cout); + private: +}; + +} // namespace mu2e +#endif diff --git a/Print/src/FilterFractionPrinter.cc b/Print/src/FilterFractionPrinter.cc index 30ea553298..8535369c23 100644 --- a/Print/src/FilterFractionPrinter.cc +++ b/Print/src/FilterFractionPrinter.cc @@ -11,20 +11,19 @@ void mu2e::FilterFractionPrinter::PrintSubRun(art::SubRun const& subrun, std::os if (verbose() < 1) return; if (tags().empty()) { // if a list of instances not specified, print all instances - std::vector > ffl = - subrun.getMany(); + std::vector > ffl = subrun.getMany(); for (auto const& cl : ffl) Print(cl); // also look for sampled instances auto ffs = subrun.getMany>(); if(ffs.size() > 0){ for (auto const& ff : ffs){ - std::cout << "SampledFilterFraction with tag " << ff->originalInputTag() << std::endl; + std::cout << "FilterFraction with tag " << ff->originalInputTag() << std::endl; auto sinfomh = subrun.getHandle("SamplingInput"); if(sinfomh.isValid()){ auto const& sinfom = *sinfomh; for(auto sinfoit = sinfom.begin(); sinfoit != sinfom.end(); ++sinfoit) { if(sinfoit->first.find("Cosmic") != std::string::npos){ - std::cout << "With SampledSubRunInfo entry for dataset " << sinfoit->first << " Has the following FilterFractions: " << std::endl; + std::cout << "With SubRunInfo entry for dataset " << sinfoit->first << " Has the following FilterFractions: " << std::endl; for(auto const& sr : sinfoit->second.ids){ std::cout << sr << " : "; auto ffp = ff->get(sinfoit->first,sr); @@ -68,8 +67,9 @@ void mu2e::FilterFractionPrinter::Print( void mu2e::FilterFractionPrinter::Print(const mu2e::FilterFraction& obj, int ind, std::ostream& os) { os << std::setiosflags(std::ios::fixed | std::ios::right); - - os << " Type " << obj.type() << " Nominal fraction " << obj.nominalFraction() << " Actual Fraction " << obj.actualFraction() << " N Seen " << obj.nSeen() << std::endl; + os << " Fraction passing filter " << obj.filterFraction() << " N Seen " << obj.nSeen(); + if(obj.chained())os << " chained"; + os << std::endl; } void mu2e::FilterFractionPrinter::PrintHeader(const std::string& tag, diff --git a/Print/src/PrescaleFilterFractionPrinter.cc b/Print/src/PrescaleFilterFractionPrinter.cc new file mode 100644 index 0000000000..ef00bcba11 --- /dev/null +++ b/Print/src/PrescaleFilterFractionPrinter.cc @@ -0,0 +1,80 @@ +#include "Offline/Print/inc/PrescaleFilterFractionPrinter.hh" +#include "art/Framework/Principal/Provenance.h" +#include "canvas/Persistency/Common/Sampled.h" +#include "canvas/Persistency/Provenance/SampledInfo.h" +#include +#include + +void mu2e::PrescaleFilterFractionPrinter::Print(art::Event const& event, std::ostream& os) {} + +void mu2e::PrescaleFilterFractionPrinter::PrintSubRun(art::SubRun const& subrun, std::ostream& os) { + if (verbose() < 1) return; + if (tags().empty()) { + // if a list of instances not specified, print all instances + std::vector > ffl = subrun.getMany(); + for (auto const& cl : ffl) Print(cl); + // also look for sampled instances + auto ffs = subrun.getMany>(); + if(ffs.size() > 0){ + for (auto const& ff : ffs){ + std::cout << "PrescaleFilterFraction with tag " << ff->originalInputTag() << std::endl; + auto sinfomh = subrun.getHandle("SamplingInput"); + if(sinfomh.isValid()){ + auto const& sinfom = *sinfomh; + for(auto sinfoit = sinfom.begin(); sinfoit != sinfom.end(); ++sinfoit) { + if(sinfoit->first.find("Cosmic") != std::string::npos){ + std::cout << "With SubRunInfo entry for dataset " << sinfoit->first << " Has the following PrescaleFilterFractions: " << std::endl; + for(auto const& sr : sinfoit->second.ids){ + std::cout << sr << " : "; + auto ffp = ff->get(sinfoit->first,sr); + if(!ffp.empty()) Print(*ffp); + } + } + } + } + } + } + + } else { + // print requested instances + for (const auto& tag : tags()) { + auto ff = subrun.getValidHandle(tag); + Print(ff); + } + } +} + +void mu2e::PrescaleFilterFractionPrinter::Print( + const art::Handle& handle, std::ostream& os) { + if (verbose() < 1) return; + // the product tags with all four fields, with underscores + std::string tag = handle.provenance()->productDescription().branchName(); + tag.pop_back(); // remove trailing dot + PrintHeader(tag, os); + Print(*handle); +} + +void mu2e::PrescaleFilterFractionPrinter::Print( + const art::ValidHandle& handle, std::ostream& os) { + if (verbose() < 1) return; + // the product tags with all four fields, with underscores + std::string tag = handle.provenance()->productDescription().branchName(); + tag.pop_back(); // remove trailing dot + PrintHeader(tag, os); + Print(*handle); +} + +void mu2e::PrescaleFilterFractionPrinter::Print(const mu2e::PrescaleFilterFraction& obj, + int ind, std::ostream& os) { + os << std::setiosflags(std::ios::fixed | std::ios::right); + os << " Fraction passing filter " << obj.filterFraction() << " N Seen " << obj.nSeen() + << " with prescale fraction " << obj.prescaleFraction(); + if(obj.chained())os << " chained"; + os << std::endl; +} + +void mu2e::PrescaleFilterFractionPrinter::PrintHeader(const std::string& tag, + std::ostream& os) { + if (verbose() < 1) return; + os << "\nProductPrint " << tag << "\n"; +} diff --git a/Print/src/PrintModule_module.cc b/Print/src/PrintModule_module.cc index f9bad484f1..a3844ec0fe 100644 --- a/Print/src/PrintModule_module.cc +++ b/Print/src/PrintModule_module.cc @@ -19,6 +19,7 @@ #include "Offline/Print/inc/ComboHitPrinter.hh" #include "Offline/Print/inc/CosmicLivetimePrinter.hh" #include "Offline/Print/inc/FilterFractionPrinter.hh" +#include "Offline/Print/inc/PrescaleFilterFractionPrinter.hh" #include "Offline/Print/inc/CrvCoincidenceClusterPrinter.hh" #include "Offline/Print/inc/CrvDigiMCPrinter.hh" #include "Offline/Print/inc/CrvDigiPrinter.hh" @@ -77,6 +78,8 @@ class PrintModule : public art::EDAnalyzer { fhicl::Name("CosmicLivetimePrinter")}; fhicl::Table FilterFractionPrinter{ fhicl::Name("FilterFractionPrinter")}; + fhicl::Table PrescaleFilterFractionPrinter{ + fhicl::Name("PrescaleFilterFractionPrinter")}; fhicl::Table EventWindowMarkerPrinter{ fhicl::Name("EventWindowMarkerPrinter")}; fhicl::Table genParticlePrinter{ @@ -188,6 +191,8 @@ mu2e::PrintModule::PrintModule(const Parameters& conf) : art::EDAnalyzer(conf), make_unique(conf().CosmicLivetimePrinter())); _printers.push_back( make_unique(conf().FilterFractionPrinter())); + _printers.push_back( + make_unique(conf().PrescaleFilterFractionPrinter())); _printers.push_back( make_unique(conf().EventWindowMarkerPrinter())); _printers.push_back( diff --git a/Trigger/src/PrescaleEvent_module.cc b/Trigger/src/PrescaleEvent_module.cc index fab5f71d76..167e9fc131 100644 --- a/Trigger/src/PrescaleEvent_module.cc +++ b/Trigger/src/PrescaleEvent_module.cc @@ -18,7 +18,7 @@ #include "canvas/Utilities/InputTag.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "Offline/DataProducts/inc/EventWindowMarker.hh" -#include "Offline/DataProducts/inc/FilterFraction.hh" +#include "Offline/DataProducts/inc/PrescaleFilterFraction.hh" #include "artdaq-core-mu2e/Data/EventHeader.hh" #include @@ -42,9 +42,10 @@ namespace mu2e struct EventMode { EventWindowMarker::SpillType type_; - int prescale_; + uint32_t prescale_; std::string name_; - EventMode(EventWindowMarker::SpillType type, int prescale, std::string const& name ) : type_(type), prescale_(prescale), name_(name) {} + EventMode(EventWindowMarker::SpillType type, int prescale, std::string const& name ) : type_(type), + prescale_(static_cast(std::max(0,prescale))), name_(name) {} }; struct Config { @@ -85,7 +86,7 @@ namespace mu2e if(mode.eventMode() == "OffSpill") eventMode_.push_back(EventMode(EventWindowMarker::offspill, mode.prescale(),mode.eventMode())); else if(mode.eventMode() == "OnSpill") eventMode_.push_back(EventMode(EventWindowMarker::onspill, mode.prescale(),mode.eventMode())); else throw cet::exception("TRIGGER") << "Unknown prescale mode " << mode.eventMode(); - produces(mode.eventMode()); + produces(mode.eventMode()); } } @@ -112,13 +113,14 @@ namespace mu2e bool PrescaleEvent::endSubRun( art::SubRun& subrun ) { for (size_t imode = 0; imode < eventMode_.size(); imode++){ auto const& mode = eventMode_[imode]; - double frac = mode.prescale_ > 0 ? 1.0/double(mode.prescale_) : 0; - auto ff = std::make_unique(FilterFraction::constant, frac, nevt_[imode],npass_[imode]); + auto ff = std::make_unique(mode.prescale_, nevt_[imode],npass_[imode]); subrun.put(std::move(ff),mode.name_,art::fullSubRun()); if(debug_ > 0){ + double frac = mode.prescale_ > 0 ? 1.0/double(mode.prescale_) : 0.0; std::cout << moduleDescription().moduleLabel() << " mode " << mode.name_ << " passed " << npass_[imode] << " events out of " << nevt_[imode] - << " for a ratio of " << ((nevt_[imode] > 0) ? double(npass_[imode])/double(nevt_[imode]) : 0.f) << std::endl; - } + << " for a ratio of " << ((nevt_[imode] > 0) ? double(npass_[imode])/double(nevt_[imode]) : 0.f) + << " with an expected fraction of " << frac << std::endl; + } // reset npass_[imode] = 0; nevt_[imode] = 0; } From 20a2ea843372da4eab313ed09bf4836042121c1b Mon Sep 17 00:00:00 2001 From: Richard Bonventre Date: Mon, 26 Jan 2026 16:05:27 -0800 Subject: [PATCH 138/174] SHD time cluster info --- TrkDiag/src/StrawHitDiag_module.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/TrkDiag/src/StrawHitDiag_module.cc b/TrkDiag/src/StrawHitDiag_module.cc index 12fe02d1fb..9465190419 100644 --- a/TrkDiag/src/StrawHitDiag_module.cc +++ b/TrkDiag/src/StrawHitDiag_module.cc @@ -29,6 +29,7 @@ #include "Offline/RecoDataProducts/inc/ProtonBunchTime.hh" #include "Offline/MCDataProducts/inc/ProtonBunchTimeMC.hh" #include "Offline/DataProducts/inc/EventWindowMarker.hh" +#include "Offline/RecoDataProducts/inc/TimeCluster.hh" using namespace std; using CLHEP::Hep3Vector; @@ -57,6 +58,7 @@ namespace mu2e art::InputTag _stTag; art::InputTag _mcdigisTag; art::InputTag _digisTag; + art::InputTag _tcTag; // cache of event objects const StrawHitCollection* _shcol; const ComboHitCollection* _chcol; @@ -64,6 +66,7 @@ namespace mu2e const StrawDigiMCCollection *_mcdigis; const StrawDigiCollection *_digis; const StrawDigiADCWaveformCollection *_digiadcs; + const TimeClusterCollection* _tccol; // strawhit tuple variables TTree *_shdiag; Int_t _eventid, _subrunid, _runid; @@ -99,6 +102,8 @@ namespace mu2e Int_t _digipeak; Float_t _digipedestal; Int_t _digitdc[2], _digitot[2]; + Int_t _intimecluster; + bool _tcfilter; ProditionsHandle _strawele_h; // helper array StrawEnd _end[2]; @@ -116,6 +121,8 @@ namespace mu2e _pbtmcTag(pset.get("ProtonBunchTimeMC","EWMProducer")), _mcdigisTag(pset.get("StrawDigiMCCollection","makeSD")), _digisTag(pset.get("StrawDigiCollection","makeSD")), + _tcTag(pset.get("TimeClusterCollection","")), + _tcfilter(pset.get("TCFilter",false)), _end{StrawEnd::cal,StrawEnd::hv} { if(pset.get("TestStrawId",false)) { @@ -157,6 +164,7 @@ namespace mu2e _digiadcs = 0; _pbt = 0; _pbtmc = 0; + _tccol = 0; // nb: getValidHandle does the protection (exception) on handle validity so I don't have to auto shH = evt.getValidHandle(_shTag); _shcol = shH.product(); @@ -180,6 +188,9 @@ namespace mu2e } auto pbtHandle = evt.getValidHandle(_pbtTag); _pbt = pbtHandle.product()->pbtime_; + auto const& tch = evt.getHandle(_tcTag); + if(tch.isValid()) + _tccol = tch.product(); return _shcol != 0 && _chcol != 0 && (_shfcol != 0 || !_useshfcol) && (_mcdigis != 0 || !_mcdiag) && ((_digis != 0 && _digiadcs != 0) || !_digidiag); } @@ -227,6 +238,7 @@ namespace mu2e _shdiag->Branch("delay",&_delay,"delaycal/F:delayhv/F"); _shdiag->Branch("threshold",&_threshold,"thresholdcal/F:thresholdhv/F"); _shdiag->Branch("adcgain",&_adcgain,"adcgain/F"); + _shdiag->Branch("intimecluster",&_intimecluster,"intimecluster/I"); if(_mcdiag){ _shdiag->Branch("mcshpos.",&_mcshp); _shdiag->Branch("mcopos.",&_mcop); @@ -277,7 +289,20 @@ namespace mu2e const Tracker& tracker = *GeomHandle(); //FIXME switch to aligned static const double rstraw = tracker.strawOuterRadius(); unsigned nstrs = _chcol->size(); + std::vector intimecluster(nstrs,0); + if (_tccol){ + for (size_t itc=0;itc<_tccol->size();itc++){ + auto const& tc = _tccol->at(itc); + for (size_t j=0;jat(istr); ComboHit const& ch = _chcol->at(istr); StrawHitFlag shf = ch.flag(); From 8d3e5b592c71ed973044bb03781891fb81b4ab29 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 13 Feb 2026 09:15:50 -0800 Subject: [PATCH 139/174] Add new file --- Print/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Print/CMakeLists.txt b/Print/CMakeLists.txt index f253f01757..40ffe7056e 100644 --- a/Print/CMakeLists.txt +++ b/Print/CMakeLists.txt @@ -20,6 +20,7 @@ cet_make_library( src/EventWindowMarkerPrinter.cc src/GenParticlePrinter.cc src/FilterFractionPrinter.cc + src/PrescaleFilterFractionPrinter.cc src/HelixSeedPrinter.cc src/KalSeedPrinter.cc src/MCTrajectoryPrinter.cc From d41c6694629476ae195b9da0f4fe9003d7a8e1e4 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Fri, 13 Feb 2026 09:35:15 -0800 Subject: [PATCH 140/174] Address more AI comments --- Print/src/CosmicLivetimePrinter.cc | 9 ++++--- Print/src/FilterFractionPrinter.cc | 28 +++------------------- Print/src/PrescaleFilterFractionPrinter.cc | 28 +++------------------- 3 files changed, 10 insertions(+), 55 deletions(-) diff --git a/Print/src/CosmicLivetimePrinter.cc b/Print/src/CosmicLivetimePrinter.cc index 763ee1f731..99f784340e 100644 --- a/Print/src/CosmicLivetimePrinter.cc +++ b/Print/src/CosmicLivetimePrinter.cc @@ -7,8 +7,7 @@ void mu2e::CosmicLivetimePrinter::Print(art::Event const& event, std::ostream& os) {} -void mu2e::CosmicLivetimePrinter::PrintSubRun(art::SubRun const& subrun, - std::ostream& os) { +void mu2e::CosmicLivetimePrinter::PrintSubRun(art::SubRun const& subrun, std::ostream& os) { if (verbose() < 1) return; if (tags().empty()) { // if a list of instances not specified, print all instances @@ -19,15 +18,15 @@ void mu2e::CosmicLivetimePrinter::PrintSubRun(art::SubRun const& subrun, auto vscl = subrun.getMany>(); if(vscl.size() > 0){ for (auto const& scl : vscl){ - std::cout << "SampledCosmicLivetime with tag " << scl->originalInputTag() << std::endl; + os << "SampledCosmicLivetime with tag " << scl->originalInputTag() << std::endl; auto sinfomh = subrun.getHandle("SamplingInput"); if(sinfomh.isValid()){ auto const& sinfom = *sinfomh; for(auto sinfoit = sinfom.begin(); sinfoit != sinfom.end(); ++sinfoit) { if(sinfoit->first.find("Cosmic") != std::string::npos){ - std::cout << "With SampledSubRunInfo entry for dataset " << sinfoit->first << " Has the following CosmicLivetimes: " << std::endl; + os << "With SampledSubRunInfo entry for dataset " << sinfoit->first << " Has the following CosmicLivetimes: " << std::endl; for(auto const& sr : sinfoit->second.ids){ - std::cout << sr << " : "; + os << sr << " : "; auto sclp = scl->get(sinfoit->first,sr); if(!sclp.empty()) Print(*sclp); } diff --git a/Print/src/FilterFractionPrinter.cc b/Print/src/FilterFractionPrinter.cc index 8535369c23..64acf631c1 100644 --- a/Print/src/FilterFractionPrinter.cc +++ b/Print/src/FilterFractionPrinter.cc @@ -12,29 +12,7 @@ void mu2e::FilterFractionPrinter::PrintSubRun(art::SubRun const& subrun, std::os if (tags().empty()) { // if a list of instances not specified, print all instances std::vector > ffl = subrun.getMany(); - for (auto const& cl : ffl) Print(cl); - // also look for sampled instances - auto ffs = subrun.getMany>(); - if(ffs.size() > 0){ - for (auto const& ff : ffs){ - std::cout << "FilterFraction with tag " << ff->originalInputTag() << std::endl; - auto sinfomh = subrun.getHandle("SamplingInput"); - if(sinfomh.isValid()){ - auto const& sinfom = *sinfomh; - for(auto sinfoit = sinfom.begin(); sinfoit != sinfom.end(); ++sinfoit) { - if(sinfoit->first.find("Cosmic") != std::string::npos){ - std::cout << "With SubRunInfo entry for dataset " << sinfoit->first << " Has the following FilterFractions: " << std::endl; - for(auto const& sr : sinfoit->second.ids){ - std::cout << sr << " : "; - auto ffp = ff->get(sinfoit->first,sr); - if(!ffp.empty()) Print(*ffp); - } - } - } - } - } - } - + for (auto const& ff : ffl) Print(ff); } else { // print requested instances for (const auto& tag : tags()) { @@ -65,7 +43,7 @@ void mu2e::FilterFractionPrinter::Print( } void mu2e::FilterFractionPrinter::Print(const mu2e::FilterFraction& obj, - int ind, std::ostream& os) { + int ind, std::ostream& os) { os << std::setiosflags(std::ios::fixed | std::ios::right); os << " Fraction passing filter " << obj.filterFraction() << " N Seen " << obj.nSeen(); if(obj.chained())os << " chained"; @@ -73,7 +51,7 @@ void mu2e::FilterFractionPrinter::Print(const mu2e::FilterFraction& obj, } void mu2e::FilterFractionPrinter::PrintHeader(const std::string& tag, - std::ostream& os) { + std::ostream& os) { if (verbose() < 1) return; os << "\nProductPrint " << tag << "\n"; } diff --git a/Print/src/PrescaleFilterFractionPrinter.cc b/Print/src/PrescaleFilterFractionPrinter.cc index ef00bcba11..882a61b3b4 100644 --- a/Print/src/PrescaleFilterFractionPrinter.cc +++ b/Print/src/PrescaleFilterFractionPrinter.cc @@ -12,29 +12,7 @@ void mu2e::PrescaleFilterFractionPrinter::PrintSubRun(art::SubRun const& subrun, if (tags().empty()) { // if a list of instances not specified, print all instances std::vector > ffl = subrun.getMany(); - for (auto const& cl : ffl) Print(cl); - // also look for sampled instances - auto ffs = subrun.getMany>(); - if(ffs.size() > 0){ - for (auto const& ff : ffs){ - std::cout << "PrescaleFilterFraction with tag " << ff->originalInputTag() << std::endl; - auto sinfomh = subrun.getHandle("SamplingInput"); - if(sinfomh.isValid()){ - auto const& sinfom = *sinfomh; - for(auto sinfoit = sinfom.begin(); sinfoit != sinfom.end(); ++sinfoit) { - if(sinfoit->first.find("Cosmic") != std::string::npos){ - std::cout << "With SubRunInfo entry for dataset " << sinfoit->first << " Has the following PrescaleFilterFractions: " << std::endl; - for(auto const& sr : sinfoit->second.ids){ - std::cout << sr << " : "; - auto ffp = ff->get(sinfoit->first,sr); - if(!ffp.empty()) Print(*ffp); - } - } - } - } - } - } - + for (auto const& ff : ffl) Print(ff); } else { // print requested instances for (const auto& tag : tags()) { @@ -65,7 +43,7 @@ void mu2e::PrescaleFilterFractionPrinter::Print( } void mu2e::PrescaleFilterFractionPrinter::Print(const mu2e::PrescaleFilterFraction& obj, - int ind, std::ostream& os) { + int ind, std::ostream& os) { os << std::setiosflags(std::ios::fixed | std::ios::right); os << " Fraction passing filter " << obj.filterFraction() << " N Seen " << obj.nSeen() << " with prescale fraction " << obj.prescaleFraction(); @@ -74,7 +52,7 @@ void mu2e::PrescaleFilterFractionPrinter::Print(const mu2e::PrescaleFilterFracti } void mu2e::PrescaleFilterFractionPrinter::PrintHeader(const std::string& tag, - std::ostream& os) { + std::ostream& os) { if (verbose() < 1) return; os << "\nProductPrint " << tag << "\n"; } From 6476062e4f56ba40a096e3fe75b7926b30885987 Mon Sep 17 00:00:00 2001 From: Richard Bonventre Date: Fri, 13 Feb 2026 15:13:33 -0600 Subject: [PATCH 141/174] Bug fix in TimeAndPhiClusterFinder, option to skip time only clusters --- TrkPatRec/fcl/prolog.fcl | 1 + TrkPatRec/src/TimeAndPhiClusterFinder_module.cc | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/TrkPatRec/fcl/prolog.fcl b/TrkPatRec/fcl/prolog.fcl index 12d6a2a101..36578d102d 100644 --- a/TrkPatRec/fcl/prolog.fcl +++ b/TrkPatRec/fcl/prolog.fcl @@ -71,6 +71,7 @@ TrkPatRec : { @table::TrkPatRec MinHitSelect : 50 MinCutMVA : 0.1 SplitPhi : true + RequirePhi : false MaxDeltaPhi : 0.3 MaxNdiff : 1 Diag : 0 diff --git a/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc b/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc index 088e71f7af..fcbfbd6c44 100644 --- a/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc +++ b/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc @@ -76,6 +76,7 @@ namespace mu2e { fhicl::Atom minHitSelect {Name("MinHitSelect"), Comment("Minimun hits to copy full time cluster without any filtering") }; fhicl::Atom minCutMVA {Name("MinCutMVA"), Comment("Minimun value of NN output to keep hit") }; fhicl::Atom splitPhi {Name("SplitPhi"), Comment("Split time cluster with phi info") }; + fhicl::Atom reqphi {Name("RequirePhi"), Comment("Don't include time clusters before split into phi clusters") }; fhicl::Atom maxDeltaPhi {Name("MaxDeltaPhi"), Comment("Max delta phi between consecutive hits in cluster") }; fhicl::Atom maxNdiff {Name("MaxNdiff"), Comment("Max difference of number of hits between duplicated clusters") }; fhicl::Atom diag {Name("Diag"), Comment("Diag level"), 0 }; @@ -108,6 +109,7 @@ namespace mu2e { unsigned minHitSelect_; float minCutMVA_; bool splitPhi_; + bool reqphi_; float maxDeltaPhi_; int maxNdiff_; int diag_; @@ -164,6 +166,7 @@ namespace mu2e { minHitSelect_ (config().minHitSelect()), minCutMVA_ (config().minCutMVA()), splitPhi_ (config().splitPhi()), + reqphi_ (config().reqphi()), maxDeltaPhi_ (config().maxDeltaPhi()), maxNdiff_ (config().maxNdiff()), diag_ (config().diag()), @@ -235,12 +238,14 @@ namespace mu2e { //flag duplicated sequences so that we don't save them - flagDuplicates(chcol,timeCandidates,phiCandidates); + if (!reqphi_) + flagDuplicates(chcol,timeCandidates,phiCandidates); // Finally create the timeClusters tccol.reserve(64); - fillTCcol(timeCandidates,chcol,tccol); + if (!reqphi_) + fillTCcol(timeCandidates,chcol,tccol); fillTCcol(phiCandidates,chcol,tccol); if (diag_) fillDiag(timeCandidates, chcol, tccol); @@ -388,7 +393,7 @@ namespace mu2e { // Sort hits in ascending azimuthal angle auto& hits = tc.strawIdx_; sort(hits.begin(),hits.end(),[&chPhi](const int a, const int b){return chPhi[a] valid vector indices From d34073acce8f54467651c44c7de02b3aba88dd5e Mon Sep 17 00:00:00 2001 From: Richard Bonventre Date: Fri, 13 Feb 2026 15:36:44 -0600 Subject: [PATCH 142/174] Allow seeding KKLine with downstream instead of vertical --- Mu2eKinKal/src/KinematicLineFit_module.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Mu2eKinKal/src/KinematicLineFit_module.cc b/Mu2eKinKal/src/KinematicLineFit_module.cc index 11686a8200..3664cd7d64 100644 --- a/Mu2eKinKal/src/KinematicLineFit_module.cc +++ b/Mu2eKinKal/src/KinematicLineFit_module.cc @@ -134,6 +134,7 @@ namespace mu2e { fhicl::Table extSettings { Name("ExtensionSettings") }; fhicl::Table matSettings { Name("MaterialSettings") }; fhicl::OptionalTable Extrapolation { Name("Extrapolation") }; + fhicl::OptionalAtom fitDirection { Name("FitDirection"), Comment("Particle direction to fit, either \"upstream\" or \"downstream\"")}; }; public: @@ -159,6 +160,7 @@ namespace mu2e { int print_; float seedmom_; PDGCode::type fpart_; + TrkFitDirection fdir_; KKFIT kkfit_; // fit helper KKMaterial kkmat_; // material helper DMAT seedcov_; // seed covariance matrix @@ -195,6 +197,8 @@ namespace mu2e { config_(Mu2eKinKal::makeConfig(settings().fitSettings())), exconfig_(Mu2eKinKal::makeConfig(settings().extSettings())) { + std::string fdir; + if(settings().fitDirection(fdir))fdir_ = fdir; // collection handling for(const auto& seedtag : settings().modSettings().seedCollections()) { seedCols_.emplace_back(consumes(seedtag)); } produces(); @@ -355,6 +359,13 @@ namespace mu2e { KinKal::VEC4 pos(hseed._track.MinuitParams.A0, 0, hseed._track.MinuitParams.B0, hseed._t0._t0); XYZVectorF mom3(hseed._track.MinuitParams.A1, -1, hseed._track.MinuitParams.B1); mom3 = mom3.Unit()*seedmom_; + if (fdir_ == TrkFitDirection::FitDirection::downstream){ + if (mom3.z() < 0) + mom3 *= -1; + }else if (fdir_ == TrkFitDirection::FitDirection::upstream){ + if (mom3.z() > 0) + mom3 *= -1; + } KinKal::MOM4 mom(mom3.x(),mom3.y(),mom3.z(),mass_); auto seedtraj = KTRAJ(pos,mom,charge_,bnom,Mu2eKinKal::timeBounds(hseed.hits())); From 43b328f8b2fcbb7f1f8d9df00e2bc5d88f1fabf3 Mon Sep 17 00:00:00 2001 From: Ray Culbertson Date: Fri, 13 Feb 2026 16:39:40 -0600 Subject: [PATCH 143/174] move to p092 for adcm 9.1.0 --- .muse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.muse b/.muse index f7cae2b555..fc78e8aa51 100644 --- a/.muse +++ b/.muse @@ -1,5 +1,5 @@ # prefer to build with this environment -ENVSET p091 +ENVSET p092 # add Offline/bin to path PATH bin # recent commits can take enforce these flags From 8203d0f18d5e6c1453357bf2aacb5473102ccf01 Mon Sep 17 00:00:00 2001 From: echenard Date: Fri, 13 Feb 2026 17:41:37 -0600 Subject: [PATCH 144/174] More cleaning and put back dummp conditions_01.txt --- Analyses/src/CaloHitFinderInspect_module.cc | 2 +- Analyses/src/SConscript | 1 - Analyses/test/ConversionEnergyLoss.fcl | 4 ---- Analyses/test/TestTO.fcl | 4 ---- Analyses/test/cosmicFilter.fcl | 3 --- Analyses/test/extmon_uci_readback.fcl | 4 ---- Analyses/test/histforpabs.fcl | 4 ---- Analyses/test/hitDisplay.fcl | 3 --- Analyses/test/isoRPCtest.fcl | 4 ---- Analyses/test/psVacuum_readback.fcl | 4 ---- Analyses/test/readStoppedPis.fcl | 4 ---- Analyses/test/readback0.fcl | 4 ---- Analyses/test/stoppingTarget00.fcl | 4 ---- EventMixing/test/inspectMixed.fcl | 4 ---- EventMixing/test/inspectUnMixed.fcl | 4 ---- Mu2eG4/fcl/rantest.fcl | 4 ---- Mu2eG4/fcl/replayWithSkip.fcl | 4 ---- 17 files changed, 1 insertion(+), 60 deletions(-) diff --git a/Analyses/src/CaloHitFinderInspect_module.cc b/Analyses/src/CaloHitFinderInspect_module.cc index b3a8dfb604..acc629a4d7 100644 --- a/Analyses/src/CaloHitFinderInspect_module.cc +++ b/Analyses/src/CaloHitFinderInspect_module.cc @@ -16,7 +16,7 @@ #include "messagefacility/MessageLogger/MessageLogger.h" #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -#include "Offline/ConditionsService/inc/ConditionsHandle.hh" +//#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" diff --git a/Analyses/src/SConscript b/Analyses/src/SConscript index 2dd80430db..15718514b1 100644 --- a/Analyses/src/SConscript +++ b/Analyses/src/SConscript @@ -25,7 +25,6 @@ helper.make_plugins( [ mainlib, 'mu2e_ParticleID', 'mu2e_MCDataProducts', 'mu2e_RecoDataProducts', - 'mu2e_ConditionsService', 'mu2e_GeometryService', 'mu2e_CalorimeterGeom', 'mu2e_CosmicRayShieldGeom', diff --git a/Analyses/test/ConversionEnergyLoss.fcl b/Analyses/test/ConversionEnergyLoss.fcl index 89a88be41c..7bb674aef5 100644 --- a/Analyses/test/ConversionEnergyLoss.fcl +++ b/Analyses/test/ConversionEnergyLoss.fcl @@ -45,10 +45,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Analyses/test/TestTO.fcl b/Analyses/test/TestTO.fcl index 2561840547..4d29d28b51 100644 --- a/Analyses/test/TestTO.fcl +++ b/Analyses/test/TestTO.fcl @@ -33,10 +33,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common_v42_lght_1.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/Analyses/test/cosmicFilter.fcl b/Analyses/test/cosmicFilter.fcl index 7febf55b07..121a1c2424 100644 --- a/Analyses/test/cosmicFilter.fcl +++ b/Analyses/test/cosmicFilter.fcl @@ -33,9 +33,6 @@ services : { inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } diff --git a/Analyses/test/extmon_uci_readback.fcl b/Analyses/test/extmon_uci_readback.fcl index dc0c134f26..91c8b7058a 100644 --- a/Analyses/test/extmon_uci_readback.fcl +++ b/Analyses/test/extmon_uci_readback.fcl @@ -31,10 +31,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/histforpabs.fcl b/Analyses/test/histforpabs.fcl index d140ec26df..88b947f767 100644 --- a/Analyses/test/histforpabs.fcl +++ b/Analyses/test/histforpabs.fcl @@ -38,10 +38,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } # close of services block diff --git a/Analyses/test/hitDisplay.fcl b/Analyses/test/hitDisplay.fcl index 0593617f9d..d90f167029 100644 --- a/Analyses/test/hitDisplay.fcl +++ b/Analyses/test/hitDisplay.fcl @@ -37,9 +37,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } # close of services block diff --git a/Analyses/test/isoRPCtest.fcl b/Analyses/test/isoRPCtest.fcl index 57a9fd1ace..72ed314af6 100644 --- a/Analyses/test/isoRPCtest.fcl +++ b/Analyses/test/isoRPCtest.fcl @@ -43,10 +43,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } # close of services block diff --git a/Analyses/test/psVacuum_readback.fcl b/Analyses/test/psVacuum_readback.fcl index c595cefb65..d435ec7f3d 100644 --- a/Analyses/test/psVacuum_readback.fcl +++ b/Analyses/test/psVacuum_readback.fcl @@ -33,10 +33,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/readStoppedPis.fcl b/Analyses/test/readStoppedPis.fcl index 4da6713760..de8ec40921 100644 --- a/Analyses/test/readStoppedPis.fcl +++ b/Analyses/test/readStoppedPis.fcl @@ -33,10 +33,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : {inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt"} } diff --git a/Analyses/test/readback0.fcl b/Analyses/test/readback0.fcl index b0c6ccfeaa..88d18af99b 100644 --- a/Analyses/test/readback0.fcl +++ b/Analyses/test/readback0.fcl @@ -31,10 +31,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/Analyses/test/stoppingTarget00.fcl b/Analyses/test/stoppingTarget00.fcl index e6529fa4db..d9fa79551e 100644 --- a/Analyses/test/stoppingTarget00.fcl +++ b/Analyses/test/stoppingTarget00.fcl @@ -32,10 +32,6 @@ services : inputFile : "Offline/Mu2eG4/test/beamline_geom03a_readback.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/EventMixing/test/inspectMixed.fcl b/EventMixing/test/inspectMixed.fcl index a3bc635ef0..f497060a02 100644 --- a/EventMixing/test/inspectMixed.fcl +++ b/EventMixing/test/inspectMixed.fcl @@ -29,10 +29,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } } diff --git a/EventMixing/test/inspectUnMixed.fcl b/EventMixing/test/inspectUnMixed.fcl index 86a47e1690..bc01f90b78 100644 --- a/EventMixing/test/inspectUnMixed.fcl +++ b/EventMixing/test/inspectUnMixed.fcl @@ -29,10 +29,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } diff --git a/Mu2eG4/fcl/rantest.fcl b/Mu2eG4/fcl/rantest.fcl index 9ce17e3286..f3111d5407 100644 --- a/Mu2eG4/fcl/rantest.fcl +++ b/Mu2eG4/fcl/rantest.fcl @@ -31,10 +31,6 @@ services : inputfile : "Offline/Mu2eG4/geom/geom_common.txt" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } #Mu2eG4Helper : { } diff --git a/Mu2eG4/fcl/replayWithSkip.fcl b/Mu2eG4/fcl/replayWithSkip.fcl index f6c79d8c5e..5e2c35038f 100644 --- a/Mu2eG4/fcl/replayWithSkip.fcl +++ b/Mu2eG4/fcl/replayWithSkip.fcl @@ -38,10 +38,6 @@ services : inputFile : "Offline/Mu2eG4/geom/geom_common" } - ConditionsService : - { - } - GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" } Mu2eG4Helper : { } From 90a2cf6fd362e630f657d8529738539e8cd6a216 Mon Sep 17 00:00:00 2001 From: echenard Date: Fri, 13 Feb 2026 17:53:26 -0600 Subject: [PATCH 145/174] Actually added a dummy conditions_01.txt file --- ConditionsService/data/conditions_01.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 ConditionsService/data/conditions_01.txt diff --git a/ConditionsService/data/conditions_01.txt b/ConditionsService/data/conditions_01.txt new file mode 100644 index 0000000000..a798030ac4 --- /dev/null +++ b/ConditionsService/data/conditions_01.txt @@ -0,0 +1 @@ +#THIS IS A DEPRECATED FILE, DO NOT EDIT AND REMOVE ITS USE FROM YOUR SCRIPTS From dc4139cd3efceb2c9f158a060997af8fb3696341 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Sat, 14 Feb 2026 11:42:51 -0600 Subject: [PATCH 146/174] Allow for restricted cos(theta_z) in DIO generation --- EventGenerator/src/DIOGenerator_tool.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/EventGenerator/src/DIOGenerator_tool.cc b/EventGenerator/src/DIOGenerator_tool.cc index bb0c6091f0..2ba069231e 100644 --- a/EventGenerator/src/DIOGenerator_tool.cc +++ b/EventGenerator/src/DIOGenerator_tool.cc @@ -22,6 +22,8 @@ namespace mu2e { using Name=fhicl::Name; using Comment=fhicl::Comment; + fhicl::Atom czmin {Name("czmin") , Comment("Restrict cos(theta_z) minimum"), -1.}; + fhicl::Atom czmax {Name("czmax") , Comment("Restrict cos(theta_z) maximum"), 1.}; fhicl::DelegatedParameter spectrum{Name("spectrum"), Comment("Parameters for BinnedSpectrum)")}; }; typedef art::ToolConfigTable Parameters; @@ -29,6 +31,8 @@ namespace mu2e { explicit DIOGenerator(Parameters const& conf) : _pdgId(PDGCode::e_minus), _mass(GlobalConstantsHandle()->particle(_pdgId).mass()), + _czmin(conf().czmin()), + _czmax(conf().czmax()), _spectrum(BinnedSpectrum(conf().spectrum.get())) { // compute normalization @@ -64,7 +68,7 @@ namespace mu2e { void generate(std::unique_ptr& out, const IO::StoppedParticleF& stop) override; void finishInitialization(art::RandomNumberGenerator::base_engine_t& eng, const std::string&) override { - _randomUnitSphere = std::make_unique(eng); + _randomUnitSphere = std::make_unique(eng, _czmin, _czmax); _randSpectrum = std::make_unique(eng, _spectrum.getPDF(), _spectrum.getNbins()); } @@ -72,6 +76,7 @@ namespace mu2e { PDGCode::type _pdgId; double _mass; + double _czmin, _czmax; BinnedSpectrum _spectrum; std::unique_ptr _randomUnitSphere; From db18aee1a2e5526744e7c5ec48b1044f9bfde56e Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sat, 14 Feb 2026 18:01:09 -0600 Subject: [PATCH 147/174] updated CRV SiPM and Time calibration --- CRVConditions/inc/CRVOrdinal.hh | 7 +++ CRVReco/src/CrvCalibration_module.cc | 62 +++--------------------- CRVReco/src/CrvTimingStudies_module.cc | 67 +++++++++++++++++++++++--- 3 files changed, 75 insertions(+), 61 deletions(-) diff --git a/CRVConditions/inc/CRVOrdinal.hh b/CRVConditions/inc/CRVOrdinal.hh index aa151add69..02aa842d43 100644 --- a/CRVConditions/inc/CRVOrdinal.hh +++ b/CRVConditions/inc/CRVOrdinal.hh @@ -32,6 +32,13 @@ class CRVOrdinal : virtual public ProditionsEntity { CRVOrdinal(OnlineMap const& onMap, OfflineMap const& offMap) : ProditionsEntity(cxname), _onMap(onMap), _offMap(offMap) {} + // check, if a channel exists + bool onlineExists(std::uint16_t channel) const { + if (channel >= _onMap.size()) return false; + if (_onMap.at(channel).FEBchannel() >= CRVId::nChanPerFEB) return false; + return true; + } + // online numbering triplet for an offline channel number const CRVROC& online(std::uint16_t channel) const { if (_onMap.at(channel).FEBchannel() >= CRVId::nChanPerFEB) { diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index de324e7ec1..24895e30f1 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -52,7 +52,7 @@ namespace mu2e fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; - //fhicl::Atom peakRatioTolerance{Name("peakRatioTolerance"), Comment("allowed deviation of the ratio between 1PE peak and 2PE peak from 2.0"), 0.2}; + fhicl::Atom maxFitDifference{Name("maxFitDifference"), Comment("maximum Difference between the TSpectrum peak and the fitted peak. Indicates fit problems."), 100.0}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; @@ -62,8 +62,6 @@ namespace mu2e void analyze(const art::Event& e); void beginRun(const art::Run&); void endJob(); -// template -// bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak); bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak); private: @@ -76,7 +74,7 @@ namespace mu2e int _spectrumNPeaks; double _spectrumPeakSigma; double _spectrumPeakThreshold; -// double _peakRatioTolerance; + double _maxFitDifference; std::string _tmpDBfileName; std::vector _calibHistsPulseArea; std::vector _calibHistsPulseHeight; @@ -85,9 +83,6 @@ namespace mu2e std::vector _pedestals; std::vector _timeOffsets; - - std::pair _firstRunSubrun; - std::pair _lastRunSubrun; }; @@ -106,7 +101,7 @@ namespace mu2e _spectrumNPeaks(conf().spectrumNPeaks()), _spectrumPeakSigma(conf().spectrumPeakSigma()), _spectrumPeakThreshold(conf().spectrumPeakThreshold()), -// _peakRatioTolerance(conf().peakRatioTolerance()), + _maxFitDifference(conf().maxFitDifference()), _tmpDBfileName(conf().tmpDBfileName()) { } @@ -150,13 +145,12 @@ namespace mu2e treePedestal->Branch("channel", &channel); treePedestal->Branch("pedestal", &pedestal); -// std::array functions={TF1("calibPeak1","gaus"), TF1("calibPeak2","gaus"), TF1("calibPeak3","gaus")}; //only need to fit three peaks TF1 function("calibPeak","gaus"); - TSpectrum spectrum(_spectrumNPeaks); //any value of 3 or less results in a "Peak buffer full" warning. + TSpectrum spectrum(_spectrumNPeaks); std::ofstream outputFile; outputFile.open(_tmpDBfileName); - outputFile<<"TABLE CRVSiPM "<<_firstRunSubrun.first<<":"<<_firstRunSubrun.second<<"-"<<_lastRunSubrun.first<<":"<<_lastRunSubrun.second<(event.run(),event.subRun()); } - _lastRunSubrun=std::pair(event.run(),event.subRun()); for(auto iter=crvRecoPulseCollection->begin(); iter!=crvRecoPulseCollection->end(); ++iter) { @@ -269,49 +259,11 @@ namespace mu2e hist->Fit(&function, "QR"); SPEpeak = function.GetParameter(1); + if(fabs(SPEpeak-x)>_maxFitDifference) return false; + if(SPEpeak - bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, std::array &functions, double &SPEpeak, double minPeak) - { - if(hist->GetEntries()<_minHistEntries) return false; //not enough data - - size_t nPeaks = spectrum.Search(hist,_spectrumPeakSigma,"nodraw",_spectrumPeakThreshold); - if(nPeaks==0) return false; - - //peaks are returned sorted by Y - double *peaksX = spectrum.GetPositionX(); - std::vector fittedPeaks; - for(size_t iPeak=0; iPeakFindBin(x*_fitRangeStart)==hist->FindBin(x*_fitRangeEnd)) continue; //fit range start/end are in the same bin - functions[iPeak].SetRange(x*_fitRangeStart,x*_fitRangeEnd); - functions[iPeak].SetParameter(1,x); - hist->Fit(&functions[iPeak], "QR+"); - fittedPeaks.emplace_back(functions[iPeak].GetParameter(1)); - } - if(fittedPeaks.size()==0) return false; - - int peakToUse=-1; - //only need to test two highest peaks (=first two entries in vector) - //one of the peaks could be due to baseline fluctuations - for(size_t iPeak=0; iPeak crvRecoPulsesModuleLabel{ Name("crvRecoPulseModuleLabel"), Comment("CrvRecoPulse Label")}; fhicl::Atom PEthreshold{ Name("PEthreshold"), Comment("PE threshold")}; + fhicl::Atom removeTimeOffsets{ Name("removeTimeOffsets"), Comment("remove time offsets added by reco")}; }; using Parameters = art::EDAnalyzer::Table; @@ -61,16 +63,19 @@ namespace mu2e private: std::string _crvRecoPulsesModuleLabel; double _PEthreshold; + bool _removeTimeOffsets; std::map,TH1F*> _histTimeDiffs; ProditionsHandle _crvChannelMap_h; + ProditionsHandle _calib_h; }; CrvTimingStudies::CrvTimingStudies(const Parameters& conf) : art::EDAnalyzer{conf}, _crvRecoPulsesModuleLabel(conf().crvRecoPulsesModuleLabel()), - _PEthreshold(conf().PEthreshold()) + _PEthreshold(conf().PEthreshold()), + _removeTimeOffsets(conf().removeTimeOffsets()) { } @@ -92,6 +97,54 @@ namespace mu2e if(!event.getByLabel(_crvRecoPulsesModuleLabel,"",crvRecoPulseCollection)) return; auto const& crvChannelMap = _crvChannelMap_h.get(event.id()); + auto const& calib = _calib_h.get(event.id()); + + static bool firstEvent=true; + if(firstEvent) + { + firstEvent=false; + + //store channel map, pedestals and calibration constants in the file, + //so that it can later be used to write a full calibration set + //of pedestals, calib consts, and time offsets + + GeomHandle CRS; + const std::vector > &counters = CRS->getAllCRSScintillatorBars(); + art::ServiceHandle tfs; + + TTree *treeChannelMap = tfs->make("channelMap","channelMap"); + size_t channel; + int roc, feb, febChannel; + treeChannelMap->Branch("channel", &channel); + treeChannelMap->Branch("roc", &roc); + treeChannelMap->Branch("feb", &feb); + treeChannelMap->Branch("febChannel", &febChannel); + + for(channel=0; channelFill(); + } + + TTree *treeCalib = tfs->make("crvCalib","crvCalib"); + double pedestal, calibPulseHeight, calibPulseArea; + treeCalib->Branch("channel", &channel); + treeCalib->Branch("pedestal", &pedestal); + treeCalib->Branch("calibPulseHeight", &calibPulseHeight); + treeCalib->Branch("calibPulseArea", &calibPulseArea); + + for(channel=0; channelFill(); + } + } int previousOfflineChannel=-1; std::map > fpgaTimes; @@ -113,7 +166,12 @@ namespace mu2e uint16_t febChannel = onlineChannel.FEBchannel(); uint16_t fpgaIndex = ((ROC-1)*CRVId::nFEBPerROC*CRVId::nChanPerFEB+(feb-1)*CRVId::nChanPerFEB+febChannel)/(CRVId::nChanPerFEB/CRVId::nFPGAPerFEB); -// uint16_t fpgaIndex = ((ROC-1)*CRVId::nFEBPerROC*CRVId::nChanPerFEB+(feb-1)*CRVId::nChanPerFEB+febChannel)/(CRVId::nChanPerFEB/8); + + if(_removeTimeOffsets) //remove time offsets introduced during reconstruction to see the "pure" time differences, e.g. to generate new time calibration tables + { + double timeOffset = calib.timeOffset(offlineChannel); + recoPulseTime-=timeOffset; + } fpgaTimes[fpgaIndex].push_back(recoPulseTime); } @@ -140,10 +198,7 @@ namespace mu2e art::ServiceHandle tfs; _histTimeDiffs[histIndex] = tfs->make(Form("fpgaTimeDiff_%i_%i",fpga1->first,fpga2->first), Form("Time Diffs between FGPAs %i and %i;time difference [ns];Counts",fpga1->first,fpga2->first), - 100,-50,50); -// _histTimeDiffs[histIndex] = tfs->make(Form("AFETimeDiff_%i_%i",fpga1->first,fpga2->first), -// Form("Time Diffs between AFEs %i and %i;time difference [ns];Counts",fpga1->first,fpga2->first), -// 100,-50,50); + 300,-150,150); } double timeDiff=fpga1->second-fpga2->second; From 99412e979bef3de4d962d5abd16a14425dea6515 Mon Sep 17 00:00:00 2001 From: Iuri Oksuzian Date: Sat, 14 Feb 2026 19:20:17 -0600 Subject: [PATCH 148/174] Add empty collection guard in TimeAndPhiClusterFinder::findTimePeaks --- TrkPatRec/src/TimeAndPhiClusterFinder_module.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc b/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc index fcbfbd6c44..10c4bc19cd 100644 --- a/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc +++ b/TrkPatRec/src/TimeAndPhiClusterFinder_module.cc @@ -267,7 +267,7 @@ namespace mu2e { } auto sortFcn = [&chcol](unsigned i1, unsigned i2){return chcol[i1].correctedTime() < chcol[i2].correctedTime();}; sort(chGood.begin(),chGood.end(),sortFcn); - + if(chGood.empty()) return; // Fill the time histogram with hit corrected times (add buffer to hist boundaries). Add calo hits if requested float tmax = chcol[chGood.back()].correctedTime() + 4*maxTimeDT_; From 23a682388e36258c60172ef00d050e4c26875051 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sun, 15 Feb 2026 00:25:01 -0600 Subject: [PATCH 149/174] using actual CRV KPP calib constants --- .../data/calib_extracted_20260214.txt | 4100 +++++++++++++++++ .../data/status_extracted_20260214.txt | 10 + .../fcl/EventDisplayExtractedCrvOnly.fcl | 6 +- 3 files changed, 4113 insertions(+), 3 deletions(-) create mode 100644 CRVConditions/data/calib_extracted_20260214.txt create mode 100644 CRVConditions/data/status_extracted_20260214.txt diff --git a/CRVConditions/data/calib_extracted_20260214.txt b/CRVConditions/data/calib_extracted_20260214.txt new file mode 100644 index 0000000000..d1d1a85d48 --- /dev/null +++ b/CRVConditions/data/calib_extracted_20260214.txt @@ -0,0 +1,4100 @@ +TABLE CRVSiPM +#channel,pedestal,calibPulseHeight,calibPulseArea +0,2037.6,18.1472,535.761 +1,2043.79,15.4787,443.857 +2,2044.18,18.5364,538.844 +3,2053.86,16.3699,464.341 +4,2056.01,19.5205,526.858 +5,2051.25,16.8603,465.98 +6,2049.14,17.9909,476.984 +7,2039.7,16.4851,441.712 +8,2037.68,18.9057,540.808 +9,2039.09,16.3066,467.38 +10,2052.27,19.0443,549.861 +11,2061.3,17.2745,492.273 +12,2029.24,19.0483,548.758 +13,2042.74,16.5823,471.871 +14,2037.73,18.9138,536.526 +15,2041.45,15.2902,440.88 +16,2045.63,18.51,516.476 +17,2028.34,17.6383,520.355 +18,2027.78,19.3541,565.813 +19,2049.09,17.0971,509.498 +20,2047.82,20.3552,577.345 +21,2060.1,17.6319,505.198 +22,2052.6,20.5236,565.058 +23,2049.19,17.9582,512.712 +24,2042.09,20.4211,574.549 +25,2046.42,16.8462,484.486 +26,2038.4,19.8149,564.594 +27,2049.08,17.1644,494.472 +28,2064.7,19.8679,566.867 +29,2048.79,16.5371,474.892 +30,2034.48,18.6275,545.439 +31,2067.1,16.9101,479.623 +32,2035.8,19.5845,571.872 +33,2039.14,16.8292,472.187 +34,2040.2,20.3571,576.202 +35,2030.8,17.7024,488.783 +36,2050.73,19.3713,554.749 +37,2047.83,17.9607,491.762 +38,2045.73,20.1958,563.538 +39,2051.3,16.2849,451.328 +40,2030.94,18.8597,546.541 +41,2051.69,16.0066,441.151 +42,2052.5,18.5387,548.448 +43,2046.49,15.9121,444.807 +44,2059.93,18.734,537.054 +45,2038.12,15.8831,430.115 +46,2043.75,19.3911,546.118 +47,2035.2,15.684,439.207 +48,2042.58,17.5375,489.407 +49,2044.88,18.2219,501.129 +50,2041.57,18.1364,507.837 +51,2041.97,16.9653,482.21 +52,2038.2,17.1285,495.512 +53,2042.35,18.5063,510.665 +54,2038.73,17.5482,491.585 +55,2053.35,16.9856,467.315 +56,2053.4,16.6798,486.687 +57,2054.01,16.5832,479.822 +58,2068.36,16.655,487.129 +59,2040.59,17.395,496.417 +60,2035.27,17.7033,503.555 +61,2047.45,17.1725,490.003 +62,2045.02,17.2118,502.523 +63,2046.1,16.8737,471.917 +64,2046.94,16.7257,491.377 +65,2058.71,17.8555,500.41 +66,2039.89,16.8932,485.624 +67,2032.94,17.7972,512.589 +68,2053.4,17.8796,488.612 +69,2053.97,18.2664,516.144 +70,2048.93,17.2541,470.226 +71,2038.01,17.9413,491.263 +72,2037.75,18.2258,509.046 +73,2049.65,19.8462,560.225 +74,2040.71,17.0995,489.898 +75,2062.41,19.6271,556.072 +76,2054.26,16.8768,468.72 +77,2051.75,19.8408,559.856 +78,2044.25,17.6376,498.608 +79,2056.5,19.1006,550.746 +80,2039.36,19.3462,544.082 +81,2045.06,15.1815,437.397 +82,2058.77,18.3978,541.008 +83,2038.67,15.3933,446.53 +84,2042.05,19.1489,544.283 +85,2042.03,14.4017,422.664 +86,2034.73,19.3333,549.3 +87,2050.66,14.654,431.046 +88,2035.96,18.9516,562.873 +89,2061.02,16.3728,500.911 +90,2045.67,20.174,578.514 +91,2054.34,15.9678,464.165 +92,2038.77,18.4974,538.201 +93,2063.12,15.1806,446.114 +94,2039.34,20.2955,562.131 +95,2049.3,15.6091,458.918 +96,2054.01,18.3114,516.467 +97,2053.75,16.6143,478.7 +98,2047.35,17.7478,507.148 +99,2054.07,16.3062,473.249 +100,2056.1,17.7472,504.745 +101,2036.65,17.2488,481.531 +102,2069.19,18.5811,518.533 +103,2048.64,16.8755,473.112 +104,2029.12,16.9097,495.473 +105,2030.95,14.7098,424.419 +106,2047.23,17.8296,512.184 +107,2052.39,14.7895,434.022 +108,2059.45,16.8575,493.837 +109,2037.88,14.2679,421.163 +110,2038.31,18.1561,509.412 +111,2067.69,14.224,411.912 +112,2054.72,17.0236,478.363 +113,2061.01,17.1266,495.628 +114,2047.41,17.2445,483.934 +115,2054.5,17.2722,481.936 +116,2049.23,17.3768,483.883 +117,2048.25,17.7403,482.3 +118,2061.88,17.5795,484.059 +119,2061.34,17.3955,477.501 +120,2044.8,18.0201,485.678 +121,2052.41,18.6171,518.283 +122,2057.26,17.9772,493.713 +123,2046.96,18.3839,520.263 +124,2045.15,16.8616,476.527 +125,2043.16,18.9485,531.246 +126,2056.59,18.0306,489.638 +127,2052.71,17.7528,508.161 +128,2047.11,18.6656,539.929 +129,2046.46,15.8353,442.142 +130,2038.47,19.3347,521.202 +131,2046.23,15.3179,419.007 +132,2027.54,19.1768,543.836 +133,2039.84,15.7246,438.56 +134,2043.03,17.792,465.717 +135,2041.9,14.2398,375.704 +136,2042.06,18.942,545.016 +137,2020.82,15.4469,450.238 +138,2039.38,19.3865,548.091 +139,2033.24,15.5395,451.158 +140,2054.37,19.0322,525.128 +141,2048.84,15.3708,420.579 +142,2035.33,19.3796,539.429 +143,2035.55,15.5457,430.016 +144,2050.58,18.9918,549.595 +145,2040.52,17.3562,487.455 +146,2049.56,19.7293,545.561 +147,2051.97,17.4513,492.812 +148,2039.48,18.845,536.477 +149,2037.79,15.8536,452.44 +150,2054.96,19.5705,536.763 +151,2054.54,17.2716,473.507 +152,2054.62,18.8556,538.177 +153,2050.95,16.0372,476.677 +154,2052.99,17.7983,520.533 +155,2041.84,16.2361,468.366 +156,2047.71,19.4619,540.97 +157,2037.97,16.1107,469.206 +158,2045.57,20.0152,555.653 +159,2067.07,16.3047,454.637 +160,2042.94,18.0213,508.234 +161,2057.75,16.9318,476.847 +162,2063.93,18.9222,526.799 +163,2050.87,15.5075,451.087 +164,2049.44,18.6911,519.19 +165,2053.27,16.2366,463.878 +166,2048.97,19.4087,515.138 +167,2040.69,15.3648,418.171 +168,2054.33,19.112,532.373 +169,2043.14,16.1872,460.547 +170,2039.17,19.245,533.008 +171,2053.63,16.3359,467.019 +172,2052.92,18.3348,525.257 +173,2046.85,16.0537,457.521 +174,2057.52,20.0394,545.979 +175,2045.88,16.7451,465.495 +176,2044.65,16.773,476.349 +177,2024.78,17.2257,487.999 +178,2063.18,16.0139,466.951 +179,2040.22,17.3244,495.507 +180,2047.26,16.7576,475.277 +181,2047.29,17.8166,493.778 +182,2045.28,17.4261,479.822 +183,2061.47,17.7338,493.233 +184,2039.14,18.232,500.026 +185,2033.57,15.4195,455.382 +186,2043.25,16.6465,474.289 +187,2034.19,16.3838,476.361 +188,2052.77,17.6071,489.845 +189,2036.7,16.3999,464.432 +190,2058.16,17.7609,484.541 +191,2064.38,16.5617,454.237 +192,2044.68,21.0347,602.173 +193,2021.42,16.504,469.553 +194,2036.53,20.8919,609.297 +195,2013.23,14.9675,454.969 +196,2030.89,21.8835,609.749 +197,2032.52,16.0599,461.834 +198,2046.13,20.2789,584.83 +199,2035.35,15.5253,460.569 +200,2049.68,21.6931,608.389 +201,2055.61,15.7332,467.575 +202,2054.89,20.2135,575.963 +203,2048.71,15.6039,464.347 +204,2054.97,19.5205,558.459 +205,2051.82,16.7839,487.529 +206,2062.18,20.0739,577.425 +207,2035.95,15.3872,457.891 +208,2040.47,18.0898,501.013 +209,2048.16,17.4849,508.114 +210,2034.09,17.7122,497.121 +211,2062.56,17.6658,511.652 +212,2055.81,18.4928,504.455 +213,2039.41,16.4061,485.872 +214,2049.43,19.4005,522.032 +215,2039.1,16.1705,469.82 +216,2054.11,19.2698,512.278 +217,2041.83,16.8206,490.659 +218,2041.44,18.8944,520.021 +219,2050.26,17.1987,498.799 +220,2046.21,18.1786,500.417 +221,2044.3,16.2049,487.101 +222,2048.25,18.2908,504.401 +223,2049.24,17.6193,507.162 +224,2039.39,16.3005,463.27 +225,2034.62,15.2189,432.925 +226,2024.72,17.1078,478.207 +227,2036.87,15.1656,442.533 +228,2035.43,16.0239,463.737 +229,2054.81,14.5625,430.54 +230,2044.9,16.424,443.011 +231,2041.44,15.2875,432.708 +232,2036.74,16.0492,448.002 +233,2055.65,15.0132,437.147 +234,2054.46,15.5103,444.155 +235,2030.01,14.3731,429.134 +236,2044.72,17.2267,468.949 +237,2035.97,14.0965,410.686 +238,2048.48,15.0132,440.706 +239,2049.51,14.9194,427.57 +240,2043.27,17.3771,493.131 +241,2040.34,18.8647,558.359 +242,2047.95,17.7019,493.825 +243,2060.82,19.5074,559.746 +244,2031.26,17.8356,492.742 +245,2045.19,19.633,555.659 +246,2050.02,17.7893,492.161 +247,2045.85,19.0961,551.252 +248,2036.64,18.0813,501.316 +249,2037.68,20.0254,571.138 +250,2070.68,16.9867,487.759 +251,2045.31,19.1109,566.109 +252,2043.55,16.5487,467.625 +253,2047.86,19.4555,559.303 +254,2060.1,16.4002,469.483 +255,2040.74,20.4426,578.504 +256,2039.82,16.0852,473.062 +257,2057.77,15.2387,419.45 +258,2034.85,15.5994,458.989 +259,2040.38,14.8208,382.841 +260,2046.12,15.7318,447.524 +261,2061.72,14.9837,397.215 +262,2021.8,15.5202,405.763 +263,2038.85,14.9044,366.84 +264,2033.1,15.7726,477.968 +265,2043.19,15.567,419.226 +266,2056.35,16.2853,479.889 +267,2041.49,15.1894,422.466 +268,2045.71,15.5291,447.48 +269,2041.46,14.2736,394.309 +270,2049.98,16.2599,463.156 +271,2047.4,14.7202,377.939 +272,2041.56,15.1468,429.041 +273,2047.69,16.0001,453.521 +274,2051.7,14.7286,431.917 +275,2031.38,16.108,456.489 +276,2035.9,14.9316,422.999 +277,2054.86,15.5165,439.412 +278,2031.4,14.9771,422.148 +279,2039.24,17.0127,464.867 +280,2038.34,15.8382,456.63 +281,2055.06,15.9213,450.253 +282,2044.62,15.7207,468.855 +283,2039.57,16.7096,461.118 +284,2033.74,14.5799,395.986 +285,2047.8,17.1117,465.84 +286,2034.27,15.1246,426.52 +287,2042,16.915,460.137 +288,2038.28,14.7603,429.776 +289,2064.76,16.3699,478.463 +290,2047.5,14.6165,427.123 +291,2041.99,16.3126,474.964 +292,2039.31,13.9684,393.356 +293,2042.15,16.2832,462.875 +294,2061.18,14.5204,405.534 +295,2044.39,16.3096,443.303 +296,2041.08,14.7646,423.565 +297,2059.35,16.6088,480.764 +298,2056.64,14.8632,439.057 +299,2041.67,16.1819,474.497 +300,2046,14.8817,430.63 +301,2045.81,16.9529,482.886 +302,2041.94,14.8111,418.944 +303,2047.65,16.1844,443.516 +304,2047.26,18.168,523.182 +305,2038.36,13.0969,383.679 +306,2035.59,17.6605,526.116 +307,2025.59,12.8126,385.065 +308,2031.71,17.8666,503.653 +309,2056.74,12.8665,368.899 +310,2058.11,17.2844,493.258 +311,2048,12.9923,373.85 +312,2048.48,17.7781,518.94 +313,2038.97,13.315,386.324 +314,2045.29,17.8682,561.902 +315,2045.01,13.3559,408.425 +316,2052.05,17.6483,519.367 +317,2042.07,13.1114,382.122 +318,2048.42,18.1515,516.877 +319,2040.27,14.2338,408.409 +320,2035.5,16.2667,479.687 +321,2055.97,15.4751,442.254 +322,2029,16.2987,481.582 +323,2060.11,15.8749,450.972 +324,2042.88,16.1802,468.385 +325,2047.97,14.7348,411.302 +326,2050.56,15.8767,462.193 +327,2044.76,16.5569,455.335 +328,2046.24,17.0959,532.856 +329,2039.26,15.2734,440.474 +330,2050.42,17.0588,561.264 +331,2044.68,16.2421,462.6 +332,2048.79,15.9382,490.145 +333,2047.86,16.0472,454.637 +334,2046.32,16.2691,485.25 +335,2051,16.3056,464.254 +336,2043.9,15.9554,500.745 +337,2038.06,14.887,431.08 +338,2047.11,16.0739,488.496 +339,2047.81,14.642,420.871 +340,2044.84,15.417,439.577 +341,2034.27,14.6235,419.735 +342,2046.14,15.539,447.817 +343,2046.67,14.5291,417.962 +344,2041.91,15.8494,452.794 +345,2041.28,14.2283,417.556 +346,2050.83,15.389,458.433 +347,2065.88,14.092,416.478 +348,2033.89,16.4173,462.624 +349,2043.99,14.297,415.017 +350,2032.51,16.2234,475.294 +351,2044.45,14.6393,418.946 +352,2039.01,14.4208,428.288 +353,2041.98,15.1301,428.303 +354,2055.12,15.1566,437.746 +355,2051.15,14.8614,428.579 +356,2040.91,14.3972,414.719 +357,2036.03,15.1706,413.671 +358,2035.34,15.2086,438.604 +359,2039.86,14.7404,411.035 +360,2037.26,15.7651,512.89 +361,2053.67,15.1628,438.444 +362,2053.17,15.7087,548.483 +363,2038.14,14.7837,428.274 +364,2052.96,15.3554,460.742 +365,2034.97,14.5649,419.958 +366,2052.48,16.0333,488.545 +367,2041.82,14.8826,415.08 +368,2050.25,15.489,444.637 +369,2056.18,16.0366,457.182 +370,2038.37,15.0844,443.463 +371,2045.12,15.6391,446.765 +372,2037.9,15.3501,438.319 +373,2052.94,15.8117,447.7 +374,2011.87,16.3917,460.921 +375,2033.03,16.1701,444.25 +376,2034.74,16.0387,456.87 +377,2042.11,16.1792,459.751 +378,2051.88,15.2926,441.72 +379,2050.86,16.5266,464.923 +380,2058.28,16.2411,455.703 +381,2044.27,15.617,443.54 +382,2033.63,15.5566,443.623 +383,2049.51,16.0095,449.477 +384,2049.89,15.266,434.303 +385,2050.9,15.5717,437.013 +386,2055.56,14.88,424.705 +387,2034.98,15.5122,426.15 +388,2052.45,15.1651,424.252 +389,2052.91,15.8397,418.978 +390,2065.93,14.2389,359.218 +391,2053.08,16.0009,393.57 +392,2049.45,15.6726,480.96 +393,2040.44,15.9811,453.255 +394,2060.91,15.8188,448.953 +395,2050.47,15.7543,446.701 +396,2027.16,14.606,423.07 +397,2041.3,15.5412,431.595 +398,2045.11,15.1722,428.562 +399,2044.94,15.9414,420.35 +400,2038.47,17.9342,528.081 +401,2061.23,19.799,551.586 +402,2055.22,18.7616,545.55 +403,2043.61,18.8072,536.401 +404,2044.9,17.9209,495.353 +405,2055.38,19.7815,550.649 +406,2061.66,18.4797,504.618 +407,2057.54,18.6458,529.18 +408,2052.98,19.1778,555.013 +409,2033.24,18.5124,533.322 +410,2060.29,18.8876,530.649 +411,2049.42,18.6707,527.561 +412,2056.5,18.6729,508.568 +413,2051.53,18.2299,524.78 +414,2047.26,19.013,523.313 +415,2051.37,18.3556,515.363 +416,2046.53,17.9425,528.353 +417,2042.31,15.0199,438.612 +418,2050.62,17.6382,520.082 +419,2037.67,14.7688,430.313 +420,2060.69,17.7803,513.939 +421,2041.37,14.7522,420.092 +422,2064.91,19.4159,537.314 +423,2061.47,14.7334,378.076 +424,2046.26,19.9113,558.091 +425,2041.91,14.8198,432.333 +426,2059.67,19.8421,564.597 +427,2050.28,14.9661,442.65 +428,2066.08,18.4769,518.358 +429,2034.39,14.6895,416.641 +430,2039.84,19.32,542.409 +431,2055.05,15.3154,420.427 +432,2050.9,14.915,442.186 +433,2050.35,15.278,447.006 +434,2046.68,14.4031,430.295 +435,2039.05,15.0839,437.966 +436,2052.04,14.4484,425.119 +437,2047.69,15.6432,446.425 +438,2038,15.9829,452.375 +439,2038.72,15.6073,441.382 +440,2042.8,14.2641,418.307 +441,2054.14,16.9739,477.343 +442,2038.75,14.8015,430.17 +443,2043.21,15.683,454.55 +444,2045.17,14.1565,407.653 +445,2040.2,15.6058,431.55 +446,2058.85,14.9631,436.218 +447,2048.96,15.2224,426.664 +448,2054.26,16.6538,467.062 +449,2048.57,14.8711,426.148 +450,2052.2,17.4754,485.652 +451,2056.74,15.1528,439.15 +452,2042.54,16.7013,457.829 +453,2056.74,14.4937,426.932 +454,2045.52,16.1152,454.161 +455,2033.15,15.0971,431.65 +456,2041.96,16.6521,471.849 +457,2057.59,15.0402,439.195 +458,2028.47,15.812,463.647 +459,2045.71,15.0017,438.148 +460,2056.87,17.239,478.268 +461,2036.49,14.5971,427.394 +462,2056.02,16.449,464.698 +463,2060.14,15.2552,426.86 +464,2047.78,16.2682,480.919 +465,2041.63,15.3745,430.641 +466,2034.1,17.4093,514.94 +467,2053.75,15.6558,444.845 +468,2037.44,16.5186,463.998 +469,2044.46,15.9278,436.005 +470,2044.03,17.1553,470.377 +471,2049.89,15.2926,429.391 +472,2061.27,17.312,480.735 +473,2054.24,15.508,445.502 +474,2063.01,16.7965,484.239 +475,2061.37,15.4655,440.298 +476,2064.91,16.4465,464.592 +477,2046.95,15.307,429.328 +478,2035.65,17.0608,467.875 +479,2049.55,16.114,449.085 +480,2050.35,16.4342,455.966 +481,2052.94,16.2619,462.785 +482,2051.18,15.4661,429.635 +483,2058.76,16.5047,464.784 +484,2056.24,15.4215,432.961 +485,2053.87,16.0741,450.574 +486,2056.95,15.3985,431.449 +487,2048.59,15.5348,447.156 +488,2059.06,15.1731,435.326 +489,2049.44,15.3604,451.141 +490,2036.53,16.1862,445.431 +491,2051.7,16.7796,474.99 +492,2042.8,15.9571,435.341 +493,2047.68,17.0647,471.684 +494,2067.92,15.0415,420.342 +495,2048.91,15.9399,452.504 +496,2053.11,15.227,445.333 +497,2053.32,16.5007,473.039 +498,2044.45,15.7051,446.879 +499,2058.07,16.6199,471.521 +500,2042.98,15.4344,434.767 +501,2058.01,16.7861,472.977 +502,2043.37,16.3522,453.787 +503,2041.17,16.4768,457.814 +504,2032.23,15.5404,448.558 +505,2035.43,16.7127,472.949 +506,2035.44,15.163,441.709 +507,2037.67,15.6607,462.133 +508,2032.89,15.9482,446.559 +509,2030.24,16.9846,478.056 +510,2038.24,15.394,444.445 +511,2045.73,17.5203,497.137 +512,2047.52,15.7911,462.844 +513,2048.17,14.641,412.092 +514,2040.23,14.9338,418.643 +515,2048.93,13.7099,387.703 +516,2032.16,15.2438,426.534 +517,2050.91,14.5409,409.502 +518,2058.24,14.5581,371.1 +519,2052.5,14.5856,366.057 +520,2041.63,14.4309,418.265 +521,2054.49,14.2279,412.447 +522,2056.24,15.0219,428.775 +523,2049.79,14.1404,402.886 +524,2052.64,14.9272,406.054 +525,2043.88,14.8495,410.841 +526,2053.36,15.8263,425.976 +527,2046.95,13.9669,396.971 +528,2036.64,16.7626,475.535 +529,2049.74,14.6928,424.919 +530,2030.53,16.9536,490.077 +531,2063.02,15.6675,447.191 +532,2038.67,16.4145,449.527 +533,2050.43,14.5852,417.612 +534,2037.67,17.0521,467.177 +535,2039.75,16.0204,431.763 +536,2046.01,16.9502,472.506 +537,2033.97,16.0924,454.426 +538,2066.39,17.1723,510.133 +539,2057,15.1666,436.681 +540,2072.76,16.6353,446.761 +541,2059.8,15.2935,422.872 +542,2031.7,16.6585,458.502 +543,2053.28,15.1566,408.431 +544,2048.77,15.2063,432.617 +545,2059.15,15.4911,434.549 +546,2032.35,15.3483,446.175 +547,2046.22,14.7925,435.531 +548,2028.81,15.2244,422.476 +549,2054.69,14.972,405.829 +550,2031.59,15.9781,421.772 +551,2051.58,14.7521,404.944 +552,2054.79,15.4934,465.49 +553,2052.03,15.3261,435.442 +554,2046.72,16.39,475.124 +555,2056.66,14.4877,423.351 +556,2037.04,15.3778,434.856 +557,2050.49,15.3985,433.869 +558,2055.68,15.742,437.689 +559,2057.79,15.1556,415.366 +560,2054.52,17.1991,508.914 +561,2047.33,15.2857,438.509 +562,2051.26,16.8849,541.588 +563,2049.9,15.1432,429.374 +564,2030.92,17.1886,491.57 +565,2054.62,14.9635,428.704 +566,2050.5,16.986,470.945 +567,2051.77,15.281,425.098 +568,2053.46,17.9923,520.742 +569,2045.88,15.4636,435.12 +570,2048.69,16.1041,478.325 +571,2061.07,14.8006,434.502 +572,2055.99,16.6916,474.945 +573,2042.83,14.6256,416.498 +574,2056.84,16.7907,478.919 +575,2052.51,15.2141,427.654 +576,2034.34,15.3165,440.691 +577,2049.02,15.4249,450.955 +578,2055.44,16.0714,462.771 +579,2038.36,16.0009,462.021 +580,2041.58,15.8567,442.852 +581,2040.2,15.4216,440.782 +582,2042.99,16.1292,448.872 +583,2065.84,16.1637,457.282 +584,2038.53,15.6743,450.064 +585,2045.62,15.7874,453.636 +586,2060.78,15.3278,447.419 +587,2045.86,16.0997,463.096 +588,2043.68,15.4499,418.846 +589,2055.4,15.5896,451.94 +590,2023.94,14.7331,413.578 +591,2046.33,16.032,450.82 +592,2043.89,15.5148,450.813 +593,2056.63,15.4543,443.97 +594,2045.41,14.8938,433.796 +595,2039.63,15.1784,438.491 +596,2054.27,14.7295,424.735 +597,2043.64,14.9674,432.971 +598,2046.45,15.3643,435.86 +599,2042.58,15.2204,429.937 +600,2054.19,15.7155,453.539 +601,2044.64,15.36,435.688 +602,2059.67,15.5076,446.967 +603,2043.25,15.7938,453.419 +604,2052.95,14.893,421.657 +605,2033.68,14.2343,425.295 +606,2036.01,13.9909,384.43 +607,2040.03,15.9712,446.946 +608,2032.95,12.2844,353.587 +609,2038.53,16.7465,510.977 +610,2048.72,12.0518,414.626 +611,2046.44,16.8473,475.94 +612,2021.66,12.9526,390.371 +613,2045.39,16.5482,460.996 +614,2037.46,13.4141,383.163 +615,2065.06,16.8329,489.271 +616,2051.54,12.8845,373.447 +617,2051.69,17.4527,518.92 +618,2034.39,13.0999,390.832 +619,2039.62,16.0052,471.38 +620,2051.15,12.4589,360.984 +621,2052.78,16.5887,463.902 +622,2041.02,12.976,359.92 +623,2058.74,16.5347,458.558 +624,2038.03,12.8056,372.895 +625,2045.27,13.2124,387.159 +626,2040.49,12.453,364.307 +627,2053.64,12.9353,380.347 +628,2045.63,12.3668,348.69 +629,2035.18,13.3122,376.741 +630,2043.28,12.9236,361.491 +631,2039.07,13.03,367.479 +632,2040.21,13.0658,377.632 +633,2023.15,12.8518,373.181 +634,2045.21,12.453,358.617 +635,2039.13,12.9444,382.706 +636,2034.38,12.347,356.245 +637,2037.8,12.4945,364.287 +638,2044.88,12.1875,348.499 +639,2051.59,13.1938,390.784 +640,2041,16.5822,478.602 +641,2046.29,14.9679,436.277 +642,2047.93,16.6281,465.148 +643,2040.82,14.4755,400.523 +644,2057.81,16.4928,439.784 +645,2025.19,14.293,388.431 +646,2051.32,17.0244,436.126 +647,2031.13,14.7924,357.74 +648,2046.19,17.4765,493.9 +649,2044.74,15.6528,454.693 +650,2041.81,16.2249,474.585 +651,2054.03,15.2127,442.319 +652,2051.1,15.8903,456.317 +653,2035.17,14.4473,417.434 +654,2048.92,15.7969,431.776 +655,2041.39,13.9606,407.235 +656,2059.35,16.3599,477.332 +657,2026.72,17.2127,513.413 +658,2038.81,15.9747,472.448 +659,2045.5,15.5645,481.289 +660,2039.96,16.2895,471.216 +661,2048.09,16.8147,496.326 +662,2056.6,16.3789,456.306 +663,2042.46,16.9003,477.607 +664,2040.55,16.7438,493.331 +665,2040.18,16.0033,472.72 +666,2043.32,16.4602,479.692 +667,2055.31,16.3848,496.581 +668,2050.03,16.5392,477.833 +669,2031.66,15.2771,461.979 +670,2045.48,16.9295,485.714 +671,2041.42,15.8967,467.644 +672,2044.78,15.2593,444.965 +673,2043.08,15.6318,449.969 +674,2045.45,15.7961,450.491 +675,2042.08,14.4717,423.611 +676,2044.43,15.8013,438.543 +677,2024.2,15.7154,435.661 +678,2038.15,15.8197,438.853 +679,2059.9,14.4515,407.878 +680,2061.59,16.1205,479.176 +681,2046.86,15.9356,467.906 +682,2051.34,15.3604,446.701 +683,2060.52,14.7858,437.507 +684,2061.72,14.9798,433.621 +685,2045.99,15.5868,446.677 +686,2030.11,15.2179,437.114 +687,2043.14,15.2794,449.126 +688,2047.19,14.8339,439.418 +689,2044.73,16.8194,481.462 +690,2043.2,14.4641,422.434 +691,2042.69,16.798,477.72 +692,2066.47,14.9221,430.048 +693,2052.59,17.0467,483.876 +694,2051.14,15.2087,429.536 +695,2052.51,16.466,469.421 +696,2036.36,15.4159,446.176 +697,2043.75,16.2774,481.136 +698,2052.11,15.5054,444.288 +699,2038.76,15.7707,468.147 +700,2051.26,15.831,456.724 +701,2040.61,17.0118,476.584 +702,2056.29,15.2728,431.597 +703,2046.8,16.099,476.667 +704,2055.66,14.5876,417.22 +705,2039.3,17.3252,496.555 +706,2045.41,14.1563,407.964 +707,2026.08,15.9067,467.167 +708,2046.49,14.3884,400.878 +709,2042.28,17.1767,487.837 +710,2047.44,13.844,398.014 +711,2049.07,16.191,471.486 +712,2053.22,14.353,413.66 +713,2034.78,17.2218,494.56 +714,2047.53,13.3568,393.187 +715,2040.05,15.5525,458.563 +716,2044.01,14.3752,409.9 +717,2060.96,16.6011,486.711 +718,2043.53,12.6652,372.939 +719,2061.6,17.1087,500.427 +720,2057.61,15.3686,447.856 +721,2054.56,16.1011,478.157 +722,2037.22,15.2724,439.752 +723,2042.66,17.3708,500.726 +724,2035.71,14.3885,409.764 +725,2046.4,16.8235,484.927 +726,2037.01,14.7484,413.711 +727,2041.92,16.6233,470.405 +728,2055.21,15.9216,467.849 +729,2055.36,17.217,497.424 +730,2037.3,15.5609,453.386 +731,2038.65,17.3535,495.664 +732,2037.26,14.9519,440.705 +733,2041.21,15.9461,463.865 +734,2039.7,15.9082,459.491 +735,2046.56,16.9869,485.166 +736,2032.37,12.4656,439.091 +737,2052.87,14.5894,428.623 +738,2051.72,13.1191,472.812 +739,2048.57,15.2014,443.071 +740,2055.65,12.247,362.566 +741,2043.86,14.1261,408.092 +742,2037.14,12.7336,364.883 +743,2047.69,14.3487,419.419 +744,2054.36,12.1907,370.111 +745,2063.32,14.7632,428.919 +746,2054.84,12.4448,360.522 +747,2040.45,14.6132,426.172 +748,2054.75,11.4404,333.943 +749,2050.3,14.2912,415.525 +750,2049,12.1525,349.932 +751,2069.92,14.2497,423.391 +752,2050.65,16.4557,481.186 +753,2046.55,13.6645,394.381 +754,2038.34,15.3026,448.949 +755,2046.38,13.3697,389.651 +756,2047.76,15.4852,442.263 +757,2044.67,12.939,375.953 +758,2044.61,15.6513,448.304 +759,2040.9,12.8085,365.729 +760,2031.88,15.8882,465.607 +761,2047.88,13.5927,390.7 +762,2050.11,15.9477,469.707 +763,2043.56,13.3833,389.087 +764,2044.27,15.2115,447.997 +765,2037.25,13.6264,392.667 +766,2038.59,15.3916,448.216 +767,2042.88,13.1364,386.211 +768,2047.9,14.5986,415.471 +769,2035.31,18.4007,526.663 +770,2029.84,14.2491,386.549 +771,2040.11,18.3429,511.148 +772,2028.02,14.6811,389.761 +773,2043.21,18.0963,507.489 +774,2039.96,13.3244,320.366 +775,2037.59,17.2999,434.401 +776,2039.92,14.7633,419.947 +777,2048.19,17.5157,506.066 +778,2046.16,15.0285,427.106 +779,2049.11,17.6262,508.767 +780,2043.61,13.475,368.049 +781,2045.28,18.6389,506.494 +782,2059.15,14.4277,374.539 +783,2045.75,17.6531,489.999 +784,2062.08,16.2186,450.242 +785,2026.37,15.8748,457.946 +786,2037.49,16.5243,467.779 +787,2032.44,16.4103,465.768 +788,2040.77,15.0912,425.629 +789,2036.31,15.8739,437.349 +790,2062.02,15.552,440.955 +791,2053.57,15.6544,414.128 +792,2058.14,14.9742,463.337 +793,2049.5,16.5193,466.779 +794,2033.71,15.6514,463.128 +795,2043.83,16.1158,463.556 +796,2048.47,15.6024,433.56 +797,2054.79,15.6641,453.976 +798,2043.82,15.8524,435.644 +799,2031.98,16.6735,465.244 +800,2052.13,17.5206,489.466 +801,2054.39,14.6217,430.481 +802,2031.19,17.4989,490.732 +803,2042.54,15.1578,435.865 +804,2045.77,17.1794,472.025 +805,2045.91,15.4256,442.138 +806,2044.67,17.0693,458.148 +807,2038.66,14.9821,419.007 +808,2049.04,17.7758,488.184 +809,2049.9,15.0083,438.626 +810,2053.41,16.7417,480.846 +811,2052.83,14.9399,442.066 +812,2063.75,17.4172,478.252 +813,2038.21,15.3573,438.145 +814,2052.63,16.3896,461.628 +815,2052.86,14.7239,417.094 +816,2050.97,17.3189,478.598 +817,2037.83,15.1842,434.49 +818,2034.77,17.3389,482.841 +819,2048.87,14.6582,426.492 +820,2049.97,17.5301,479.532 +821,2042.57,15.0734,428.689 +822,2035.22,17.3974,474.213 +823,2041.24,14.7931,421.642 +824,2042.09,17.7045,597.784 +825,2037.9,15.4254,444.855 +826,2057.63,18.218,489.513 +827,2042.82,14.739,428.945 +828,2048.77,17.838,486.934 +829,2043.35,15.4044,441.705 +830,2038.84,17.4456,481.983 +831,2036.51,15.1384,434.237 +832,2044.63,15.5082,434.603 +833,2028.03,16.4877,474.757 +834,2068.45,15.1201,430.056 +835,2038.09,16.4534,478.081 +836,2053.83,15.4244,440.077 +837,2044.01,16.6703,464.892 +838,2059.02,14.7908,418.341 +839,2039.85,16.105,472.228 +840,2053.65,14.9918,429.708 +841,2026.02,16.0183,466.208 +842,2061.72,15.4235,447.946 +843,2047.37,16.5332,474.707 +844,2043.58,15.2412,432.255 +845,2038.59,15.9247,459.686 +846,2052.08,14.8668,429.606 +847,2044.22,16.2803,469.046 +848,2037.94,16.9557,492.256 +849,2047.51,17.3198,490.76 +850,2048.22,16.7137,488.75 +851,2036.55,16.6866,484.595 +852,2045.21,15.2787,461.602 +853,2034.96,17.3716,488.39 +854,2028.96,17.1651,482.166 +855,2049.14,16.6991,466.657 +856,2040.8,16.0837,487.526 +857,2043.34,17.2417,494.4 +858,2051.05,17.2396,496.364 +859,2039.05,16.7178,488.077 +860,2049.07,16.406,481.742 +861,2053.55,17.1289,485.476 +862,2037.27,16.7693,477.018 +863,2051.71,19.2462,526.331 +864,2041.06,17.3474,497.78 +865,2040.54,14.6816,429.303 +866,2039.82,17.7766,507.089 +867,2042.88,14.1435,418.216 +868,2038.08,18.1377,507.44 +869,2045.89,13.4831,400.751 +870,2045.67,17.7275,505.317 +871,2037.17,14.5268,420.601 +872,2045.68,17.9926,508.815 +873,2046.12,13.7404,415.333 +874,2067.63,17.439,503.325 +875,2043.75,14.3588,421.969 +876,2028.47,17.0622,473.923 +877,2056.31,13.6098,405.881 +878,2047.38,18.3003,510.453 +879,2063.51,14.4428,421.273 +880,2052.06,15.0017,445.645 +881,2029.62,16.5877,502.614 +882,2048.39,16.3589,467.192 +883,2043.56,17.1629,507.114 +884,2056.73,15.2538,447.82 +885,2048.15,17.2931,499.509 +886,2050.19,16.2011,461.566 +887,2050.36,16.3675,493.879 +888,2043.49,15.5622,442.433 +889,2037.21,17.1538,498.683 +890,2047,15.7632,449.974 +891,2034.63,17.2153,506.547 +892,2034.82,14.8043,429.722 +893,2050.39,16.7651,490.903 +894,2031.03,15.1678,431.256 +895,2040.67,16.9647,504.814 +896,2040.26,18.3003,515.205 +897,2052.41,16.9716,486.109 +898,2032.88,17.3427,487.701 +899,2030.49,16.399,449.714 +900,2024.58,17.7079,463.521 +901,2042.94,17.6497,474.275 +902,2037.09,16.1153,428.643 +903,2052.52,16.1419,413.391 +904,2043.09,18.4254,536.305 +905,2055.7,16.4546,477.115 +906,2040.28,17.7428,566.651 +907,2042.52,16.5371,477.996 +908,2036.71,17.135,503.095 +909,2054.7,16.999,476.388 +910,2043.28,16.7924,497.145 +911,2038.43,16.5306,464.436 +912,2045.72,15.6542,456.588 +913,2037.44,15.4329,446.927 +914,2041.7,16.5212,464.664 +915,2042.49,14.7025,430.237 +916,2040.34,15.7258,434.19 +917,2048.36,14.8021,421.033 +918,2053.34,16.1834,449.326 +919,2038.86,14.8568,394.59 +920,2052.74,16.2141,464.372 +921,2039.54,14.8448,437.136 +922,2052.98,15.9144,445.907 +923,2031.46,14.571,424.484 +924,2070.18,15.8411,429.646 +925,2042.72,14.8303,415.568 +926,2061.42,17.0363,463.586 +927,2034.35,15.1193,428.468 +928,2053.11,19.4161,529.496 +929,2033.79,19.0186,536.479 +930,2047.17,19.2696,531.809 +931,2043.66,17.7377,514.856 +932,2042.19,19.3767,523.301 +933,2050.26,18.5729,518.239 +934,2041.75,18.5746,469.495 +935,2045.11,18.5694,506.823 +936,2047.72,18.9881,528.421 +937,2047.35,17.2871,497.907 +938,2051.27,17.9492,510.548 +939,2036.34,17.6065,511.551 +940,2036.22,17.9199,509.041 +941,2016.17,18.0038,513.612 +942,2042.96,18.993,522.103 +943,2039.24,18.2942,519.35 +944,2052.85,17.2441,502.292 +945,2048.16,16.275,484.052 +946,2049.87,17.6047,511.571 +947,2041.84,16.6146,483.523 +948,2031.59,17.9039,476.898 +949,2055.45,16.7637,486.182 +950,2045.8,18.2626,507.192 +951,2049.55,16.9707,475.558 +952,2062.61,17.6207,506.706 +953,2055,16.2621,483.419 +954,2044.03,17.1924,500.265 +955,2044.18,16.2384,474.589 +956,2052.56,17.6245,494.676 +957,2035.71,17.0279,470.073 +958,2029.38,18.0739,512.597 +959,2047.93,16.6635,468.906 +960,2059.45,13.2047,386.362 +961,2037.46,15.6165,452.173 +962,2046.89,13.8911,404.687 +963,2044.49,14.4252,429.935 +964,2036.58,14.1993,396.945 +965,2036.23,14.6426,431.648 +966,2050.68,13.4374,380.211 +967,2047.12,14.7807,433.823 +968,2024.24,13.7057,396.835 +969,2047.49,16.1484,498.979 +970,2041.69,13.6854,395.604 +971,2041.51,15.0819,454.42 +972,2032.63,13.6632,384.587 +973,2064.7,14.6663,432.293 +974,2061.71,13.8162,396.783 +975,2037.27,14.3332,425.907 +976,2047.56,13.2721,377.429 +977,2045.99,15.2257,440.923 +978,2027.92,13.1594,380.198 +979,2036.04,14.9552,442.425 +980,2036.19,13.5918,377.84 +981,2048.87,14.7298,428.577 +982,2054.97,13.3066,367.744 +983,2044.49,15.1357,438.743 +984,2045.81,13.9812,385.544 +985,2037.8,14.8079,450.769 +986,2043.42,12.7808,368.629 +987,2045.59,15.601,452.255 +988,2056.19,13.5975,382.068 +989,2043.86,14.8826,432.689 +990,2041.27,13.1794,370.209 +991,2038.88,15.4173,444.259 +992,2051.09,13.0811,381.154 +993,2032.1,15.4822,441.835 +994,2036.35,13.5414,382.63 +995,2046.42,15.7959,452.081 +996,2045.2,13.7111,384.524 +997,2035.28,14.9012,431.414 +998,2040.88,13.0734,370.85 +999,2055.18,15.3191,438.688 +1000,2060.06,13.9053,388.327 +1001,2032.58,15.2999,445.619 +1002,2054.51,13.2142,379.583 +1003,2049.4,15.7943,449.319 +1004,2061.26,13.4856,381.119 +1005,2036.29,15.7375,439.449 +1006,2045.19,13.1035,377.274 +1007,2051.26,15.8442,446.869 +1008,2055.6,16.7544,476.478 +1009,2045.4,18.3987,527.743 +1010,2043.48,16.2683,466.063 +1011,2046.71,18.1869,529.578 +1012,2039.76,16.6874,471.174 +1013,2036.13,17.7656,518.708 +1014,2056.32,16.8091,472.135 +1015,2045.98,17.8933,511.92 +1016,2044.47,16.8466,469.627 +1017,2058.14,17.1185,511.822 +1018,2045.89,16.4311,469.175 +1019,2050.78,18.2319,533.061 +1020,2034.1,16.6546,467.675 +1021,2045.9,17.4729,505.819 +1022,2043.2,16.7553,475.552 +1023,2048.19,18.4007,517.156 +1024,0,-1,-1 +1025,2046.59,16.0511,442.623 +1026,0,-1,-1 +1027,2042.4,16.5043,433.623 +1028,0,-1,-1 +1029,2049.74,15.8006,423.711 +1030,0,-1,-1 +1031,2044.33,15.8977,388.323 +1032,0,-1,-1 +1033,2050.4,16.2022,428.199 +1034,0,-1,-1 +1035,2051.79,16.1448,438.898 +1036,0,-1,-1 +1037,2033.69,16.5171,432.187 +1038,0,-1,-1 +1039,2049.81,16.2771,422.909 +1040,0,-1,-1 +1041,2033.05,18.4057,509.824 +1042,0,-1,-1 +1043,2045.56,19.4731,520.207 +1044,0,-1,-1 +1045,2047.64,18.198,480.097 +1046,0,-1,-1 +1047,2038.99,18.5401,486.716 +1048,0,-1,-1 +1049,2015.07,20.4722,552.042 +1050,0,-1,-1 +1051,2051.05,19.7362,545.905 +1052,0,-1,-1 +1053,2035.58,18.1275,498.173 +1054,0,-1,-1 +1055,2037.48,18.621,504.43 +1056,0,-1,-1 +1057,2032.96,15.2763,409.309 +1058,0,-1,-1 +1059,2036.21,15.5171,416.903 +1060,0,-1,-1 +1061,2044.26,15.7735,425.704 +1062,0,-1,-1 +1063,2032.73,15.1955,380.8 +1064,0,-1,-1 +1065,2028.09,17.4304,506.829 +1066,0,-1,-1 +1067,2044.69,18.2438,520.65 +1068,0,-1,-1 +1069,2036.07,16.7654,480.037 +1070,0,-1,-1 +1071,2043.78,16.2854,470.616 +1072,0,-1,-1 +1073,2042.29,15.2596,397.774 +1074,0,-1,-1 +1075,2035.18,16.1071,427.425 +1076,0,-1,-1 +1077,2040.88,16.5834,449.395 +1078,0,-1,-1 +1079,2035.09,15.7162,406.577 +1080,0,-1,-1 +1081,2033.6,14.6913,412.357 +1082,0,-1,-1 +1083,2049.56,16.0286,424.485 +1084,0,-1,-1 +1085,2033.88,16.6423,448.343 +1086,0,-1,-1 +1087,2045.27,16.1814,439.888 +1088,0,-1,-1 +1089,2020.09,18.4006,493.238 +1090,0,-1,-1 +1091,2038.23,19.4272,509.05 +1092,0,-1,-1 +1093,2048.9,18.3064,488.719 +1094,0,-1,-1 +1095,2036.18,17.2596,455.815 +1096,0,-1,-1 +1097,2033.86,18.7827,500.051 +1098,0,-1,-1 +1099,2048.68,18.1976,490.498 +1100,0,-1,-1 +1101,2049.02,17.3997,472.052 +1102,0,-1,-1 +1103,2061.45,19.51,508.424 +1104,0,-1,-1 +1105,2048.65,19.1068,539.861 +1106,0,-1,-1 +1107,2051.22,-1,-1 +1108,0,-1,-1 +1109,2026.27,17.0038,460.804 +1110,0,-1,-1 +1111,2026.7,16.8031,452.076 +1112,0,-1,-1 +1113,2036.32,17.398,526.223 +1114,0,-1,-1 +1115,2033.54,16.9447,479.4 +1116,0,-1,-1 +1117,2042.68,17.1478,470.2 +1118,0,-1,-1 +1119,2036.77,16.8943,470.262 +1120,0,-1,-1 +1121,2035.78,17.2024,461.729 +1122,0,-1,-1 +1123,2051.78,17.8501,479.729 +1124,0,-1,-1 +1125,2025.09,16.4958,433.811 +1126,0,-1,-1 +1127,2061.4,16.4855,456.118 +1128,0,-1,-1 +1129,2046.54,17.4736,485.488 +1130,0,-1,-1 +1131,2037.1,17.5495,459.755 +1132,0,-1,-1 +1133,2036.48,17.3078,455.798 +1134,0,-1,-1 +1135,2043.99,17.414,464.173 +1136,0,-1,-1 +1137,2041.43,21.0771,559.248 +1138,0,-1,-1 +1139,2043.07,19.4114,534.715 +1140,0,-1,-1 +1141,2044.16,20.8365,550.124 +1142,0,-1,-1 +1143,2035,20.3682,538.162 +1144,0,-1,-1 +1145,2044.79,19.4605,530.577 +1146,0,-1,-1 +1147,2038.63,19.8086,538.093 +1148,0,-1,-1 +1149,2032.88,20.0029,541.962 +1150,0,-1,-1 +1151,2039.22,19.5,533.598 +1152,0,-1,-1 +1153,2024.93,15.1553,418.15 +1154,0,-1,-1 +1155,2045.54,15.8813,393.451 +1156,0,-1,-1 +1157,2038.86,15.2498,383.893 +1158,0,-1,-1 +1159,2048.64,14.131,338.842 +1160,0,-1,-1 +1161,2050.94,14.9651,421.611 +1162,0,-1,-1 +1163,2048.84,15.2969,423.911 +1164,0,-1,-1 +1165,2059.59,15.391,418.853 +1166,0,-1,-1 +1167,2033.72,16.3156,424.11 +1168,0,-1,-1 +1169,2030.07,18.0328,524.571 +1170,0,-1,-1 +1171,2038.49,17.2367,493.844 +1172,0,-1,-1 +1173,2033.05,17.1442,482.248 +1174,0,-1,-1 +1175,2039.72,17.1329,467.755 +1176,0,-1,-1 +1177,2043.3,17.3418,486.031 +1178,0,-1,-1 +1179,2037.18,18.6199,489.212 +1180,0,-1,-1 +1181,2036.07,18.9188,536.471 +1182,0,-1,-1 +1183,2032.82,18.7768,504.611 +1184,0,-1,-1 +1185,2050.95,16.1567,456.328 +1186,0,-1,-1 +1187,2048.41,16.6559,457.099 +1188,0,-1,-1 +1189,2035.37,16.5232,448.992 +1190,0,-1,-1 +1191,2058.22,16.0269,413.139 +1192,0,-1,-1 +1193,2050.2,16.884,506.563 +1194,0,-1,-1 +1195,2044.25,16.4438,468.625 +1196,0,-1,-1 +1197,2041.35,18.1068,505.111 +1198,0,-1,-1 +1199,2040.2,18.0621,487.523 +1200,0,-1,-1 +1201,2034.64,20.4169,624.619 +1202,0,-1,-1 +1203,2044.99,18.0626,557.873 +1204,0,-1,-1 +1205,2040.87,17.4997,492.728 +1206,0,-1,-1 +1207,2036.29,17.7563,512.991 +1208,0,-1,-1 +1209,2047.73,18.9152,500.551 +1210,0,-1,-1 +1211,2054.23,17.2292,475.441 +1212,0,-1,-1 +1213,2038.73,18.7509,494.05 +1214,0,-1,-1 +1215,2030.07,16.9285,474.019 +1216,0,-1,-1 +1217,2052.37,17.8206,478.933 +1218,0,-1,-1 +1219,2035.97,18.291,505.789 +1220,0,-1,-1 +1221,2054.52,19.4936,517.332 +1222,0,-1,-1 +1223,2049.45,17.4016,466.989 +1224,0,-1,-1 +1225,2042.27,19.0535,513.355 +1226,0,-1,-1 +1227,2029.54,16.7674,474.805 +1228,0,-1,-1 +1229,2026.99,16.3897,449.247 +1230,0,-1,-1 +1231,2047.89,16.3024,429.026 +1232,0,-1,-1 +1233,2026.86,17.3664,558.649 +1234,0,-1,-1 +1235,2036.18,17.3412,546.12 +1236,0,-1,-1 +1237,2040.15,17.2874,550.163 +1238,0,-1,-1 +1239,2034.64,18.5907,530.437 +1240,0,-1,-1 +1241,2031.2,16.0667,446.184 +1242,0,-1,-1 +1243,2031.34,17.0377,460.946 +1244,0,-1,-1 +1245,2065.16,16.926,454.325 +1246,0,-1,-1 +1247,2040.49,16.6409,455.005 +1248,0,-1,-1 +1249,2039.23,19.2271,536.519 +1250,0,-1,-1 +1251,2056.07,18.7371,508.616 +1252,0,-1,-1 +1253,2055.72,18.4649,494.158 +1254,0,-1,-1 +1255,2038.16,18.9321,498.828 +1256,0,-1,-1 +1257,2054.48,19.5008,520.1 +1258,0,-1,-1 +1259,2028.31,19.4548,518.746 +1260,0,-1,-1 +1261,2050.14,19.5525,520.142 +1262,0,-1,-1 +1263,2051.04,19.6388,520.183 +1264,0,-1,-1 +1265,2054.1,18.5184,517.109 +1266,0,-1,-1 +1267,2043.19,19.6327,529.166 +1268,0,-1,-1 +1269,2052.18,19.4394,519.681 +1270,0,-1,-1 +1271,2052.52,19.035,513.587 +1272,0,-1,-1 +1273,2036.44,19.7631,545.236 +1274,0,-1,-1 +1275,2058.16,20.6871,547.021 +1276,0,-1,-1 +1277,2036.91,20.8867,583.469 +1278,0,-1,-1 +1279,2031.99,20.8916,585.611 +1280,0,-1,-1 +1281,2029.79,15.3278,428.041 +1282,0,-1,-1 +1283,2039.47,14.8794,419.255 +1284,0,-1,-1 +1285,2051.69,15.6054,423.198 +1286,0,-1,-1 +1287,2048.43,14.9411,418.951 +1288,0,-1,-1 +1289,2049.1,15.0532,421.239 +1290,0,-1,-1 +1291,2046.52,15.2875,425.938 +1292,0,-1,-1 +1293,2036.88,15.2867,416.279 +1294,0,-1,-1 +1295,2048.64,15.4497,423.173 +1296,0,-1,-1 +1297,2066.16,16.8692,468.804 +1298,0,-1,-1 +1299,2046.05,17.5859,479.857 +1300,0,-1,-1 +1301,2038.97,17.8062,483.368 +1302,0,-1,-1 +1303,2045.56,17.8368,480.587 +1304,0,-1,-1 +1305,2046.08,17.9433,480.476 +1306,0,-1,-1 +1307,2045.87,17.7345,481.666 +1308,0,-1,-1 +1309,2026.12,17.1098,470.533 +1310,0,-1,-1 +1311,2035.67,18.3917,492.863 +1312,0,-1,-1 +1313,2036.33,18.7423,499.794 +1314,0,-1,-1 +1315,2064.91,18.5311,498.548 +1316,0,-1,-1 +1317,2054.98,17.9517,491.544 +1318,0,-1,-1 +1319,2062.16,18.4717,494.161 +1320,0,-1,-1 +1321,2063.38,17.9431,484.233 +1322,0,-1,-1 +1323,2043.96,17.8141,480.268 +1324,0,-1,-1 +1325,2045.33,17.8513,482.332 +1326,0,-1,-1 +1327,2045.26,18.3712,494.646 +1328,0,-1,-1 +1329,2048.11,21.4729,589.408 +1330,0,-1,-1 +1331,2037.77,21.4484,585.489 +1332,0,-1,-1 +1333,2043.01,20.5451,567.256 +1334,0,-1,-1 +1335,2050.79,21.2442,578.64 +1336,0,-1,-1 +1337,2045.75,20.7065,539.118 +1338,0,-1,-1 +1339,2065.37,21.0127,575.605 +1340,0,-1,-1 +1341,2040.6,20.7083,535.203 +1342,0,-1,-1 +1343,2045.27,20.7832,561.721 +1344,0,-1,-1 +1345,2030.18,17.0157,471.857 +1346,0,-1,-1 +1347,2044.31,16.5076,458.865 +1348,0,-1,-1 +1349,2042.5,17.0294,461.426 +1350,0,-1,-1 +1351,2046.54,16.86,461.841 +1352,0,-1,-1 +1353,2044.87,15.9015,439.575 +1354,0,-1,-1 +1355,2049.82,16.1806,450.745 +1356,0,-1,-1 +1357,2055.8,16.0572,465.878 +1358,0,-1,-1 +1359,2043.17,16.2193,466.007 +1360,0,-1,-1 +1361,2037.92,17.731,466.377 +1362,0,-1,-1 +1363,2038.53,17.0063,463.038 +1364,0,-1,-1 +1365,2043.5,16.6676,461.3 +1366,0,-1,-1 +1367,2038.69,17.2602,485.994 +1368,0,-1,-1 +1369,2046.3,17.0149,463.011 +1370,0,-1,-1 +1371,2041.14,16.7985,523.587 +1372,0,-1,-1 +1373,2046.84,17.0475,473.661 +1374,0,-1,-1 +1375,2052.09,17.6991,487.147 +1376,0,-1,-1 +1377,2041.07,18.4697,543.851 +1378,0,-1,-1 +1379,2054.5,19.084,548.075 +1380,0,-1,-1 +1381,2049.89,19.2052,565.882 +1382,0,-1,-1 +1383,2037.6,18.8412,551.041 +1384,0,-1,-1 +1385,2053.85,18.4822,511.619 +1386,0,-1,-1 +1387,2048.87,19.4383,523.978 +1388,0,-1,-1 +1389,2053.71,19.033,529.177 +1390,0,-1,-1 +1391,2040.09,18.6743,535.403 +1392,0,-1,-1 +1393,2043.17,15.598,434.666 +1394,0,-1,-1 +1395,2048.07,15.3674,429.535 +1396,0,-1,-1 +1397,2060.01,16.5138,449.802 +1398,0,-1,-1 +1399,2047.08,15.3488,437.436 +1400,0,-1,-1 +1401,2060.44,15.5796,440.668 +1402,0,-1,-1 +1403,2051.51,15.3076,411.031 +1404,0,-1,-1 +1405,2046.61,15.502,446.005 +1406,0,-1,-1 +1407,2042.74,15.5965,467.681 +1408,0,-1,-1 +1409,2043.19,19.6227,527.636 +1410,0,-1,-1 +1411,2045.44,19.1495,505.231 +1412,0,-1,-1 +1413,2040.62,19.0671,515.06 +1414,0,-1,-1 +1415,2058.84,18.9942,513.164 +1416,0,-1,-1 +1417,2046.08,19.2129,504.609 +1418,0,-1,-1 +1419,2056.24,19.2586,505.872 +1420,0,-1,-1 +1421,2039.27,19.4278,516.139 +1422,0,-1,-1 +1423,2030.96,18.9545,515.225 +1424,0,-1,-1 +1425,2039.25,17.2466,458.577 +1426,0,-1,-1 +1427,2035.31,17.4415,477.651 +1428,0,-1,-1 +1429,2050.87,17.985,505.569 +1430,0,-1,-1 +1431,2055,17.7873,499.356 +1432,0,-1,-1 +1433,2023.77,17.1805,446.293 +1434,0,-1,-1 +1435,2051.79,17.3675,475.882 +1436,0,-1,-1 +1437,2056.3,17.9818,493.091 +1438,0,-1,-1 +1439,2045.15,17.5523,493.123 +1440,0,-1,-1 +1441,2044.73,16.7298,459.569 +1442,0,-1,-1 +1443,2030.87,17.0374,447.987 +1444,0,-1,-1 +1445,2038.21,17.2184,507.676 +1446,0,-1,-1 +1447,2052.05,17.7435,540.081 +1448,0,-1,-1 +1449,2044.63,17.3974,451.632 +1450,0,-1,-1 +1451,2044.13,16.9603,454.251 +1452,0,-1,-1 +1453,2040.53,17.3679,465.234 +1454,0,-1,-1 +1455,2053.37,17.3078,470.919 +1456,0,-1,-1 +1457,2057.53,18.867,483.318 +1458,0,-1,-1 +1459,2047.03,18.964,505.661 +1460,0,-1,-1 +1461,2037.46,20.6886,638.841 +1462,0,-1,-1 +1463,2038.81,20.0866,612.534 +1464,0,-1,-1 +1465,2041.82,19.0044,439.256 +1466,0,-1,-1 +1467,2057.79,18.9355,486.618 +1468,0,-1,-1 +1469,2044.28,19.027,474.762 +1470,0,-1,-1 +1471,2044.98,19.0868,511.21 +1472,0,-1,-1 +1473,2045.51,17.8663,470.666 +1474,0,-1,-1 +1475,2060.09,17.8346,464.581 +1476,0,-1,-1 +1477,2060.3,18.349,471.393 +1478,0,-1,-1 +1479,2033.71,17.937,472.082 +1480,0,-1,-1 +1481,2047.51,17.886,465.279 +1482,0,-1,-1 +1483,2050.1,17.8135,455.492 +1484,0,-1,-1 +1485,2057.01,18.5034,480.169 +1486,0,-1,-1 +1487,2035.59,17.8557,467.091 +1488,0,-1,-1 +1489,2055.68,19.3285,509.866 +1490,0,-1,-1 +1491,2044.03,19.5068,509.092 +1492,0,-1,-1 +1493,2046.76,19.7735,518.417 +1494,0,-1,-1 +1495,2046.41,19.124,506.35 +1496,0,-1,-1 +1497,2053.18,19.8611,515.561 +1498,0,-1,-1 +1499,2049.27,19.8528,518.159 +1500,0,-1,-1 +1501,2016.26,19.9843,520.615 +1502,0,-1,-1 +1503,2047.63,19.9389,526.29 +1504,0,-1,-1 +1505,2050.22,18.3207,480.352 +1506,0,-1,-1 +1507,2058.84,18.9246,492.3 +1508,0,-1,-1 +1509,2043.65,19.0238,494.127 +1510,0,-1,-1 +1511,2043.25,18.5236,488.323 +1512,0,-1,-1 +1513,2030.76,18.3352,480.046 +1514,0,-1,-1 +1515,2044.95,18.482,479.473 +1516,0,-1,-1 +1517,2034.97,19.0802,494.234 +1518,0,-1,-1 +1519,2037.42,18.9088,502.089 +1520,0,-1,-1 +1521,2048.78,19.109,511.661 +1522,0,-1,-1 +1523,2046.89,20.286,540.812 +1524,0,-1,-1 +1525,2056.63,20.8941,531.456 +1526,0,-1,-1 +1527,2047.6,20.0681,539.587 +1528,0,-1,-1 +1529,2048.96,20.8244,531.177 +1530,0,-1,-1 +1531,2041.74,19.477,512.915 +1532,0,-1,-1 +1533,2034.57,20.1228,525.323 +1534,0,-1,-1 +1535,2031.86,20.5251,533.489 +1536,2037.27,15.5475,455.695 +1537,2053.45,17.6076,556.762 +1538,2058.47,15.0985,432.146 +1539,2038.41,18.7437,592.646 +1540,2040.11,15.272,425.206 +1541,2050.03,18.8851,570.202 +1542,2033.25,14.7512,368.817 +1543,2035.78,17.4772,472.237 +1544,2046.8,16.3557,500.658 +1545,2050.81,19.173,651.154 +1546,2057.5,16.2513,525.95 +1547,2043.66,18.8235,659.956 +1548,2047.38,15.5142,465.047 +1549,2042.26,18.55,565.792 +1550,2045.02,16.0836,449.421 +1551,2040,18.7972,577.394 +1552,2055.79,17.9983,521.967 +1553,2027.12,17.9645,527.231 +1554,2061.03,17.667,521.315 +1555,2035.53,18.3799,542.651 +1556,2044.43,18.3986,520.065 +1557,2040.08,18.1313,522.544 +1558,2051.37,18.9421,527.866 +1559,2046.04,18.0216,498.079 +1560,2033.17,18.4325,520.628 +1561,2064.85,18.6646,576.578 +1562,2048.26,17.9361,518.617 +1563,2047.34,18.3142,519.804 +1564,2034.84,18.3301,505.015 +1565,2040.01,18.5988,528.37 +1566,2056.51,18.0849,505.159 +1567,2056.03,17.8633,497.891 +1568,2050.37,14.9691,440.265 +1569,2034.77,18.5436,533.277 +1570,2041.47,15.2641,458.27 +1571,2057.75,16.4127,481.219 +1572,2053.94,14.5086,417.528 +1573,2051.97,16.6479,477.675 +1574,2041.54,15.9975,454.19 +1575,2053.19,17.6796,461.587 +1576,2037.1,15.0044,453.318 +1577,2035.58,17.5489,495.255 +1578,2057.73,16.857,471.33 +1579,2048.01,17.2809,491.885 +1580,2046.49,14.9686,432.902 +1581,2047.72,17.0111,493.591 +1582,2052.41,14.4389,415.743 +1583,2059.87,16.7255,486.777 +1584,2032.5,16.456,491.814 +1585,2034.3,16.2471,473.298 +1586,2033.27,16.3553,488.107 +1587,2050.13,16.6149,478.263 +1588,2045.09,16.4371,480.703 +1589,2047.8,16.2121,460.902 +1590,2028.39,16.4633,481.639 +1591,2046.13,17.3015,483.898 +1592,2048.54,17.96,511.094 +1593,2048.06,18.1275,495.518 +1594,2053.27,16.3903,483.158 +1595,2041.32,16.6614,475.296 +1596,2045.87,18.1327,501.242 +1597,2066.74,18.3842,494.16 +1598,2058.82,16.9471,479.015 +1599,2053.88,16.0528,470.96 +1600,2049.33,15.6362,462.703 +1601,2033.49,16.6626,484.589 +1602,2041.86,15.4354,458.281 +1603,2064.01,17.0071,484.913 +1604,2051.26,15.1773,451.621 +1605,2043.32,16.8966,469.773 +1606,2041.16,15.479,435.546 +1607,2074.08,16.8365,484.703 +1608,2050.67,15.5335,460.234 +1609,2022.02,17.4504,493.195 +1610,2056.75,15.654,463.193 +1611,2042.53,16.8293,489.038 +1612,2046.64,14.6193,437.098 +1613,2057.69,16.829,489.158 +1614,2034.35,15.653,462.448 +1615,2043.7,16.7284,478.064 +1616,2056.13,15.7507,475.569 +1617,2040.12,19.2559,546.851 +1618,2036.82,16.1295,481.796 +1619,2035.72,17.8182,520.038 +1620,2038.76,15.7041,469.048 +1621,2052.54,17.1357,505.424 +1622,2049.62,18.2342,499.166 +1623,2029.33,17.3782,512.958 +1624,2053.55,16.8671,490.887 +1625,2047.34,17.9677,520.216 +1626,2043.48,18.0161,509.907 +1627,2041.82,18.6575,526.712 +1628,2057.33,15.8792,460.259 +1629,2058.03,19.2028,532.256 +1630,2039.66,16.1663,478.056 +1631,2034.77,18.4288,521.188 +1632,2042.13,19.7281,571.768 +1633,2058.3,17.489,484.518 +1634,2045.63,19.675,561.394 +1635,2046.65,17.8789,492.131 +1636,2059.83,19.4453,568.925 +1637,2050.34,17.4995,470.397 +1638,2042.44,20.4003,571.79 +1639,2036.99,15.6966,441.86 +1640,2047.68,20.02,566.207 +1641,2066.96,17.914,488.029 +1642,2042.9,18.5132,548.606 +1643,2045.41,17.7616,485.477 +1644,2053.52,18.4397,530.497 +1645,2049.19,18.3674,488.162 +1646,2057.46,19.2876,546.817 +1647,2056.29,17.9134,483.152 +1648,2043.87,18.7064,531.502 +1649,2042.43,19.1054,541.946 +1650,2058.51,17.3419,520.968 +1651,2031.35,19.1573,543.247 +1652,2027.02,19.5801,537.652 +1653,2043.14,19.1469,537.507 +1654,2043.24,17.0132,502.101 +1655,2053.44,18.4925,529.225 +1656,2050.45,19.1734,544.854 +1657,2051.92,18.4797,539.975 +1658,2047.19,18.9987,545.982 +1659,2069.35,17.7174,525.024 +1660,2053.78,18.1456,525.023 +1661,2056.32,18.5626,537.284 +1662,2047.48,18.7546,535.892 +1663,2036.96,17.5576,515.67 +1664,2060.36,18.5233,536.051 +1665,2058.54,19.1342,534.231 +1666,2042.99,18.2854,522.799 +1667,2046.68,17.7585,484.893 +1668,2037.42,19.0157,539.851 +1669,2043.97,19.4308,526.462 +1670,2053.78,18.3175,491.179 +1671,2050.28,17.1122,428.373 +1672,2041.41,18.3607,533.738 +1673,2057.42,19.1674,524.621 +1674,2050.82,19.0799,542.54 +1675,2051.54,17.5302,508.099 +1676,2051.81,18.2946,520.348 +1677,2040.64,17.9819,502.41 +1678,2051.16,18.5267,512.077 +1679,2047,17.3912,488.817 +1680,2045.45,17.6281,509.614 +1681,2040.07,19.8516,554.526 +1682,2044.25,18.2986,516.645 +1683,2042.02,19.8013,548.038 +1684,2054.46,17.9496,509.797 +1685,2051.37,19.2644,508.011 +1686,2070.9,18.1166,515.753 +1687,2047.28,19.0614,502.808 +1688,2043.55,18.4988,522.813 +1689,2038.15,19.737,549.337 +1690,2040.07,17.9929,509.4 +1691,2029.01,17.0223,499.587 +1692,2049.12,17.8083,504.14 +1693,2042.81,19.5834,530.824 +1694,2061.53,18.0793,503.392 +1695,2045.07,17.3114,505.243 +1696,2044.79,16.456,462.265 +1697,2043.08,18.6368,538.271 +1698,2030.79,16.6498,470.408 +1699,2046.7,18.3906,530.469 +1700,2043.31,16.2793,435.246 +1701,2054.07,18.327,522.856 +1702,2048.54,16.3383,421.385 +1703,2040.16,18.2561,523.619 +1704,2036.08,15.9298,452.698 +1705,2058.14,18.467,533.547 +1706,2061.86,16.3377,462.627 +1707,2049.11,18.8503,541.278 +1708,2050.41,16.4591,458.459 +1709,2057.52,18.3421,521.839 +1710,2043.92,15.4848,435.679 +1711,2060.11,18.2254,526.887 +1712,2038.87,18.2684,527.892 +1713,2038.8,16.2256,458.685 +1714,2048.03,18.8408,542.346 +1715,2028.66,15.9197,451.776 +1716,2060.58,18.1875,521.183 +1717,2033.22,16.0591,444.389 +1718,2043.7,18.0327,510.498 +1719,2046.68,17.2355,463.796 +1720,2063.97,19.0243,531.717 +1721,2039.21,19.2007,510.568 +1722,2037.31,18.9573,534.533 +1723,2034.43,18.0212,486.03 +1724,2053.47,19.5335,540.914 +1725,2051.43,19.5618,515.622 +1726,2068.05,19.2769,539.976 +1727,2051.98,18.3315,466.046 +1728,2043.68,16.98,488.372 +1729,2042.68,19.3296,545.531 +1730,2048.1,17.2424,489.349 +1731,2044.88,18.5488,541.813 +1732,2059.44,18.0657,498.562 +1733,2041.73,17.811,524.01 +1734,2052.63,17.7314,494.226 +1735,2046.67,18.6027,529.016 +1736,2047.4,17.8473,502.69 +1737,2054.97,20.0147,573.149 +1738,2051.01,17.1717,491.116 +1739,2040.71,20.7103,575.446 +1740,2037.65,17.6884,492.151 +1741,2058.84,20.4855,571.241 +1742,2043.7,17.304,485.057 +1743,2043.69,21.4346,591.332 +1744,2059.61,18.4501,580.393 +1745,2047.13,17.0101,488.842 +1746,2044.85,18.9967,638.283 +1747,2048.19,16.2776,480.183 +1748,2036.65,18.6719,560.218 +1749,2063,16.2661,473.45 +1750,2039.72,18.137,525.899 +1751,2061.7,18.805,504.696 +1752,2041.93,18.4511,535.409 +1753,2046.18,18.0384,499.007 +1754,2036.95,18.0591,514.865 +1755,2053.75,17.9304,507.011 +1756,2035.05,18.7909,526.37 +1757,2055.42,17.7264,498.033 +1758,2056.52,19.2528,533.462 +1759,2048.95,17.8764,492.076 +1760,2062.65,18.8953,525.499 +1761,2041.1,15.4557,454.415 +1762,2053.65,18.8349,528.817 +1763,2044.92,15.5263,455.677 +1764,2046.39,17.5052,486.345 +1765,2043.22,15.6312,444.606 +1766,2040.42,17.9791,511.372 +1767,2060.87,17.4556,475.962 +1768,2045.57,18.8502,530.421 +1769,2062.09,17.1507,486.939 +1770,2052.27,19.5733,552.218 +1771,2059.26,17.0383,488.516 +1772,2041.04,18.1955,509.011 +1773,2063.26,16.8579,468.307 +1774,2056.67,18.0785,513.985 +1775,2033.42,16.4167,464.747 +1776,2045.78,15.4995,440.165 +1777,2055.43,17.8238,499.321 +1778,2044.97,13.9539,415.661 +1779,2053.16,16.7438,494.211 +1780,2037.91,14.1499,411.681 +1781,2031.81,16.0005,467.641 +1782,2036.9,14.5831,420.852 +1783,2041.86,17.1096,480.899 +1784,2055.08,14.4205,447.577 +1785,2055.97,18.0518,505.767 +1786,2058.06,14.319,433.146 +1787,2035.82,18.3961,514.527 +1788,2040.11,14.4021,416.675 +1789,2041.54,18.3144,507.98 +1790,2045.12,14.6829,429.245 +1791,2067.24,17.2822,494.901 +1792,2049.01,19.1077,604.224 +1793,2049.12,15.9447,454.997 +1794,2048.9,18.8317,559.377 +1795,2052.48,15.8251,442.177 +1796,2030.2,19.0398,559.167 +1797,2069.75,15.9882,449.524 +1798,2046.89,18.4263,500.254 +1799,2041.94,15.8129,383.34 +1800,2044.3,18.5138,561.604 +1801,2054.61,15.9122,457.692 +1802,2060.59,19.0766,567.777 +1803,2042.97,16.5931,467.809 +1804,2060.56,18.6922,526.516 +1805,2055.09,15.8071,444.2 +1806,2046.23,18.0127,493.284 +1807,2050.67,15.7135,430.531 +1808,2054.47,17.6233,522.446 +1809,2044.04,18.3661,522.203 +1810,2039.01,17.5228,518.062 +1811,2047.94,17.9138,509.887 +1812,2043.24,17.8808,514.143 +1813,2038.27,17.7305,496.641 +1814,2041.58,18.8173,513.226 +1815,2060.26,17.8912,479.804 +1816,2045.17,18.9622,544.631 +1817,2055.41,18.8037,539.698 +1818,2051.61,18.7333,540.67 +1819,2054.57,18.8557,530.445 +1820,2046.43,19.4096,544.098 +1821,2071.69,18.9141,538.035 +1822,2053.52,18.1957,518.802 +1823,2036.99,17.9206,500.173 +1824,2038.16,18.0274,552.288 +1825,2048.8,18.3782,529.973 +1826,2044.73,18.1337,545.638 +1827,2054.71,17.5146,514.266 +1828,2035.22,17.8282,491.884 +1829,2056.7,18.1418,503.898 +1830,2049.58,17.0206,494.255 +1831,2048.42,17.607,497.403 +1832,2039.92,16.0077,494.569 +1833,2052.44,18.944,568.338 +1834,2053.09,18.0517,557.445 +1835,2040.66,18.9606,541.853 +1836,2042.87,17.009,485.885 +1837,2045.37,18.027,518.015 +1838,2043.98,16.5283,470.604 +1839,2049.97,17.2212,501.941 +1840,2052.69,17.195,523.003 +1841,2048.89,18.502,571.144 +1842,2051.32,16.414,470.862 +1843,2035.92,18.2961,543.791 +1844,2037.84,16.6491,464.196 +1845,2049.54,19.163,545.224 +1846,2032.05,16.7824,458.099 +1847,2049.7,18.7222,535.018 +1848,2059.42,16.4096,467.476 +1849,2047.45,17.5496,520.781 +1850,2061.17,16.2882,475.92 +1851,2033.99,18.7794,540.559 +1852,2046.32,17.1356,477.259 +1853,2055.27,17.4364,506.677 +1854,2053.88,16.687,460.207 +1855,2037.45,18.9114,527.954 +1856,2055,18.7475,554.868 +1857,2034.97,17.5544,510.101 +1858,2048.2,19.4276,582.595 +1859,2043.46,17.6586,525.509 +1860,2063.37,18.9642,548.503 +1861,2053.73,18.4093,517.595 +1862,2059.04,19.4502,555.304 +1863,2052.41,18.062,511.283 +1864,2042.72,19.4067,549.81 +1865,2052.45,17.9354,528.752 +1866,2043.47,18.3999,543.59 +1867,2035.72,18.3682,534.428 +1868,2059.89,18.2939,526.784 +1869,2038.12,17.9999,518.686 +1870,2041.83,19.1742,536.329 +1871,2057.23,18.047,512.115 +1872,2029.33,16.8481,504.549 +1873,2061.09,15.3754,445.999 +1874,2057.16,16.3677,488.472 +1875,2035.92,15.3999,445.161 +1876,2053.83,17.0256,493.028 +1877,2057.06,15.4611,443.979 +1878,2049.73,16.6759,488.666 +1879,2053.45,14.6072,427.72 +1880,2056.25,18.4546,530.806 +1881,2052.64,15.5347,456.562 +1882,2046.79,18.2798,528.213 +1883,2049.42,15.4557,452.831 +1884,2039.25,18.5641,529.391 +1885,2050.61,14.4472,424.69 +1886,2063.44,18.8581,534.658 +1887,2047.64,15.4919,442.828 +1888,2044.58,17.1212,496.031 +1889,2033.08,18.8391,542.02 +1890,2057.15,17.4191,511.933 +1891,2031.75,18.4932,533.024 +1892,2036.98,17.309,496.093 +1893,2032.65,17.8386,497.206 +1894,2038.97,18.4506,523.416 +1895,2050.83,18.8911,546.857 +1896,2043.98,19.3386,535.266 +1897,2055.11,18.2596,539.794 +1898,2062.58,20.0306,561.773 +1899,2053.89,18.6353,550.072 +1900,2054.47,17.9506,532.184 +1901,2060.07,18.7224,539.609 +1902,2048.71,19.3794,532.471 +1903,2050.89,18.2688,528.452 +1904,2038.57,19.2051,540.818 +1905,2045.03,17.6812,505.024 +1906,2052.5,20.0139,558.519 +1907,2037.24,17.2052,494.932 +1908,2030.19,19.0312,539.81 +1909,2047.78,17.3007,495.849 +1910,2048.07,19.1616,535.271 +1911,2036.85,16.5505,479.091 +1912,2031.46,19.0584,533.742 +1913,2038.46,16.5956,482.677 +1914,2028.49,19.1325,550.921 +1915,2052.64,16.7251,494.334 +1916,2039.76,19.9223,547.295 +1917,2053.97,16.8545,485.551 +1918,2047.67,19.4587,547.88 +1919,2053.1,16.8495,490.571 +1920,2035.14,17.953,520.68 +1921,2044.1,17.0948,500.069 +1922,2040.85,18.1929,519.693 +1923,2035.7,16.9938,467.791 +1924,2055.82,17.7806,513.833 +1925,2057.91,17.1361,475.608 +1926,2041.81,17.1375,435.026 +1927,2050.3,18.7674,457.905 +1928,2029.48,15.9972,487.481 +1929,2050.07,17.92,512.524 +1930,2075.92,17.6453,513.056 +1931,2050.33,17.3128,508.523 +1932,2045.41,17.7477,479.77 +1933,2047.91,18.9264,503.928 +1934,2052.9,17.6111,506.723 +1935,2049.05,17.3543,478.156 +1936,2048.27,14.5418,455.009 +1937,2049.85,15.3985,469.609 +1938,2043.49,16.4077,493.397 +1939,2047.68,15.6829,481.244 +1940,2051.53,16.6347,469.791 +1941,2040.5,17.1197,475.171 +1942,2038.94,16.3672,467.528 +1943,2059.19,15.4289,456.866 +1944,2039.2,18.0406,607.477 +1945,2046.8,15.5853,474.301 +1946,2028.59,17.3819,574.333 +1947,2060.54,17.2734,501.804 +1948,2036.91,16.9405,521.511 +1949,2054.27,16.0947,471.514 +1950,2039.71,16.541,474.505 +1951,2065.61,14.9479,426.055 +1952,2048.86,15.5621,470.249 +1953,2040.75,20.9868,599.578 +1954,2048.31,15.7698,480.545 +1955,2044.96,20.7361,590.686 +1956,2043.69,14.8307,408.151 +1957,2053.17,20.1469,559.65 +1958,2030.18,15.7856,441.889 +1959,2059.41,19.9183,565.456 +1960,2035.76,16.2802,487.324 +1961,2045.05,19.9111,610.155 +1962,2056.49,16.6761,500.602 +1963,2056.57,21.2527,617.619 +1964,2039.23,16.3092,464.668 +1965,2043.6,20.4441,583.566 +1966,2062.26,15.9535,448.702 +1967,2044.13,20.8501,598.439 +1968,2040.45,16.4449,514.792 +1969,2057.88,17.5118,505.22 +1970,2043.12,15.5062,473.737 +1971,2053.61,16.8592,486.926 +1972,2046.31,16.3602,487.95 +1973,2044.75,16.087,461.727 +1974,2053.81,16.5443,478.646 +1975,2031.12,16.9786,464.599 +1976,2032.44,17.133,526.971 +1977,2052.04,17.6436,521.129 +1978,2040.51,17.4679,510.28 +1979,2045.63,17.3094,478.321 +1980,2043.57,16.8363,487.365 +1981,2036.68,16.8811,464.842 +1982,2032.04,17.3884,492.85 +1983,2042.09,16.9554,461.119 +1984,2051.23,17.4001,513.065 +1985,2038.57,17.0335,499.367 +1986,2038.48,18.0108,519.554 +1987,2029.23,17.4182,502.802 +1988,2032.04,18.0705,512.254 +1989,2049.5,16.7335,483.46 +1990,2044.36,17.0029,494.584 +1991,2037.36,17.986,507.251 +1992,2034.2,18.0669,517.99 +1993,2034.06,17.2482,500.37 +1994,2047.32,17.1973,513.959 +1995,2030.49,17.4069,511.461 +1996,2025.88,17.2651,507.278 +1997,2055.38,17.678,500.225 +1998,2049.54,17.2502,500.633 +1999,2037.14,17.373,499.283 +2000,2052.32,15.2058,456.462 +2001,2056.54,19.4121,555.155 +2002,2052.5,15.4887,468.134 +2003,2031.81,19.2773,549.625 +2004,2041.63,14.9182,440.177 +2005,2054.99,18.7893,526.852 +2006,2043.82,15.1541,448.766 +2007,2046.98,19.4611,546.728 +2008,2046.05,15.2975,456.838 +2009,2063.17,17.6113,516.842 +2010,2043.04,16.1395,471.552 +2011,2065.59,17.8877,535.091 +2012,2047.4,15.5958,457.147 +2013,2048.2,18.9875,527.218 +2014,2052.19,16.4321,469.217 +2015,2054.57,17.7289,521.547 +2016,2047.56,17.4463,518.849 +2017,2054.71,18.1238,528.398 +2018,2036.96,16.9122,519.554 +2019,2046.13,17.3315,501.046 +2020,2052.79,16.3381,495.668 +2021,2060.05,18.6889,550.563 +2022,2037.74,16.5749,494.434 +2023,2044.72,17.1375,515.542 +2024,2041.29,16.5371,504.158 +2025,2066.2,17.4746,503.88 +2026,2039.19,16.7512,515.237 +2027,2042.9,17.1811,496.074 +2028,2044.41,16.686,493.843 +2029,2041.87,17.6843,498.184 +2030,2042.43,16.6899,498.223 +2031,2051.88,17.2653,492.635 +2032,2044.28,17.7274,506.051 +2033,2039.18,17.7931,530.741 +2034,2051.7,16.3038,485.204 +2035,2035.54,17.8556,525.396 +2036,2031.2,16.2605,484.038 +2037,2055.13,17.9519,505.572 +2038,2051.25,16.6791,492.666 +2039,2049.34,17.2399,492.183 +2040,2047.07,18.2007,513.968 +2041,2047.16,17.0336,503.513 +2042,2038.13,17.6111,508.201 +2043,2041.51,17.2915,507.58 +2044,2053.42,16.2001,482.936 +2045,2057.08,17.6835,499.846 +2046,2043.41,16.659,494.299 +2047,2048.97,17.3077,503.157 +TABLE CRVTime +#channel,timeOffset +0,0 +1,-25.7385 +2,0 +3,-25.7385 +4,0 +5,-25.7385 +6,0 +7,-25.7385 +8,0 +9,-25.7385 +10,0 +11,-25.7385 +12,0 +13,-25.7385 +14,0 +15,-25.7385 +16,0 +17,-25.7385 +18,0 +19,-25.7385 +20,0 +21,-25.7385 +22,0 +23,-25.7385 +24,0 +25,-25.7385 +26,0 +27,-25.7385 +28,0 +29,-25.7385 +30,0 +31,-25.7385 +32,-0.0736953 +33,-26.0914 +34,-0.0736953 +35,-26.0914 +36,-0.0736953 +37,-26.0914 +38,-0.0736953 +39,-26.0914 +40,-0.0736953 +41,-26.0914 +42,-0.0736953 +43,-26.0914 +44,-0.0736953 +45,-26.0914 +46,-0.0736953 +47,-26.0914 +48,-0.0736953 +49,-26.0914 +50,-0.0736953 +51,-26.0914 +52,-0.0736953 +53,-26.0914 +54,-0.0736953 +55,-26.0914 +56,-0.0736953 +57,-26.0914 +58,-0.0736953 +59,-26.0914 +60,-0.0736953 +61,-26.0914 +62,-0.0736953 +63,-26.0914 +64,-1.08007 +65,-26.4429 +66,-1.08007 +67,-26.4429 +68,-1.08007 +69,-26.4429 +70,-1.08007 +71,-26.4429 +72,-1.08007 +73,-26.4429 +74,-1.08007 +75,-26.4429 +76,-1.08007 +77,-26.4429 +78,-1.08007 +79,-26.4429 +80,-1.08007 +81,-26.4429 +82,-1.08007 +83,-26.4429 +84,-1.08007 +85,-26.4429 +86,-1.08007 +87,-26.4429 +88,-1.08007 +89,-26.4429 +90,-1.08007 +91,-26.4429 +92,-1.08007 +93,-26.4429 +94,-1.08007 +95,-26.4429 +96,-1.73141 +97,-27.9203 +98,-1.73141 +99,-27.9203 +100,-1.73141 +101,-27.9203 +102,-1.73141 +103,-27.9203 +104,-1.73141 +105,-27.9203 +106,-1.73141 +107,-27.9203 +108,-1.73141 +109,-27.9203 +110,-1.73141 +111,-27.9203 +112,-1.73141 +113,-27.9203 +114,-1.73141 +115,-27.9203 +116,-1.73141 +117,-27.9203 +118,-1.73141 +119,-27.9203 +120,-1.73141 +121,-27.9203 +122,-1.73141 +123,-27.9203 +124,-1.73141 +125,-27.9203 +126,-1.73141 +127,-27.9203 +128,-1.91942 +129,-25.0117 +130,-1.91942 +131,-25.0117 +132,-1.91942 +133,-25.0117 +134,-1.91942 +135,-25.0117 +136,-1.91942 +137,-25.0117 +138,-1.91942 +139,-25.0117 +140,-1.91942 +141,-25.0117 +142,-1.91942 +143,-25.0117 +144,-1.91942 +145,-25.0117 +146,-1.91942 +147,-25.0117 +148,-1.91942 +149,-25.0117 +150,-1.91942 +151,-25.0117 +152,-1.91942 +153,-25.0117 +154,-1.91942 +155,-25.0117 +156,-1.91942 +157,-25.0117 +158,-1.91942 +159,-25.0117 +160,-1.81682 +161,-25.7646 +162,-1.81682 +163,-25.7646 +164,-1.81682 +165,-25.7646 +166,-1.81682 +167,-25.7646 +168,-1.81682 +169,-25.7646 +170,-1.81682 +171,-25.7646 +172,-1.81682 +173,-25.7646 +174,-1.81682 +175,-25.7646 +176,-1.81682 +177,-25.7646 +178,-1.81682 +179,-25.7646 +180,-1.81682 +181,-25.7646 +182,-1.81682 +183,-25.7646 +184,-1.81682 +185,-25.7646 +186,-1.81682 +187,-25.7646 +188,-1.81682 +189,-25.7646 +190,-1.81682 +191,-25.7646 +192,-7.48413 +193,-25.9679 +194,-7.48413 +195,-25.9679 +196,-7.48413 +197,-25.9679 +198,-7.48413 +199,-25.9679 +200,-7.48413 +201,-25.9679 +202,-7.48413 +203,-25.9679 +204,-7.48413 +205,-25.9679 +206,-7.48413 +207,-25.9679 +208,-7.48413 +209,-25.9679 +210,-7.48413 +211,-25.9679 +212,-7.48413 +213,-25.9679 +214,-7.48413 +215,-25.9679 +216,-7.48413 +217,-25.9679 +218,-7.48413 +219,-25.9679 +220,-7.48413 +221,-25.9679 +222,-7.48413 +223,-25.9679 +224,-2.71664 +225,-26.8578 +226,-2.71664 +227,-26.8578 +228,-2.71664 +229,-26.8578 +230,-2.71664 +231,-26.8578 +232,-2.71664 +233,-26.8578 +234,-2.71664 +235,-26.8578 +236,-2.71664 +237,-26.8578 +238,-2.71664 +239,-26.8578 +240,-2.71664 +241,-26.8578 +242,-2.71664 +243,-26.8578 +244,-2.71664 +245,-26.8578 +246,-2.71664 +247,-26.8578 +248,-2.71664 +249,-26.8578 +250,-2.71664 +251,-26.8578 +252,-2.71664 +253,-26.8578 +254,-2.71664 +255,-26.8578 +256,-110.29 +257,-27.5495 +258,-110.29 +259,-27.5495 +260,-110.29 +261,-27.5495 +262,-110.29 +263,-27.5495 +264,-110.29 +265,-27.5495 +266,-110.29 +267,-27.5495 +268,-110.29 +269,-27.5495 +270,-110.29 +271,-27.5495 +272,-110.29 +273,-27.5495 +274,-110.29 +275,-27.5495 +276,-110.29 +277,-27.5495 +278,-110.29 +279,-27.5495 +280,-110.29 +281,-27.5495 +282,-110.29 +283,-27.5495 +284,-110.29 +285,-27.5495 +286,-110.29 +287,-27.5495 +288,-110.378 +289,-27.2442 +290,-110.378 +291,-27.2442 +292,-110.378 +293,-27.2442 +294,-110.378 +295,-27.2442 +296,-110.378 +297,-27.2442 +298,-110.378 +299,-27.2442 +300,-110.378 +301,-27.2442 +302,-110.378 +303,-27.2442 +304,-110.378 +305,-27.2442 +306,-110.378 +307,-27.2442 +308,-110.378 +309,-27.2442 +310,-110.378 +311,-27.2442 +312,-110.378 +313,-27.2442 +314,-110.378 +315,-27.2442 +316,-110.378 +317,-27.2442 +318,-110.378 +319,-27.2442 +320,-111.322 +321,-27.8841 +322,-111.322 +323,-27.8841 +324,-111.322 +325,-27.8841 +326,-111.322 +327,-27.8841 +328,-111.322 +329,-27.8841 +330,-111.322 +331,-27.8841 +332,-111.322 +333,-27.8841 +334,-111.322 +335,-27.8841 +336,-111.322 +337,-27.8841 +338,-111.322 +339,-27.8841 +340,-111.322 +341,-27.8841 +342,-111.322 +343,-27.8841 +344,-111.322 +345,-27.8841 +346,-111.322 +347,-27.8841 +348,-111.322 +349,-27.8841 +350,-111.322 +351,-27.8841 +352,-111.77 +353,-28.7986 +354,-111.77 +355,-28.7986 +356,-111.77 +357,-28.7986 +358,-111.77 +359,-28.7986 +360,-111.77 +361,-28.7986 +362,-111.77 +363,-28.7986 +364,-111.77 +365,-28.7986 +366,-111.77 +367,-28.7986 +368,-111.77 +369,-28.7986 +370,-111.77 +371,-28.7986 +372,-111.77 +373,-28.7986 +374,-111.77 +375,-28.7986 +376,-111.77 +377,-28.7986 +378,-111.77 +379,-28.7986 +380,-111.77 +381,-28.7986 +382,-111.77 +383,-28.7986 +384,0.859676 +385,-27.4195 +386,0.859676 +387,-27.4195 +388,0.859676 +389,-27.4195 +390,0.859676 +391,-27.4195 +392,0.859676 +393,-27.4195 +394,0.859676 +395,-27.4195 +396,0.859676 +397,-27.4195 +398,0.859676 +399,-27.4195 +400,0.859676 +401,-27.4195 +402,0.859676 +403,-27.4195 +404,0.859676 +405,-27.4195 +406,0.859676 +407,-27.4195 +408,0.859676 +409,-27.4195 +410,0.859676 +411,-27.4195 +412,0.859676 +413,-27.4195 +414,0.859676 +415,-27.4195 +416,0.307585 +417,-28.3016 +418,0.307585 +419,-28.3016 +420,0.307585 +421,-28.3016 +422,0.307585 +423,-28.3016 +424,0.307585 +425,-28.3016 +426,0.307585 +427,-28.3016 +428,0.307585 +429,-28.3016 +430,0.307585 +431,-28.3016 +432,0.307585 +433,-28.3016 +434,0.307585 +435,-28.3016 +436,0.307585 +437,-28.3016 +438,0.307585 +439,-28.3016 +440,0.307585 +441,-28.3016 +442,0.307585 +443,-28.3016 +444,0.307585 +445,-28.3016 +446,0.307585 +447,-28.3016 +448,-0.903498 +449,-28.254 +450,-0.903498 +451,-28.254 +452,-0.903498 +453,-28.254 +454,-0.903498 +455,-28.254 +456,-0.903498 +457,-28.254 +458,-0.903498 +459,-28.254 +460,-0.903498 +461,-28.254 +462,-0.903498 +463,-28.254 +464,-0.903498 +465,-28.254 +466,-0.903498 +467,-28.254 +468,-0.903498 +469,-28.254 +470,-0.903498 +471,-28.254 +472,-0.903498 +473,-28.254 +474,-0.903498 +475,-28.254 +476,-0.903498 +477,-28.254 +478,-0.903498 +479,-28.254 +480,-1.25415 +481,-29.2265 +482,-1.25415 +483,-29.2265 +484,-1.25415 +485,-29.2265 +486,-1.25415 +487,-29.2265 +488,-1.25415 +489,-29.2265 +490,-1.25415 +491,-29.2265 +492,-1.25415 +493,-29.2265 +494,-1.25415 +495,-29.2265 +496,-1.25415 +497,-29.2265 +498,-1.25415 +499,-29.2265 +500,-1.25415 +501,-29.2265 +502,-1.25415 +503,-29.2265 +504,-1.25415 +505,-29.2265 +506,-1.25415 +507,-29.2265 +508,-1.25415 +509,-29.2265 +510,-1.25415 +511,-29.2265 +512,-11.5618 +513,-35.9992 +514,-11.5618 +515,-35.9992 +516,-11.5618 +517,-35.9992 +518,-11.5618 +519,-35.9992 +520,-11.5618 +521,-35.9992 +522,-11.5618 +523,-35.9992 +524,-11.5618 +525,-35.9992 +526,-11.5618 +527,-35.9992 +528,-11.5618 +529,-35.9992 +530,-11.5618 +531,-35.9992 +532,-11.5618 +533,-35.9992 +534,-11.5618 +535,-35.9992 +536,-11.5618 +537,-35.9992 +538,-11.5618 +539,-35.9992 +540,-11.5618 +541,-35.9992 +542,-11.5618 +543,-35.9992 +544,-11.5959 +545,-36.1518 +546,-11.5959 +547,-36.1518 +548,-11.5959 +549,-36.1518 +550,-11.5959 +551,-36.1518 +552,-11.5959 +553,-36.1518 +554,-11.5959 +555,-36.1518 +556,-11.5959 +557,-36.1518 +558,-11.5959 +559,-36.1518 +560,-11.5959 +561,-36.1518 +562,-11.5959 +563,-36.1518 +564,-11.5959 +565,-36.1518 +566,-11.5959 +567,-36.1518 +568,-11.5959 +569,-36.1518 +570,-11.5959 +571,-36.1518 +572,-11.5959 +573,-36.1518 +574,-11.5959 +575,-36.1518 +576,-12.1331 +577,-36.8342 +578,-12.1331 +579,-36.8342 +580,-12.1331 +581,-36.8342 +582,-12.1331 +583,-36.8342 +584,-12.1331 +585,-36.8342 +586,-12.1331 +587,-36.8342 +588,-12.1331 +589,-36.8342 +590,-12.1331 +591,-36.8342 +592,-12.1331 +593,-36.8342 +594,-12.1331 +595,-36.8342 +596,-12.1331 +597,-36.8342 +598,-12.1331 +599,-36.8342 +600,-12.1331 +601,-36.8342 +602,-12.1331 +603,-36.8342 +604,-12.1331 +605,-36.8342 +606,-12.1331 +607,-36.8342 +608,-12.6312 +609,-37.2225 +610,-12.6312 +611,-37.2225 +612,-12.6312 +613,-37.2225 +614,-12.6312 +615,-37.2225 +616,-12.6312 +617,-37.2225 +618,-12.6312 +619,-37.2225 +620,-12.6312 +621,-37.2225 +622,-12.6312 +623,-37.2225 +624,-12.6312 +625,-37.2225 +626,-12.6312 +627,-37.2225 +628,-12.6312 +629,-37.2225 +630,-12.6312 +631,-37.2225 +632,-12.6312 +633,-37.2225 +634,-12.6312 +635,-37.2225 +636,-12.6312 +637,-37.2225 +638,-12.6312 +639,-37.2225 +640,-7.65627 +641,-34.8577 +642,-7.65627 +643,-34.8577 +644,-7.65627 +645,-34.8577 +646,-7.65627 +647,-34.8577 +648,-7.65627 +649,-34.8577 +650,-7.65627 +651,-34.8577 +652,-7.65627 +653,-34.8577 +654,-7.65627 +655,-34.8577 +656,-7.65627 +657,-34.8577 +658,-7.65627 +659,-34.8577 +660,-7.65627 +661,-34.8577 +662,-7.65627 +663,-34.8577 +664,-7.65627 +665,-34.8577 +666,-7.65627 +667,-34.8577 +668,-7.65627 +669,-34.8577 +670,-7.65627 +671,-34.8577 +672,-8.9539 +673,-35.6287 +674,-8.9539 +675,-35.6287 +676,-8.9539 +677,-35.6287 +678,-8.9539 +679,-35.6287 +680,-8.9539 +681,-35.6287 +682,-8.9539 +683,-35.6287 +684,-8.9539 +685,-35.6287 +686,-8.9539 +687,-35.6287 +688,-8.9539 +689,-35.6287 +690,-8.9539 +691,-35.6287 +692,-8.9539 +693,-35.6287 +694,-8.9539 +695,-35.6287 +696,-8.9539 +697,-35.6287 +698,-8.9539 +699,-35.6287 +700,-8.9539 +701,-35.6287 +702,-8.9539 +703,-35.6287 +704,-8.59396 +705,-36.5347 +706,-8.59396 +707,-36.5347 +708,-8.59396 +709,-36.5347 +710,-8.59396 +711,-36.5347 +712,-8.59396 +713,-36.5347 +714,-8.59396 +715,-36.5347 +716,-8.59396 +717,-36.5347 +718,-8.59396 +719,-36.5347 +720,-8.59396 +721,-36.5347 +722,-8.59396 +723,-36.5347 +724,-8.59396 +725,-36.5347 +726,-8.59396 +727,-36.5347 +728,-8.59396 +729,-36.5347 +730,-8.59396 +731,-36.5347 +732,-8.59396 +733,-36.5347 +734,-8.59396 +735,-36.5347 +736,-9.72252 +737,-36.5938 +738,-9.72252 +739,-36.5938 +740,-9.72252 +741,-36.5938 +742,-9.72252 +743,-36.5938 +744,-9.72252 +745,-36.5938 +746,-9.72252 +747,-36.5938 +748,-9.72252 +749,-36.5938 +750,-9.72252 +751,-36.5938 +752,-9.72252 +753,-36.5938 +754,-9.72252 +755,-36.5938 +756,-9.72252 +757,-36.5938 +758,-9.72252 +759,-36.5938 +760,-9.72252 +761,-36.5938 +762,-9.72252 +763,-36.5938 +764,-9.72252 +765,-36.5938 +766,-9.72252 +767,-36.5938 +768,-8.38115 +769,-34.9249 +770,-8.38115 +771,-34.9249 +772,-8.38115 +773,-34.9249 +774,-8.38115 +775,-34.9249 +776,-8.38115 +777,-34.9249 +778,-8.38115 +779,-34.9249 +780,-8.38115 +781,-34.9249 +782,-8.38115 +783,-34.9249 +784,-8.38115 +785,-34.9249 +786,-8.38115 +787,-34.9249 +788,-8.38115 +789,-34.9249 +790,-8.38115 +791,-34.9249 +792,-8.38115 +793,-34.9249 +794,-8.38115 +795,-34.9249 +796,-8.38115 +797,-34.9249 +798,-8.38115 +799,-34.9249 +800,-9.18488 +801,-35.367 +802,-9.18488 +803,-35.367 +804,-9.18488 +805,-35.367 +806,-9.18488 +807,-35.367 +808,-9.18488 +809,-35.367 +810,-9.18488 +811,-35.367 +812,-9.18488 +813,-35.367 +814,-9.18488 +815,-35.367 +816,-9.18488 +817,-35.367 +818,-9.18488 +819,-35.367 +820,-9.18488 +821,-35.367 +822,-9.18488 +823,-35.367 +824,-9.18488 +825,-35.367 +826,-9.18488 +827,-35.367 +828,-9.18488 +829,-35.367 +830,-9.18488 +831,-35.367 +832,-8.97302 +833,-36.1733 +834,-8.97302 +835,-36.1733 +836,-8.97302 +837,-36.1733 +838,-8.97302 +839,-36.1733 +840,-8.97302 +841,-36.1733 +842,-8.97302 +843,-36.1733 +844,-8.97302 +845,-36.1733 +846,-8.97302 +847,-36.1733 +848,-8.97302 +849,-36.1733 +850,-8.97302 +851,-36.1733 +852,-8.97302 +853,-36.1733 +854,-8.97302 +855,-36.1733 +856,-8.97302 +857,-36.1733 +858,-8.97302 +859,-36.1733 +860,-8.97302 +861,-36.1733 +862,-8.97302 +863,-36.1733 +864,-9.92541 +865,-36.1389 +866,-9.92541 +867,-36.1389 +868,-9.92541 +869,-36.1389 +870,-9.92541 +871,-36.1389 +872,-9.92541 +873,-36.1389 +874,-9.92541 +875,-36.1389 +876,-9.92541 +877,-36.1389 +878,-9.92541 +879,-36.1389 +880,-9.92541 +881,-36.1389 +882,-9.92541 +883,-36.1389 +884,-9.92541 +885,-36.1389 +886,-9.92541 +887,-36.1389 +888,-9.92541 +889,-36.1389 +890,-9.92541 +891,-36.1389 +892,-9.92541 +893,-36.1389 +894,-9.92541 +895,-36.1389 +896,-9.62013 +897,-35.3906 +898,-9.62013 +899,-35.3906 +900,-9.62013 +901,-35.3906 +902,-9.62013 +903,-35.3906 +904,-9.62013 +905,-35.3906 +906,-9.62013 +907,-35.3906 +908,-9.62013 +909,-35.3906 +910,-9.62013 +911,-35.3906 +912,-9.62013 +913,-35.3906 +914,-9.62013 +915,-35.3906 +916,-9.62013 +917,-35.3906 +918,-9.62013 +919,-35.3906 +920,-9.62013 +921,-35.3906 +922,-9.62013 +923,-35.3906 +924,-9.62013 +925,-35.3906 +926,-9.62013 +927,-35.3906 +928,-10.1141 +929,-35.4659 +930,-10.1141 +931,-35.4659 +932,-10.1141 +933,-35.4659 +934,-10.1141 +935,-35.4659 +936,-10.1141 +937,-35.4659 +938,-10.1141 +939,-35.4659 +940,-10.1141 +941,-35.4659 +942,-10.1141 +943,-35.4659 +944,-10.1141 +945,-35.4659 +946,-10.1141 +947,-35.4659 +948,-10.1141 +949,-35.4659 +950,-10.1141 +951,-35.4659 +952,-10.1141 +953,-35.4659 +954,-10.1141 +955,-35.4659 +956,-10.1141 +957,-35.4659 +958,-10.1141 +959,-35.4659 +960,-10.9769 +961,-36.791 +962,-10.9769 +963,-36.791 +964,-10.9769 +965,-36.791 +966,-10.9769 +967,-36.791 +968,-10.9769 +969,-36.791 +970,-10.9769 +971,-36.791 +972,-10.9769 +973,-36.791 +974,-10.9769 +975,-36.791 +976,-10.9769 +977,-36.791 +978,-10.9769 +979,-36.791 +980,-10.9769 +981,-36.791 +982,-10.9769 +983,-36.791 +984,-10.9769 +985,-36.791 +986,-10.9769 +987,-36.791 +988,-10.9769 +989,-36.791 +990,-10.9769 +991,-36.791 +992,-11.1985 +993,-36.682 +994,-11.1985 +995,-36.682 +996,-11.1985 +997,-36.682 +998,-11.1985 +999,-36.682 +1000,-11.1985 +1001,-36.682 +1002,-11.1985 +1003,-36.682 +1004,-11.1985 +1005,-36.682 +1006,-11.1985 +1007,-36.682 +1008,-11.1985 +1009,-36.682 +1010,-11.1985 +1011,-36.682 +1012,-11.1985 +1013,-36.682 +1014,-11.1985 +1015,-36.682 +1016,-11.1985 +1017,-36.682 +1018,-11.1985 +1019,-36.682 +1020,-11.1985 +1021,-36.682 +1022,-11.1985 +1023,-36.682 +1024,0 +1025,-7.8 +1026,0 +1027,-7.8 +1028,0 +1029,-7.8 +1030,0 +1031,-7.8 +1032,0 +1033,-7.8 +1034,0 +1035,-7.8 +1036,0 +1037,-7.8 +1038,0 +1039,-7.8 +1040,0 +1041,-7.8 +1042,0 +1043,-7.8 +1044,0 +1045,-7.8 +1046,0 +1047,-7.8 +1048,0 +1049,-7.8 +1050,0 +1051,-7.8 +1052,0 +1053,-7.8 +1054,0 +1055,-7.8 +1056,0 +1057,-1.38305 +1058,0 +1059,-1.38305 +1060,0 +1061,-1.38305 +1062,0 +1063,-1.38305 +1064,0 +1065,-1.38305 +1066,0 +1067,-1.38305 +1068,0 +1069,-1.38305 +1070,0 +1071,-1.38305 +1072,0 +1073,-1.38305 +1074,0 +1075,-1.38305 +1076,0 +1077,-1.38305 +1078,0 +1079,-1.38305 +1080,0 +1081,-1.38305 +1082,0 +1083,-1.38305 +1084,0 +1085,-1.38305 +1086,0 +1087,-1.38305 +1088,0 +1089,-6.87076 +1090,0 +1091,-6.87076 +1092,0 +1093,-6.87076 +1094,0 +1095,-6.87076 +1096,0 +1097,-6.87076 +1098,0 +1099,-6.87076 +1100,0 +1101,-6.87076 +1102,0 +1103,-6.87076 +1104,0 +1105,-6.87076 +1106,0 +1107,-6.87076 +1108,0 +1109,-6.87076 +1110,0 +1111,-6.87076 +1112,0 +1113,-6.87076 +1114,0 +1115,-6.87076 +1116,0 +1117,-6.87076 +1118,0 +1119,-6.87076 +1120,0 +1121,-7.51252 +1122,0 +1123,-7.51252 +1124,0 +1125,-7.51252 +1126,0 +1127,-7.51252 +1128,0 +1129,-7.51252 +1130,0 +1131,-7.51252 +1132,0 +1133,-7.51252 +1134,0 +1135,-7.51252 +1136,0 +1137,-7.51252 +1138,0 +1139,-7.51252 +1140,0 +1141,-7.51252 +1142,0 +1143,-7.51252 +1144,0 +1145,-7.51252 +1146,0 +1147,-7.51252 +1148,0 +1149,-7.51252 +1150,0 +1151,-7.51252 +1152,0 +1153,-8.39475 +1154,0 +1155,-8.39475 +1156,0 +1157,-8.39475 +1158,0 +1159,-8.39475 +1160,0 +1161,-8.39475 +1162,0 +1163,-8.39475 +1164,0 +1165,-8.39475 +1166,0 +1167,-8.39475 +1168,0 +1169,-8.39475 +1170,0 +1171,-8.39475 +1172,0 +1173,-8.39475 +1174,0 +1175,-8.39475 +1176,0 +1177,-8.39475 +1178,0 +1179,-8.39475 +1180,0 +1181,-8.39475 +1182,0 +1183,-8.39475 +1184,0 +1185,-7.46913 +1186,0 +1187,-7.46913 +1188,0 +1189,-7.46913 +1190,0 +1191,-7.46913 +1192,0 +1193,-7.46913 +1194,0 +1195,-7.46913 +1196,0 +1197,-7.46913 +1198,0 +1199,-7.46913 +1200,0 +1201,-7.46913 +1202,0 +1203,-7.46913 +1204,0 +1205,-7.46913 +1206,0 +1207,-7.46913 +1208,0 +1209,-7.46913 +1210,0 +1211,-7.46913 +1212,0 +1213,-7.46913 +1214,0 +1215,-7.46913 +1216,0 +1217,-7.48525 +1218,0 +1219,-7.48525 +1220,0 +1221,-7.48525 +1222,0 +1223,-7.48525 +1224,0 +1225,-7.48525 +1226,0 +1227,-7.48525 +1228,0 +1229,-7.48525 +1230,0 +1231,-7.48525 +1232,0 +1233,-7.48525 +1234,0 +1235,-7.48525 +1236,0 +1237,-7.48525 +1238,0 +1239,-7.48525 +1240,0 +1241,-7.48525 +1242,0 +1243,-7.48525 +1244,0 +1245,-7.48525 +1246,0 +1247,-7.48525 +1248,0 +1249,-7.3202 +1250,0 +1251,-7.3202 +1252,0 +1253,-7.3202 +1254,0 +1255,-7.3202 +1256,0 +1257,-7.3202 +1258,0 +1259,-7.3202 +1260,0 +1261,-7.3202 +1262,0 +1263,-7.3202 +1264,0 +1265,-7.3202 +1266,0 +1267,-7.3202 +1268,0 +1269,-7.3202 +1270,0 +1271,-7.3202 +1272,0 +1273,-7.3202 +1274,0 +1275,-7.3202 +1276,0 +1277,-7.3202 +1278,0 +1279,-7.3202 +1280,0 +1281,-3.41809 +1282,0 +1283,-3.41809 +1284,0 +1285,-3.41809 +1286,0 +1287,-3.41809 +1288,0 +1289,-3.41809 +1290,0 +1291,-3.41809 +1292,0 +1293,-3.41809 +1294,0 +1295,-3.41809 +1296,0 +1297,-3.41809 +1298,0 +1299,-3.41809 +1300,0 +1301,-3.41809 +1302,0 +1303,-3.41809 +1304,0 +1305,-3.41809 +1306,0 +1307,-3.41809 +1308,0 +1309,-3.41809 +1310,0 +1311,-3.41809 +1312,0 +1313,-10.3223 +1314,0 +1315,-10.3223 +1316,0 +1317,-10.3223 +1318,0 +1319,-10.3223 +1320,0 +1321,-10.3223 +1322,0 +1323,-10.3223 +1324,0 +1325,-10.3223 +1326,0 +1327,-10.3223 +1328,0 +1329,-10.3223 +1330,0 +1331,-10.3223 +1332,0 +1333,-10.3223 +1334,0 +1335,-10.3223 +1336,0 +1337,-10.3223 +1338,0 +1339,-10.3223 +1340,0 +1341,-10.3223 +1342,0 +1343,-10.3223 +1344,0 +1345,-9.80276 +1346,0 +1347,-9.80276 +1348,0 +1349,-9.80276 +1350,0 +1351,-9.80276 +1352,0 +1353,-9.80276 +1354,0 +1355,-9.80276 +1356,0 +1357,-9.80276 +1358,0 +1359,-9.80276 +1360,0 +1361,-9.80276 +1362,0 +1363,-9.80276 +1364,0 +1365,-9.80276 +1366,0 +1367,-9.80276 +1368,0 +1369,-9.80276 +1370,0 +1371,-9.80276 +1372,0 +1373,-9.80276 +1374,0 +1375,-9.80276 +1376,0 +1377,-9.00478 +1378,0 +1379,-9.00478 +1380,0 +1381,-9.00478 +1382,0 +1383,-9.00478 +1384,0 +1385,-9.00478 +1386,0 +1387,-9.00478 +1388,0 +1389,-9.00478 +1390,0 +1391,-9.00478 +1392,0 +1393,-9.00478 +1394,0 +1395,-9.00478 +1396,0 +1397,-9.00478 +1398,0 +1399,-9.00478 +1400,0 +1401,-9.00478 +1402,0 +1403,-9.00478 +1404,0 +1405,-9.00478 +1406,0 +1407,-9.00478 +1408,0 +1409,-3.28825 +1410,0 +1411,-3.28825 +1412,0 +1413,-3.28825 +1414,0 +1415,-3.28825 +1416,0 +1417,-3.28825 +1418,0 +1419,-3.28825 +1420,0 +1421,-3.28825 +1422,0 +1423,-3.28825 +1424,0 +1425,-3.28825 +1426,0 +1427,-3.28825 +1428,0 +1429,-3.28825 +1430,0 +1431,-3.28825 +1432,0 +1433,-3.28825 +1434,0 +1435,-3.28825 +1436,0 +1437,-3.28825 +1438,0 +1439,-3.28825 +1440,0 +1441,-4.11412 +1442,0 +1443,-4.11412 +1444,0 +1445,-4.11412 +1446,0 +1447,-4.11412 +1448,0 +1449,-4.11412 +1450,0 +1451,-4.11412 +1452,0 +1453,-4.11412 +1454,0 +1455,-4.11412 +1456,0 +1457,-4.11412 +1458,0 +1459,-4.11412 +1460,0 +1461,-4.11412 +1462,0 +1463,-4.11412 +1464,0 +1465,-4.11412 +1466,0 +1467,-4.11412 +1468,0 +1469,-4.11412 +1470,0 +1471,-4.11412 +1472,0 +1473,-7.54427 +1474,0 +1475,-7.54427 +1476,0 +1477,-7.54427 +1478,0 +1479,-7.54427 +1480,0 +1481,-7.54427 +1482,0 +1483,-7.54427 +1484,0 +1485,-7.54427 +1486,0 +1487,-7.54427 +1488,0 +1489,-7.54427 +1490,0 +1491,-7.54427 +1492,0 +1493,-7.54427 +1494,0 +1495,-7.54427 +1496,0 +1497,-7.54427 +1498,0 +1499,-7.54427 +1500,0 +1501,-7.54427 +1502,0 +1503,-7.54427 +1504,0 +1505,-7.00764 +1506,0 +1507,-7.00764 +1508,0 +1509,-7.00764 +1510,0 +1511,-7.00764 +1512,0 +1513,-7.00764 +1514,0 +1515,-7.00764 +1516,0 +1517,-7.00764 +1518,0 +1519,-7.00764 +1520,0 +1521,-7.00764 +1522,0 +1523,-7.00764 +1524,0 +1525,-7.00764 +1526,0 +1527,-7.00764 +1528,0 +1529,-7.00764 +1530,0 +1531,-7.00764 +1532,0 +1533,-7.00764 +1534,0 +1535,-7.00764 +1536,-112 +1537,-24.8543 +1538,-112 +1539,-24.8543 +1540,-112 +1541,-24.8543 +1542,-112 +1543,-24.8543 +1544,-112 +1545,-24.8543 +1546,-112 +1547,-24.8543 +1548,-112 +1549,-24.8543 +1550,-112 +1551,-24.8543 +1552,-112 +1553,-24.8543 +1554,-112 +1555,-24.8543 +1556,-112 +1557,-24.8543 +1558,-112 +1559,-24.8543 +1560,-112 +1561,-24.8543 +1562,-112 +1563,-24.8543 +1564,-112 +1565,-24.8543 +1566,-112 +1567,-24.8543 +1568,-112.164 +1569,-26.3348 +1570,-112.164 +1571,-26.3348 +1572,-112.164 +1573,-26.3348 +1574,-112.164 +1575,-26.3348 +1576,-112.164 +1577,-26.3348 +1578,-112.164 +1579,-26.3348 +1580,-112.164 +1581,-26.3348 +1582,-112.164 +1583,-26.3348 +1584,-112.164 +1585,-26.3348 +1586,-112.164 +1587,-26.3348 +1588,-112.164 +1589,-26.3348 +1590,-112.164 +1591,-26.3348 +1592,-112.164 +1593,-26.3348 +1594,-112.164 +1595,-26.3348 +1596,-112.164 +1597,-26.3348 +1598,-112.164 +1599,-26.3348 +1600,-113.283 +1601,-26.3046 +1602,-113.283 +1603,-26.3046 +1604,-113.283 +1605,-26.3046 +1606,-113.283 +1607,-26.3046 +1608,-113.283 +1609,-26.3046 +1610,-113.283 +1611,-26.3046 +1612,-113.283 +1613,-26.3046 +1614,-113.283 +1615,-26.3046 +1616,-113.283 +1617,-26.3046 +1618,-113.283 +1619,-26.3046 +1620,-113.283 +1621,-26.3046 +1622,-113.283 +1623,-26.3046 +1624,-113.283 +1625,-26.3046 +1626,-113.283 +1627,-26.3046 +1628,-113.283 +1629,-26.3046 +1630,-113.283 +1631,-26.3046 +1632,-112.659 +1633,-26.9387 +1634,-112.659 +1635,-26.9387 +1636,-112.659 +1637,-26.9387 +1638,-112.659 +1639,-26.9387 +1640,-112.659 +1641,-26.9387 +1642,-112.659 +1643,-26.9387 +1644,-112.659 +1645,-26.9387 +1646,-112.659 +1647,-26.9387 +1648,-112.659 +1649,-26.9387 +1650,-112.659 +1651,-26.9387 +1652,-112.659 +1653,-26.9387 +1654,-112.659 +1655,-26.9387 +1656,-112.659 +1657,-26.9387 +1658,-112.659 +1659,-26.9387 +1660,-112.659 +1661,-26.9387 +1662,-112.659 +1663,-26.9387 +1664,-110.912 +1665,-25.81 +1666,-110.912 +1667,-25.81 +1668,-110.912 +1669,-25.81 +1670,-110.912 +1671,-25.81 +1672,-110.912 +1673,-25.81 +1674,-110.912 +1675,-25.81 +1676,-110.912 +1677,-25.81 +1678,-110.912 +1679,-25.81 +1680,-110.912 +1681,-25.81 +1682,-110.912 +1683,-25.81 +1684,-110.912 +1685,-25.81 +1686,-110.912 +1687,-25.81 +1688,-110.912 +1689,-25.81 +1690,-110.912 +1691,-25.81 +1692,-110.912 +1693,-25.81 +1694,-110.912 +1695,-25.81 +1696,-112.207 +1697,-26.4228 +1698,-112.207 +1699,-26.4228 +1700,-112.207 +1701,-26.4228 +1702,-112.207 +1703,-26.4228 +1704,-112.207 +1705,-26.4228 +1706,-112.207 +1707,-26.4228 +1708,-112.207 +1709,-26.4228 +1710,-112.207 +1711,-26.4228 +1712,-112.207 +1713,-26.4228 +1714,-112.207 +1715,-26.4228 +1716,-112.207 +1717,-26.4228 +1718,-112.207 +1719,-26.4228 +1720,-112.207 +1721,-26.4228 +1722,-112.207 +1723,-26.4228 +1724,-112.207 +1725,-26.4228 +1726,-112.207 +1727,-26.4228 +1728,-112.745 +1729,-27.4024 +1730,-112.745 +1731,-27.4024 +1732,-112.745 +1733,-27.4024 +1734,-112.745 +1735,-27.4024 +1736,-112.745 +1737,-27.4024 +1738,-112.745 +1739,-27.4024 +1740,-112.745 +1741,-27.4024 +1742,-112.745 +1743,-27.4024 +1744,-112.745 +1745,-27.4024 +1746,-112.745 +1747,-27.4024 +1748,-112.745 +1749,-27.4024 +1750,-112.745 +1751,-27.4024 +1752,-112.745 +1753,-27.4024 +1754,-112.745 +1755,-27.4024 +1756,-112.745 +1757,-27.4024 +1758,-112.745 +1759,-27.4024 +1760,-113.287 +1761,-27.6975 +1762,-113.287 +1763,-27.6975 +1764,-113.287 +1765,-27.6975 +1766,-113.287 +1767,-27.6975 +1768,-113.287 +1769,-27.6975 +1770,-113.287 +1771,-27.6975 +1772,-113.287 +1773,-27.6975 +1774,-113.287 +1775,-27.6975 +1776,-113.287 +1777,-27.6975 +1778,-113.287 +1779,-27.6975 +1780,-113.287 +1781,-27.6975 +1782,-113.287 +1783,-27.6975 +1784,-113.287 +1785,-27.6975 +1786,-113.287 +1787,-27.6975 +1788,-113.287 +1789,-27.6975 +1790,-113.287 +1791,-27.6975 +1792,-9.39071 +1793,-33.7366 +1794,-9.39071 +1795,-33.7366 +1796,-9.39071 +1797,-33.7366 +1798,-9.39071 +1799,-33.7366 +1800,-9.39071 +1801,-33.7366 +1802,-9.39071 +1803,-33.7366 +1804,-9.39071 +1805,-33.7366 +1806,-9.39071 +1807,-33.7366 +1808,-9.39071 +1809,-33.7366 +1810,-9.39071 +1811,-33.7366 +1812,-9.39071 +1813,-33.7366 +1814,-9.39071 +1815,-33.7366 +1816,-9.39071 +1817,-33.7366 +1818,-9.39071 +1819,-33.7366 +1820,-9.39071 +1821,-33.7366 +1822,-9.39071 +1823,-33.7366 +1824,-9.68167 +1825,-34.3477 +1826,-9.68167 +1827,-34.3477 +1828,-9.68167 +1829,-34.3477 +1830,-9.68167 +1831,-34.3477 +1832,-9.68167 +1833,-34.3477 +1834,-9.68167 +1835,-34.3477 +1836,-9.68167 +1837,-34.3477 +1838,-9.68167 +1839,-34.3477 +1840,-9.68167 +1841,-34.3477 +1842,-9.68167 +1843,-34.3477 +1844,-9.68167 +1845,-34.3477 +1846,-9.68167 +1847,-34.3477 +1848,-9.68167 +1849,-34.3477 +1850,-9.68167 +1851,-34.3477 +1852,-9.68167 +1853,-34.3477 +1854,-9.68167 +1855,-34.3477 +1856,-10.2832 +1857,-34.198 +1858,-10.2832 +1859,-34.198 +1860,-10.2832 +1861,-34.198 +1862,-10.2832 +1863,-34.198 +1864,-10.2832 +1865,-34.198 +1866,-10.2832 +1867,-34.198 +1868,-10.2832 +1869,-34.198 +1870,-10.2832 +1871,-34.198 +1872,-10.2832 +1873,-34.198 +1874,-10.2832 +1875,-34.198 +1876,-10.2832 +1877,-34.198 +1878,-10.2832 +1879,-34.198 +1880,-10.2832 +1881,-34.198 +1882,-10.2832 +1883,-34.198 +1884,-10.2832 +1885,-34.198 +1886,-10.2832 +1887,-34.198 +1888,-11.0998 +1889,-34.9693 +1890,-11.0998 +1891,-34.9693 +1892,-11.0998 +1893,-34.9693 +1894,-11.0998 +1895,-34.9693 +1896,-11.0998 +1897,-34.9693 +1898,-11.0998 +1899,-34.9693 +1900,-11.0998 +1901,-34.9693 +1902,-11.0998 +1903,-34.9693 +1904,-11.0998 +1905,-34.9693 +1906,-11.0998 +1907,-34.9693 +1908,-11.0998 +1909,-34.9693 +1910,-11.0998 +1911,-34.9693 +1912,-11.0998 +1913,-34.9693 +1914,-11.0998 +1915,-34.9693 +1916,-11.0998 +1917,-34.9693 +1918,-11.0998 +1919,-34.9693 +1920,-9.51745 +1921,-33.1018 +1922,-9.51745 +1923,-33.1018 +1924,-9.51745 +1925,-33.1018 +1926,-9.51745 +1927,-33.1018 +1928,-9.51745 +1929,-33.1018 +1930,-9.51745 +1931,-33.1018 +1932,-9.51745 +1933,-33.1018 +1934,-9.51745 +1935,-33.1018 +1936,-9.51745 +1937,-33.1018 +1938,-9.51745 +1939,-33.1018 +1940,-9.51745 +1941,-33.1018 +1942,-9.51745 +1943,-33.1018 +1944,-9.51745 +1945,-33.1018 +1946,-9.51745 +1947,-33.1018 +1948,-9.51745 +1949,-33.1018 +1950,-9.51745 +1951,-33.1018 +1952,-8.80054 +1953,-35.6314 +1954,-8.80054 +1955,-35.6314 +1956,-8.80054 +1957,-35.6314 +1958,-8.80054 +1959,-35.6314 +1960,-8.80054 +1961,-35.6314 +1962,-8.80054 +1963,-35.6314 +1964,-8.80054 +1965,-35.6314 +1966,-8.80054 +1967,-35.6314 +1968,-8.80054 +1969,-35.6314 +1970,-8.80054 +1971,-35.6314 +1972,-8.80054 +1973,-35.6314 +1974,-8.80054 +1975,-35.6314 +1976,-8.80054 +1977,-35.6314 +1978,-8.80054 +1979,-35.6314 +1980,-8.80054 +1981,-35.6314 +1982,-8.80054 +1983,-35.6314 +1984,-10.2604 +1985,-33.9637 +1986,-10.2604 +1987,-33.9637 +1988,-10.2604 +1989,-33.9637 +1990,-10.2604 +1991,-33.9637 +1992,-10.2604 +1993,-33.9637 +1994,-10.2604 +1995,-33.9637 +1996,-10.2604 +1997,-33.9637 +1998,-10.2604 +1999,-33.9637 +2000,-10.2604 +2001,-33.9637 +2002,-10.2604 +2003,-33.9637 +2004,-10.2604 +2005,-33.9637 +2006,-10.2604 +2007,-33.9637 +2008,-10.2604 +2009,-33.9637 +2010,-10.2604 +2011,-33.9637 +2012,-10.2604 +2013,-33.9637 +2014,-10.2604 +2015,-33.9637 +2016,-10.3946 +2017,-35.6793 +2018,-10.3946 +2019,-35.6793 +2020,-10.3946 +2021,-35.6793 +2022,-10.3946 +2023,-35.6793 +2024,-10.3946 +2025,-35.6793 +2026,-10.3946 +2027,-35.6793 +2028,-10.3946 +2029,-35.6793 +2030,-10.3946 +2031,-35.6793 +2032,-10.3946 +2033,-35.6793 +2034,-10.3946 +2035,-35.6793 +2036,-10.3946 +2037,-35.6793 +2038,-10.3946 +2039,-35.6793 +2040,-10.3946 +2041,-35.6793 +2042,-10.3946 +2043,-35.6793 +2044,-10.3946 +2045,-35.6793 +2046,-10.3946 +2047,-35.6793 diff --git a/CRVConditions/data/status_extracted_20260214.txt b/CRVConditions/data/status_extracted_20260214.txt new file mode 100644 index 0000000000..06380bb48a --- /dev/null +++ b/CRVConditions/data/status_extracted_20260214.txt @@ -0,0 +1,10 @@ +TABLE CRVBadChan +#A channel can have more than one status bit. Add all status bits for the complete status. +#status 1 (bit 0): not connected +#status 2 (bit 1): ignore channel in reconstruction +#status 4 (bit 2): no data +#status 8 (bit 3): no pedestal +#status 16 (bit 4): no calibration constant +#status 32 (bit 5): noisy +#channel,status +1107,3 diff --git a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl index e798ed99ee..575c4942e6 100644 --- a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl +++ b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl @@ -2,6 +2,6 @@ physics.analyzers.eventdisplay.extractedCrvOnly : true services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common_extracted.txt" -services.ProditionsService.crvStatus.useDb : false -services.ProditionsService.crvCalib.useDb : false -services.ProditionsService.crvCalib.pedestal : 2047 +services.ProditionsService.crvCalib.useDb : true +services.ProditionsService.crvStatus.useDb : true +services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260214.txt","Offline/CRVConditions/data/calib_extracted_20260214.txt"] From d239bb1c43d73d8320111e1cb5c77381134957b9 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sun, 15 Feb 2026 00:26:57 -0600 Subject: [PATCH 150/174] using actual CRV KPP calib constants --- EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl | 1 + 1 file changed, 1 insertion(+) diff --git a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl index 575c4942e6..1811863608 100644 --- a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl +++ b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl @@ -4,4 +4,5 @@ physics.analyzers.eventdisplay.extractedCrvOnly : true services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common_extracted.txt" services.ProditionsService.crvCalib.useDb : true services.ProditionsService.crvStatus.useDb : true +#outcomment this line, if displaying simulated events services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260214.txt","Offline/CRVConditions/data/calib_extracted_20260214.txt"] From 4f92b75d21181ba1eea408a982d6e9329e746316 Mon Sep 17 00:00:00 2001 From: echenard Date: Sun, 15 Feb 2026 15:01:41 -0600 Subject: [PATCH 151/174] Fixed comment format --- ConditionsService/data/conditions_01.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConditionsService/data/conditions_01.txt b/ConditionsService/data/conditions_01.txt index a798030ac4..11dd90c583 100644 --- a/ConditionsService/data/conditions_01.txt +++ b/ConditionsService/data/conditions_01.txt @@ -1 +1 @@ -#THIS IS A DEPRECATED FILE, DO NOT EDIT AND REMOVE ITS USE FROM YOUR SCRIPTS +//THIS IS A DEPRECATED FILE, DO NOT EDIT AND REMOVE ITS USE FROM YOUR SCRIPTS From ea39996d65667664e2f10d599e26f4c5e44b4d4c Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sun, 15 Feb 2026 20:44:48 -0600 Subject: [PATCH 152/174] minor changes to CRV calibration code --- CRVReco/src/CrvCalibration_module.cc | 3 ++- CRVReco/src/CrvTimingStudies_module.cc | 11 ++++++----- CRVReco/src/MakeCrvRecoPulses.cc | 5 ++++- EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 24895e30f1..7cc083417d 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -52,7 +52,7 @@ namespace mu2e fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; - fhicl::Atom maxFitDifference{Name("maxFitDifference"), Comment("maximum Difference between the TSpectrum peak and the fitted peak. Indicates fit problems."), 100.0}; + fhicl::Atom maxFitDifference{Name("maxFitDifference"), Comment("maximum difference between the TSpectrum peak and the fitted peak. Indicates fit problems."), 100.0}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; @@ -150,6 +150,7 @@ namespace mu2e std::ofstream outputFile; outputFile.open(_tmpDBfileName); + if(!outputFile.is_open()) throw cet::exception("CRVCALIB") << "Couldn't create output txt file " << _tmpDBfileName << "."; outputFile<<"TABLE CRVSiPM"<,TH1F*> _histTimeDiffs; @@ -75,7 +76,8 @@ namespace mu2e art::EDAnalyzer{conf}, _crvRecoPulsesModuleLabel(conf().crvRecoPulsesModuleLabel()), _PEthreshold(conf().PEthreshold()), - _removeTimeOffsets(conf().removeTimeOffsets()) + _removeTimeOffsets(conf().removeTimeOffsets()), + _firstEvent(true) { } @@ -99,10 +101,9 @@ namespace mu2e auto const& crvChannelMap = _crvChannelMap_h.get(event.id()); auto const& calib = _calib_h.get(event.id()); - static bool firstEvent=true; - if(firstEvent) + if(_firstEvent) { - firstEvent=false; + _firstEvent=false; //store channel map, pedestals and calibration constants in the file, //so that it can later be used to write a full calibration set @@ -197,7 +198,7 @@ namespace mu2e { art::ServiceHandle tfs; _histTimeDiffs[histIndex] = tfs->make(Form("fpgaTimeDiff_%i_%i",fpga1->first,fpga2->first), - Form("Time Diffs between FGPAs %i and %i;time difference [ns];Counts",fpga1->first,fpga2->first), + Form("Time Diffs between FPGAs %i and %i;time difference [ns];Counts",fpga1->first,fpga2->first), 300,-150,150); } diff --git a/CRVReco/src/MakeCrvRecoPulses.cc b/CRVReco/src/MakeCrvRecoPulses.cc index cc12280c26..d33386dade 100644 --- a/CRVReco/src/MakeCrvRecoPulses.cc +++ b/CRVReco/src/MakeCrvRecoPulses.cc @@ -32,7 +32,10 @@ MakeCrvRecoPulses::MakeCrvRecoPulses(float minADCdifference, float defaultBeta, _pulseAreaThreshold(pulseAreaThreshold), _doublePulseSeparation(doublePulseSeparation) { - if(_pulseAreaThreshold>_minADCdifference) _pulseAreaThreshold=_minADCdifference; + if(_pulseAreaThreshold>_minADCdifference) + throw cet::exception("CRVRECO_BAD_CONFIG") + << "MakeCrvRecoPulses pulseAreaThreshold " << _pulseAreaThreshold + << " larger than minADCdifference " << _minADCdifference; } void MakeCrvRecoPulses::FillGraphAndFindPeaks(const std::vector &waveform, uint16_t startTDC, diff --git a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl index 1811863608..e15ccaf87e 100644 --- a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl +++ b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl @@ -4,5 +4,5 @@ physics.analyzers.eventdisplay.extractedCrvOnly : true services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common_extracted.txt" services.ProditionsService.crvCalib.useDb : true services.ProditionsService.crvStatus.useDb : true -#outcomment this line, if displaying simulated events +#comment out this line, if displaying simulated events services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260214.txt","Offline/CRVConditions/data/calib_extracted_20260214.txt"] From 3f3c4c59f65ec65afb039a992a89dc8a59e2041d Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sun, 15 Feb 2026 21:20:14 -0600 Subject: [PATCH 153/174] more small changes to CRV calibration --- CRVReco/src/CrvCalibration_module.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 7cc083417d..7283815bdf 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -52,7 +52,10 @@ namespace mu2e fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; - fhicl::Atom maxFitDifference{Name("maxFitDifference"), Comment("maximum difference between the TSpectrum peak and the fitted peak. Indicates fit problems."), 100.0}; + fhicl::Atom maxFitDifferencePulseArea{Name("maxFitDifferencePulseArea"), + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse areas). Indicates fit problems."), 100.0}; + fhicl::Atom maxFitDifferencePulseHeight{Name("maxFitDifferencePulseHeight"), + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 4.0}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; @@ -62,7 +65,7 @@ namespace mu2e void analyze(const art::Event& e); void beginRun(const art::Run&); void endJob(); - bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak); + bool FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak, double maxFitDifference); private: std::string _crvRecoPulsesModuleLabel; @@ -74,7 +77,7 @@ namespace mu2e int _spectrumNPeaks; double _spectrumPeakSigma; double _spectrumPeakThreshold; - double _maxFitDifference; + double _maxFitDifferencePulseArea, _maxFitDifferencePulseHeight; std::string _tmpDBfileName; std::vector _calibHistsPulseArea; std::vector _calibHistsPulseHeight; @@ -101,7 +104,8 @@ namespace mu2e _spectrumNPeaks(conf().spectrumNPeaks()), _spectrumPeakSigma(conf().spectrumPeakSigma()), _spectrumPeakThreshold(conf().spectrumPeakThreshold()), - _maxFitDifference(conf().maxFitDifference()), + _maxFitDifferencePulseArea(conf().maxFitDifferencePulseArea()), + _maxFitDifferencePulseHeight(conf().maxFitDifferencePulseHeight()), _tmpDBfileName(conf().tmpDBfileName()) { } @@ -157,18 +161,14 @@ namespace mu2e for(channel=0; channel<_pedestals.size(); ++channel) { TH1F *hist; - double calibValue[2]; + double calibValue[2]={-1,-1}; for(int i=0; i<2; ++i) //loop over hisograms with pulse areas and pulse heights { if(i==1) hist=_calibHistsPulseArea.at(channel); else hist=_calibHistsPulseHeight.at(channel); double SPEpeak=-1; - if(!FindSPEpeak(hist, spectrum, function, SPEpeak, (i==0?_minPeakPulseHeight:_minPeakPulseArea))) - { - calibValue[i]=-1; - continue; - } + if(!FindSPEpeak(hist, spectrum, function, SPEpeak, (i==0?_minPeakPulseHeight:_minPeakPulseArea), (i==0?_maxFitDifferencePulseHeight:_maxFitDifferencePulseArea))) continue; calibValue[i]=SPEpeak; } @@ -232,7 +232,7 @@ namespace mu2e } } - bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak) + bool CrvCalibration::FindSPEpeak(TH1F *hist, TSpectrum &spectrum, TF1 &function, double &SPEpeak, double minPeak, double maxFitDifference) { if(hist->GetEntries()<_minHistEntries) return false; //not enough data @@ -260,7 +260,7 @@ namespace mu2e hist->Fit(&function, "QR"); SPEpeak = function.GetParameter(1); - if(fabs(SPEpeak-x)>_maxFitDifference) return false; + if(fabs(SPEpeak-x)>maxFitDifference) return false; if(SPEpeak Date: Mon, 16 Feb 2026 09:38:36 -0600 Subject: [PATCH 154/174] Address comments --- EventGenerator/src/DIOGenerator_tool.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/EventGenerator/src/DIOGenerator_tool.cc b/EventGenerator/src/DIOGenerator_tool.cc index 2ba069231e..e5078c18f5 100644 --- a/EventGenerator/src/DIOGenerator_tool.cc +++ b/EventGenerator/src/DIOGenerator_tool.cc @@ -35,6 +35,8 @@ namespace mu2e { _czmax(conf().czmax()), _spectrum(BinnedSpectrum(conf().spectrum.get())) { + if(_czmin > _czmax || _czmin < -1. || _czmax > 1.) throw cet::exception("BADCONFIG") << "DIOGenerator cos(theta_z) range is not defined\n"; + // compute normalization double integral(0.0); for(size_t ibin=0;ibin < _spectrum.getNbins();++ibin){ @@ -56,11 +58,14 @@ namespace mu2e { double pdfmin = _spectrum.getPDF(0); double binsize = _spectrum.getBinWidth(); fullintegral += 0.5*pdfmin*pmin/binsize; + std::cout << "Cos(theta_z) min " << _czmin << " max " << _czmax << std::endl; std::cout << "Restricted Spectrum min " << _spectrum.getAbscissa(0) << " max " << _spectrum.getAbscissa(_spectrum.getNbins()-1) << std::endl; std::cout << "Full Spectrum min " << fullspect.getAbscissa(0) << " max " << fullspect.getAbscissa(fullspect.getNbins()-1) << std::endl; std::cout << "Restricted Spectrum integral " << integral << std::endl; + std::cout << "Restricted Spectrum integral*cos(theta_z) restriction " << integral*((_cmax - _czmin)/2.) << std::endl; std::cout << "Full Spectrum integral " << fullintegral << std::endl; std::cout << "Sampled spectrum fraction " << integral/fullintegral << std::endl; + std::cout << "Sampled spectrum fraction (with cos(theta_z)) " << (integral/fullintegral)*((_czmax - _czmin)/2.) << std::endl; } @@ -76,7 +81,8 @@ namespace mu2e { PDGCode::type _pdgId; double _mass; - double _czmin, _czmax; + const double _czmin; + const double _czmax; BinnedSpectrum _spectrum; std::unique_ptr _randomUnitSphere; From 16c67611c36898cefe56b79f0adbee083fd4ac78 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Mon, 16 Feb 2026 09:40:17 -0600 Subject: [PATCH 155/174] Add cetlib include --- EventGenerator/src/DIOGenerator_tool.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/EventGenerator/src/DIOGenerator_tool.cc b/EventGenerator/src/DIOGenerator_tool.cc index e5078c18f5..432638e153 100644 --- a/EventGenerator/src/DIOGenerator_tool.cc +++ b/EventGenerator/src/DIOGenerator_tool.cc @@ -1,4 +1,5 @@ #include "art/Utilities/ToolMacros.h" +#include "cetlib_except/exception.h" #include "CLHEP/Random/RandPoissonQ.h" #include "CLHEP/Random/RandGeneral.h" From 670313a730b142de29c858189f9092fb612b4f7a Mon Sep 17 00:00:00 2001 From: oksuzian <48927306+oksuzian@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:26:56 -0600 Subject: [PATCH 156/174] Merge pull request #1733 from michaelmackenzie/CalLineTimePeak Run 1B: Calo cluster-based time clustering --- CalPatRec/CMakeLists.txt | 14 + CalPatRec/fcl/prolog.fcl | 14 + CalPatRec/src/CalLineTimePeakFinder_module.cc | 311 ++++++++++++++++++ 3 files changed, 339 insertions(+) create mode 100644 CalPatRec/src/CalLineTimePeakFinder_module.cc diff --git a/CalPatRec/CMakeLists.txt b/CalPatRec/CMakeLists.txt index ab4130494d..c252781dc7 100644 --- a/CalPatRec/CMakeLists.txt +++ b/CalPatRec/CMakeLists.txt @@ -67,6 +67,20 @@ cet_build_plugin(CalTimePeakFinder art::module Offline::TrackerGeom ) +cet_build_plugin(CalLineTimePeakFinder art::module + REG_SOURCE src/CalLineTimePeakFinder_module.cc + LIBRARIES REG + Offline::CalPatRec + + Offline::CalorimeterGeom + Offline::ConfigTools + Offline::GeometryService + Offline::Mu2eUtilities + Offline::RecoDataProducts + Offline::TrackerGeom + Offline::StoppingTargetGeom +) + cet_build_plugin(ComboHitFilter art::module REG_SOURCE src/ComboHitFilter_module.cc LIBRARIES REG diff --git a/CalPatRec/fcl/prolog.fcl b/CalPatRec/fcl/prolog.fcl index d2ef0ba024..ef033d7fb8 100644 --- a/CalPatRec/fcl/prolog.fcl +++ b/CalPatRec/fcl/prolog.fcl @@ -488,6 +488,20 @@ CalPatRec : { @table::CalPatRec } } + CalTimeClusterFinder : { + module_type : CalLineTimePeakFinder + DiagLevel : 0 + ComboHitCollectionLabel : "makeSH" + CaloClusterCollectionLabel : "CaloClusterMaker" + MinTimeClusterHits : 8 + MinCaloClusterEnergy : 50. + HitTimeSigmaThresh : 3. + HitXYSigmaThresh : 8. + StoppingTargetRadius : 200. + ParticleBeta : 1. + FitDirection : "downstream" + } + AgnosticHelixFinder : { module_type : AgnosticHelixFinder diagLevel : 0 diff --git a/CalPatRec/src/CalLineTimePeakFinder_module.cc b/CalPatRec/src/CalLineTimePeakFinder_module.cc new file mode 100644 index 0000000000..6580dd0034 --- /dev/null +++ b/CalPatRec/src/CalLineTimePeakFinder_module.cc @@ -0,0 +1,311 @@ +/////////////////////////////////////////////////////////////////////////////// +// Calorimeter-driven straight line time peak finding +// Michael MacKenzie (2026) +/////////////////////////////////////////////////////////////////////////////// + +// framework +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "fhiclcpp/ParameterSet.h" + +// Offline +#include "Offline/GeometryService/inc/GeomHandle.hh" +#include "Offline/CalorimeterGeom/inc/Calorimeter.hh" +#include "Offline/StoppingTargetGeom/inc/StoppingTarget.hh" + +#include "Offline/RecoDataProducts/inc/CaloCluster.hh" +#include "Offline/RecoDataProducts/inc/ComboHit.hh" +#include "Offline/RecoDataProducts/inc/TimeCluster.hh" +#include "Offline/RecoDataProducts/inc/TrkFitDirection.hh" + +//CLHEP +#include "CLHEP/Units/PhysicalConstants.h" + +// C++ +#include + +namespace mu2e { + + class CalLineTimePeakFinder : public art::EDProducer { + protected: + + //----------------------------------------------------------------------------- + // Main module configuration parameters + //----------------------------------------------------------------------------- + struct Config + { + using Name = fhicl::Name; + using Comment = fhicl::Comment; + fhicl::Atom diag_level {Name("DiagLevel"), Comment("Diagnostic output level"),0 }; + fhicl::Atom hit_coll_tag {Name("ComboHitCollectionLabel"), Comment(" Combo Hit Collection Label") }; + fhicl::Atom calo_cluster_coll_tag {Name("CaloClusterCollectionLabel"), Comment("CaloCluster Collection Label") }; + fhicl::Atom min_tc_hits {Name("MinTimeClusterHits"), Comment("Min NHits in TimeCluster") }; + fhicl::Atom min_calo_cluster_energy{Name("MinCaloClusterEnergy"), Comment("Min Calo Cluster Energy") }; + fhicl::Atom hit_time_sigma_thresh {Name("HitTimeSigmaThresh"), Comment("Time consistency threshold for hits to be added to the cluster (in sigma)") }; + fhicl::Atom hit_xy_sigma_thresh {Name("HitXYSigmaThresh"), Comment("Spatial consistency threshold for hits to be added to the cluster (in sigma)")}; + fhicl::Atom stopping_target_radius {Name("StoppingTargetRadius"), Comment("Radius of the stopping target in cone-making (in mm)")}; + fhicl::Atom particle_beta {Name("ParticleBeta"), Comment("Particle beta for distance to time (0-1)"), 1.}; + fhicl::Atom fit_direction {Name("FitDirection"), Comment("Fit Direction in Search (\"downstream\" or \"upstream\")") }; + }; + + //----------------------------------------------------------------------------- + // Inputs + //----------------------------------------------------------------------------- + art::InputTag hit_tag_; // input hit collection label + art::InputTag calo_cluster_tag_; // input calo cluster collection label + int min_tc_hits_; // N(hits) in the time cluster + float min_calo_cluster_energy_; // min energy of the associated calo cluster + float hit_time_sigma_thresh_; // time consistency threshold for hits to be added to the cluster + float hit_xy_sigma_thresh_; // spatial consistency threshold for hits to be added to the cluster + float stopping_target_radius_; // radius of the stopping target in cone-making (in mm) + float particle_beta_; // particle beta (v/c) + TrkFitDirection fit_dir_; // fit direction in search + int diag_level_; // diagnostic output + + //----------------------------------------------------------------------------- + // Data + //----------------------------------------------------------------------------- + const ComboHitCollection* combo_hit_col_; // input combo hit collection + const CaloClusterCollection* calo_cluster_col_; // input calo cluster collection + art::Handle combo_hit_col_handle_; // handle for input combo hit collection + art::Handle calo_cluster_col_handle_; // handle for input calo cluster collection + + const Calorimeter* calorimeter_ ; // calorimeter geometry + const StoppingTarget* stopping_target_; // stopping target geometry + CLHEP::Hep3Vector target_pos_; // position of the target center for seeding + double calo_d0_offset_; // z offset of the calorimeter disk 0 from the tracker system + double calo_d1_offset_; // z offset of the calorimeter disk 1 from the tracker system + public: + explicit CalLineTimePeakFinder(const art::EDProducer::Table& config); + virtual ~CalLineTimePeakFinder(); + + virtual void beginRun(art::Run& run ); + virtual void produce (art::Event& event ); + //----------------------------------------------------------------------------- + // helper functions + //----------------------------------------------------------------------------- + bool findData (const art::Event& e); + bool isGoodHit (const ComboHit& hit); + bool isGoodTimeCluster (const TimeCluster& tc); + void findTimePeakInCluster(TimeCluster& tc, const CaloCluster& cl); + void finalizeTimeCluster (TimeCluster& tc, const size_t cl_index); + }; + + //----------------------------------------------------------------------------- + // module constructor, parameter defaults are defined in CalPatRec/fcl/prolog.fcl + //----------------------------------------------------------------------------- + CalLineTimePeakFinder::CalLineTimePeakFinder(const art::EDProducer::Table& config) : + art::EDProducer{config} + , hit_tag_(config().hit_coll_tag()) + , calo_cluster_tag_(config().calo_cluster_coll_tag()) + , min_tc_hits_(config().min_tc_hits()) + , min_calo_cluster_energy_(config().min_calo_cluster_energy()) + , hit_time_sigma_thresh_(config().hit_time_sigma_thresh()) + , hit_xy_sigma_thresh_(config().hit_xy_sigma_thresh()) + , stopping_target_radius_(config().stopping_target_radius()) + , particle_beta_(config().particle_beta()) + , fit_dir_(config().fit_direction()) + , diag_level_(config().diag_level()) + { + // declare the data products + consumes(hit_tag_); + consumes(calo_cluster_tag_); + produces(); + } + + //----------------------------------------------------------------------------- + // destructor + //----------------------------------------------------------------------------- + CalLineTimePeakFinder::~CalLineTimePeakFinder() { + } + + //----------------------------------------------------------------------------- + void CalLineTimePeakFinder::beginRun(art::Run& ) { + mu2e::GeomHandle ch; + calorimeter_ = ch.get(); + + mu2e::GeomHandle sth; + stopping_target_ = sth.get(); + + // get the offset between the calo disks and the tracker system + calo_d0_offset_ = calorimeter_->geomUtil().mu2eToTracker(calorimeter_->geomUtil().diskToMu2e(0, CLHEP::Hep3Vector(0., 0., 0.))).z(); + calo_d1_offset_ = calorimeter_->geomUtil().mu2eToTracker(calorimeter_->geomUtil().diskToMu2e(1, CLHEP::Hep3Vector(0., 0., 0.))).z(); + + // get the target position in the tracker system + target_pos_ = calorimeter_->geomUtil().mu2eToTracker(stopping_target_->centerInMu2e()); + + } + + //----------------------------------------------------------------------------- + // find the input data objects + //----------------------------------------------------------------------------- + bool CalLineTimePeakFinder::findData(const art::Event& evt) { + combo_hit_col_ = nullptr; + calo_cluster_col_ = nullptr; + + evt.getByLabel(hit_tag_, combo_hit_col_handle_); + if(!combo_hit_col_handle_.isValid()) { + printf("[CalLineTimePeakFinder::%s] ERROR: ComboHit collection with label \"%s\" not found! RETURN\n", __func__, hit_tag_.encode().c_str()); + combo_hit_col_ = nullptr; + return false; + } else { + combo_hit_col_ = combo_hit_col_handle_.product(); + } + + evt.getByLabel(calo_cluster_tag_, calo_cluster_col_handle_); + if(!calo_cluster_col_handle_.isValid()) { + printf("[CalLineTimePeakFinder::%s] ERROR: CaloCluster collection with label \"%s\" not found! RETURN\n", __func__, calo_cluster_tag_.encode().c_str()); + calo_cluster_col_ = nullptr; + return false; + } else { + calo_cluster_col_ = calo_cluster_col_handle_.product(); + } + + return true; + } + + //----------------------------------------------------------------------------- + // Find time cluster around a calorimeter cluster + //----------------------------------------------------------------------------- + void CalLineTimePeakFinder::findTimePeakInCluster(TimeCluster& tc, const CaloCluster& cl) { + + const float cl_time = cl.time(); + const bool downstream = fit_dir_ == TrkFitDirection::FitDirection::downstream; + + CLHEP::Hep3Vector cl_pos = cl.cog3Vector(); + cl_pos.setZ(cl_pos.z() + (cl.diskID() == 0 ? calo_d0_offset_ : calo_d1_offset_)); // shift the cluster position to the tracker system + const double dz_target = cl_pos.z() - target_pos_.z(); // z distance from the target to the cluster + + CLHEP::Hep3Vector seed_dir = (downstream) ? cl_pos - target_pos_ : target_pos_ - cl_pos; + const double seed_dir_mag = seed_dir.mag(); + if(seed_dir_mag <= 0.) return; // can't define a seed direction + seed_dir *= 1./seed_dir_mag; // normalize the seed direction + if(std::fabs(seed_dir.z()) < 1.e-3) return; // too sharp of a slope (shouldn't be possible) + if(diag_level_ > 1) { + printf("[CalLineTimePeakFinder::%s] CaloCluster time = %.2f, position = (%.1f, %.1f, %.1f), seed direction = (%.2f, %.2f, %.2f)\n", + __func__, cl_time, cl_pos.x(), cl_pos.y(), cl_pos.z(), seed_dir.x(), seed_dir.y(), seed_dir.z()); + } + + // Look for hits consistent this seed position and direction, and add them to the seed + const size_t n_hits = combo_hit_col_->size(); + for(size_t i_hit = 0; i_hit < n_hits; ++i_hit) { + const auto& hit = combo_hit_col_->at(i_hit); + if(!isGoodHit(hit)) continue; // skip hits that don't pass selection + const CLHEP::Hep3Vector hit_pos(hit.pos().x(), hit.pos().y(), hit.pos().z()); + const double hit_time = hit.correctedTime(); + const double dz = hit_pos.z() - cl_pos.z(); // distance along z to the hit + const double dr = dz/seed_dir.z(); // distance along the trajectory to the hit location in z + const double dt = dr / (particle_beta_*CLHEP::c_light); // time of flight to the hit z location + const double time_at_hit = cl_time + dt; // expected time at the hit z position + const double time_unc = std::sqrt(hit.timeRes()*hit.timeRes() + cl.timeErr()*cl.timeErr()); // uncertainty on the time difference between the hit and the expected time based on the seed + const double time_sigma = std::abs((hit_time - time_at_hit) / time_unc); // number of sigma the hit time is from the expected time based on the seed + if(diag_level_ > 2) { + printf(" Hit %zu: time = %.2f, expected time = %.2f, time sigma = %.2f\n", + i_hit, hit_time, time_at_hit, time_sigma); + } + if(time_sigma > hit_time_sigma_thresh_) continue; // hit is not consistent with the seed, so skip it + + // next check if the hit is consistent in space + const CLHEP::Hep3Vector pos_at_hit = cl_pos + dr * seed_dir; // position along the seed direction at the same z as the hit + const double x_y_dist = (hit_pos - pos_at_hit).perp(); // distance in the x-y plane between the hit and the expected position based on the seed + const double cone = std::abs(dz/dz_target) * stopping_target_radius_; // radius of the cone in the x-y plane at the hit z based on the seed direction and cluster position + const double xy_unc = std::sqrt(hit.transVar() + hit.wireVar()); // uncertainty in the hit position in the x-y plane + const double xy_sigma = (x_y_dist - cone) / xy_unc; // number of sigma the hit is from the cone from the cluster to the target, negative means contained within the cone + if(diag_level_ > 2) { + printf(" Expected position at hit z: (%.1f, %.1f, %.1f), hit position: (%.1f, %.1f, %.1f), x-y distance = %.2f, target cone = %.2f, sigma = %.2f\n", + pos_at_hit.x(), pos_at_hit.y(), pos_at_hit.z(), hit_pos.x(), hit_pos.y(), hit_pos.z(), x_y_dist, cone, xy_sigma); + } + if(xy_sigma > hit_xy_sigma_thresh_) continue; // hit is not consistent with the seed + tc._strawHitIdxs.push_back(i_hit); + } + } + + //----------------------------------------------------------------------------- + // event entry point + //----------------------------------------------------------------------------- + void CalLineTimePeakFinder::produce(art::Event& event ) { + + // output collection + std::unique_ptr out_tcs(new TimeClusterCollection); + + //----------------------------------------------------------------------------- + // find the data + //----------------------------------------------------------------------------- + + const bool valid_data = findData(event); + + //----------------------------------------------------------------------------- + // Search around each calo cluster for time peaks + //----------------------------------------------------------------------------- + + if(valid_data) { + const size_t n_clusters = calo_cluster_col_->size(); + for(size_t i_cl = 0; i_cl < n_clusters; ++i_cl) { + const auto& cl = calo_cluster_col_->at(i_cl); + if(diag_level_ > 1) { + printf("[CalLineTimePeakFinder::%s] Seeding from CaloCluster %zu with energy = %.2f, time = %.2f, N(combo hits) = %zu\n", + __func__, i_cl, cl.energyDep(), cl.time(), combo_hit_col_->size()); + } + if(cl.energyDep() < min_calo_cluster_energy_) continue; // skip clusters that don't pass the energy cut + TimeCluster tc; + findTimePeakInCluster(tc, cl); + if(!isGoodTimeCluster(tc)) continue; // skip time clusters that don't pass selection criteria + finalizeTimeCluster(tc, i_cl); + out_tcs->push_back(std::move(tc)); + } + } + + //----------------------------------------------------------------------------- + // put reconstructed time clusters into the event record + //----------------------------------------------------------------------------- + + if(diag_level_ > 0) { + printf("[CalLineTimePeakFinder::%s] Found %zu time clusters in total\n", __func__, out_tcs->size()); + } + event.put(std::move(out_tcs)); + } + + //----------------------------------------------------------------------------- + bool CalLineTimePeakFinder::isGoodHit(const ComboHit& hit) { + const auto& flag = hit.flag(); + const int bkg_hit = flag.hasAnyProperty(StrawHitFlag::bkg); + if (bkg_hit != 0) return false; + return true; + } + + //----------------------------------------------------------------------------- + bool CalLineTimePeakFinder::isGoodTimeCluster(const TimeCluster& tc) { + if(int(tc.nhits()) < min_tc_hits_) return false; // not enough hits in the time cluster + return true; + } + + //----------------------------------------------------------------------------- + void CalLineTimePeakFinder::finalizeTimeCluster(TimeCluster& tc, size_t cl_index) { + tc._caloCluster = art::Ptr(calo_cluster_col_handle_, cl_index); + XYZVectorF tc_pos(0.,0.,0.); + double avg_t0 = 0.; + double t0sq = 0.; + double weight = 0.; + for(size_t hit_index : tc._strawHitIdxs) { + const auto& hit = combo_hit_col_->at(hit_index); + tc._nsh += hit.nStrawHits(); + tc_pos += hit.pos() * hit.nStrawHits(); + avg_t0 += hit.correctedTime() * hit.nStrawHits(); + t0sq += std::pow(hit.correctedTime(), 2) * hit.nStrawHits(); + weight += hit.nStrawHits(); + } + if(weight > 0.) { + avg_t0 /= weight; + t0sq /= weight; + tc_pos /= weight; + } + tc._pos = tc_pos; + tc._t0._t0 = avg_t0; + tc._t0._t0err = std::sqrt(std::max(0., t0sq - avg_t0*avg_t0)); + } + +} // end namespace mu2e + +using mu2e::CalLineTimePeakFinder; +DEFINE_ART_MODULE(CalLineTimePeakFinder) From 331511e80a24905f4b4823b49751b6817bb5965d Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Mon, 16 Feb 2026 09:54:00 -0600 Subject: [PATCH 157/174] Fix typo --- EventGenerator/src/DIOGenerator_tool.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EventGenerator/src/DIOGenerator_tool.cc b/EventGenerator/src/DIOGenerator_tool.cc index 432638e153..d609ac5aa5 100644 --- a/EventGenerator/src/DIOGenerator_tool.cc +++ b/EventGenerator/src/DIOGenerator_tool.cc @@ -63,7 +63,7 @@ namespace mu2e { std::cout << "Restricted Spectrum min " << _spectrum.getAbscissa(0) << " max " << _spectrum.getAbscissa(_spectrum.getNbins()-1) << std::endl; std::cout << "Full Spectrum min " << fullspect.getAbscissa(0) << " max " << fullspect.getAbscissa(fullspect.getNbins()-1) << std::endl; std::cout << "Restricted Spectrum integral " << integral << std::endl; - std::cout << "Restricted Spectrum integral*cos(theta_z) restriction " << integral*((_cmax - _czmin)/2.) << std::endl; + std::cout << "Restricted Spectrum integral*cos(theta_z) restriction " << integral*((_czmax - _czmin)/2.) << std::endl; std::cout << "Full Spectrum integral " << fullintegral << std::endl; std::cout << "Sampled spectrum fraction " << integral/fullintegral << std::endl; std::cout << "Sampled spectrum fraction (with cos(theta_z)) " << (integral/fullintegral)*((_czmax - _czmin)/2.) << std::endl; From 0cb1dcafdc0d720130dcd2c597cc86f4a08f3750 Mon Sep 17 00:00:00 2001 From: Richard Bonventre Date: Mon, 16 Feb 2026 13:18:50 -0600 Subject: [PATCH 158/174] More verbose error when no TID found --- DbService/inc/DbEngine.hh | 1 + DbService/inc/DbHandle.hh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DbService/inc/DbEngine.hh b/DbService/inc/DbEngine.hh index b4f8aac909..efb2dd64df 100644 --- a/DbService/inc/DbEngine.hh +++ b/DbService/inc/DbEngine.hh @@ -33,6 +33,7 @@ class DbEngine { // these must be set before beginJob is called void setDbId(DbId const& id) { _id = id; } void setVersion(DbVersion const& version) { _version = version; } + DbVersion const& version() const { return _version; } // copy in the cache - optionally set before beginJob void setValCache(std::shared_ptr vcache) { _vcache = vcache; } // add tables directly - optionally set before beginJob diff --git a/DbService/inc/DbHandle.hh b/DbService/inc/DbHandle.hh index 4930ec02f0..759645e527 100644 --- a/DbService/inc/DbHandle.hh +++ b/DbService/inc/DbHandle.hh @@ -53,7 +53,10 @@ bool mu2e::DbHandle::current(art::EventID const& eid) { if (_tid < 0) { // table not defined in the engine throw cet::exception("DBHANDLE_NO_TID") << "DbHandle could not get TID (Table ID) from DbEngine for " << _name - << " at first use "; + << " at first use " << std::endl + << "You are currently using DB calibration set " + << _dbh->engine().version().to_string() << std::endl + << "See https://mu2einternalwiki.fnal.gov/wiki/CalibrationSets for more info" << std::endl; } } From 726d5029cfb303ef819bb7a36f3eafb566528295 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Mon, 16 Feb 2026 15:21:48 -0800 Subject: [PATCH 159/174] Change type --- Filters/src/RandomPrescaleFilter_module.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Filters/src/RandomPrescaleFilter_module.cc b/Filters/src/RandomPrescaleFilter_module.cc index 80ad88dcb7..2e8da1f094 100644 --- a/Filters/src/RandomPrescaleFilter_module.cc +++ b/Filters/src/RandomPrescaleFilter_module.cc @@ -58,7 +58,7 @@ namespace mu2e prescale_(conf().nPrescale()), nevt_(0), npass_(0) { - produces(); + produces(); } inline bool RandomPrescaleFilter::filter(art::Event & event) From 03b1b4bde704870cd73301255af73bc0d6f6cc94 Mon Sep 17 00:00:00 2001 From: Richard Bonventre Date: Tue, 17 Feb 2026 08:18:29 -0600 Subject: [PATCH 160/174] fix endline --- DbService/inc/DbHandle.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DbService/inc/DbHandle.hh b/DbService/inc/DbHandle.hh index 759645e527..9b46f9034b 100644 --- a/DbService/inc/DbHandle.hh +++ b/DbService/inc/DbHandle.hh @@ -53,10 +53,10 @@ bool mu2e::DbHandle::current(art::EventID const& eid) { if (_tid < 0) { // table not defined in the engine throw cet::exception("DBHANDLE_NO_TID") << "DbHandle could not get TID (Table ID) from DbEngine for " << _name - << " at first use " << std::endl + << " at first use\n" << "You are currently using DB calibration set " - << _dbh->engine().version().to_string() << std::endl - << "See https://mu2einternalwiki.fnal.gov/wiki/CalibrationSets for more info" << std::endl; + << _dbh->engine().version().to_string() << "\n" + << "See https://mu2einternalwiki.fnal.gov/wiki/CalibrationSets for more info\n"; } } From 8d5e23d93d6bcdcfecf02df79122d6497e74f213 Mon Sep 17 00:00:00 2001 From: Paolo Girotti Date: Tue, 17 Feb 2026 09:08:31 -0600 Subject: [PATCH 161/174] file name change --- CaloVisualizer/inc/THMu2eCaloDisk.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaloVisualizer/inc/THMu2eCaloDisk.hh b/CaloVisualizer/inc/THMu2eCaloDisk.hh index 2a3a3b3a04..aef3366fd0 100644 --- a/CaloVisualizer/inc/THMu2eCaloDisk.hh +++ b/CaloVisualizer/inc/THMu2eCaloDisk.hh @@ -158,7 +158,7 @@ public: void SetBinCombineMode(Int_t bin, Int_t mode); void SetCombineMode(Int_t mode); void SetCombineMode(const char* formula); - bool LoadMapFile(std::map>& output, const char* filename = "Offline/CaloConditions/data/caloDMAP_20250827.dat"); + bool LoadMapFile(std::map>& output, const char* filename = "Offline/CaloConditions/data/caloDMAP_nominal.dat"); bool LoadMapDB(std::map>& output); Int_t FillOffline(int SiPMId, Double_t w); From abf10fa3cd9bbee81473512cc2203f7f15ee36ee Mon Sep 17 00:00:00 2001 From: echenard Date: Tue, 17 Feb 2026 20:40:23 -0600 Subject: [PATCH 162/174] More fixed from AI, fixed bug in DigitizationBuffer initialization in CaloShowerROMaker, restored copy of conditions_01.txt --- Analyses/src/CaloHitFinderInspect_module.cc | 1 - CaloMC/src/CaloNoiseSimGenerator.cc | 2 +- CaloMC/src/CaloPhotonPropagation.cc | 2 +- CaloReco/fcl/common.fcl | 2 +- ConditionsService/CMakeLists.txt | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Analyses/src/CaloHitFinderInspect_module.cc b/Analyses/src/CaloHitFinderInspect_module.cc index acc629a4d7..6ffc79ebdc 100644 --- a/Analyses/src/CaloHitFinderInspect_module.cc +++ b/Analyses/src/CaloHitFinderInspect_module.cc @@ -16,7 +16,6 @@ #include "messagefacility/MessageLogger/MessageLogger.h" #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" -//#include "Offline/ConditionsService/inc/ConditionsHandle.hh" #include "Offline/GeometryService/inc/GeomHandle.hh" #include "Offline/GeometryService/inc/GeometryService.hh" #include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh" diff --git a/CaloMC/src/CaloNoiseSimGenerator.cc b/CaloMC/src/CaloNoiseSimGenerator.cc index db9133d0f5..6b03fbe8ce 100644 --- a/CaloMC/src/CaloNoiseSimGenerator.cc +++ b/CaloMC/src/CaloNoiseSimGenerator.cc @@ -81,7 +81,7 @@ namespace mu2e { for (auto& val : wfVector) val += randGauss_.fire(0.0,noiseADC); //estimate pedestal for this waveform - set it to theoretical value for the time being - pedestal_ = std::floor(noiseRinDark_*digiSampling_*std::accumulate(pulse.begin(),pulse.end(),0.0)*scaleFactor); + pedestal_ = std::trunc(noiseRinDark_*digiSampling_*std::accumulate(pulse.begin(),pulse.end(),0.0)*scaleFactor); } //------------------------------------------------------------------------------------------------------------------ diff --git a/CaloMC/src/CaloPhotonPropagation.cc b/CaloMC/src/CaloPhotonPropagation.cc index 42ff6d82a0..7f28472a0e 100644 --- a/CaloMC/src/CaloPhotonPropagation.cc +++ b/CaloMC/src/CaloPhotonPropagation.cc @@ -34,7 +34,7 @@ namespace mu2e { TH2F *hist(0); TFile file(fullFileName.c_str()); if (file.IsOpen()) hist = (TH2F*) file.Get(histName_.c_str()); - if (!hist) throw cet::exception("CATEGORY")<<"CaloROStepMaker:: Hitsogram "<SetDirectory(0); file.Close(); diff --git a/CaloReco/fcl/common.fcl b/CaloReco/fcl/common.fcl index c82cde0c56..7e54a02f73 100644 --- a/CaloReco/fcl/common.fcl +++ b/CaloReco/fcl/common.fcl @@ -6,7 +6,7 @@ BEGIN_PROLOG pulseFileName : "OfflineData/ConditionsService/CsI-waveform-2020-02-12.root" pulseHistName : "h_waveform" readoutPEPerMeV : 30.0 - MeVToADC : 16 + MeVToADC : 16.0 ADCToMeV : 0.0625 END_PROLOG diff --git a/ConditionsService/CMakeLists.txt b/ConditionsService/CMakeLists.txt index b144cd344c..3d8afffe46 100644 --- a/ConditionsService/CMakeLists.txt +++ b/ConditionsService/CMakeLists.txt @@ -17,6 +17,7 @@ cet_build_plugin(ConditionsService art::service ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/conditions_01.txt ${CURRENT_BINARY_DIR} data/conditions_01.txt ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_dt_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_dt_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_ep_vs_path_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_ep_vs_path_v4_2_4.tab ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/pid_ele_xs_v4_2_4.tab ${CURRENT_BINARY_DIR} data/pid_ele_xs_v4_2_4.tab ) From 6f6949389f732831cdab5b2c78b201f5981edf86 Mon Sep 17 00:00:00 2001 From: giro94 Date: Fri, 20 Feb 2026 10:04:35 -0600 Subject: [PATCH 163/174] mark event as const in utility function --- DAQ/inc/CaloDAQUtilities.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DAQ/inc/CaloDAQUtilities.hh b/DAQ/inc/CaloDAQUtilities.hh index 5b4230e6cd..00cf3c1ee3 100644 --- a/DAQ/inc/CaloDAQUtilities.hh +++ b/DAQ/inc/CaloDAQUtilities.hh @@ -137,7 +137,7 @@ public: // Function to get art fragments from event - artdaq::Fragments getFragments(art::Event& event) { + artdaq::Fragments getFragments(art::Event const& event) { artdaq::Fragments fragments; artdaq::FragmentPtrs containerFragments; From d4746c6374db800a18148d5314bfdf7b87eedf7d Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sat, 21 Feb 2026 15:28:46 -0600 Subject: [PATCH 164/174] bug fix in CRV reco time offsets --- CRVReco/fcl/prolog_v11.fcl | 5 +---- CRVReco/fcl/prolog_v12.fcl | 4 +--- CRVReco/src/CrvRecoPulsesFinder_module.cc | 16 ++++------------ CRVResponse/fcl/prolog_v11.fcl | 5 +---- CRVResponse/fcl/prolog_v12.fcl | 5 +---- .../src/CrvWaveformsGenerator_module.cc | 18 ++++-------------- 6 files changed, 12 insertions(+), 41 deletions(-) diff --git a/CRVReco/fcl/prolog_v11.fcl b/CRVReco/fcl/prolog_v11.fcl index 4f08e67f28..6a45ace931 100644 --- a/CRVReco/fcl/prolog_v11.fcl +++ b/CRVReco/fcl/prolog_v11.fcl @@ -56,6 +56,7 @@ BEGIN_PROLOG //threshold used to determine the pulse area for the no-fit option doublePulseSeparation : 0.25 //25% of both ADC peaks of the double pulse //threshold at which double pulses can be separated in the no-fit option + useTimeOffsetDB : true //applies time offsets from the DB timeOffsetScale : 1.0 //scale factor for the time offsets from the database //examples: //-if a database table of measured time offset is used, @@ -63,10 +64,6 @@ BEGIN_PROLOG //-if a database table of a random gaussian distribution of time offsets // with a sigma equal to 1ns is used and one wants to run a simulation with a sigma of 0.5ns, // then the scale factor should be set to 0.5 (i.e. scaled to a sigma of 50%) - timeOffsetCutoffLow :-3.0 //the time offsets are cut off at -3ns - timeOffsetCutoffHigh : 3.0 //the time offsets are cut off at +3ns - //note: if measured time offsets are used, the cutoffs should be set to the maximum values - useTimeOffsetDB : true //applies time offsets from the DB ignoreChannels : true //ignore channels that have status bit 1 ("ignore channels") in CRVstatus DB } diff --git a/CRVReco/fcl/prolog_v12.fcl b/CRVReco/fcl/prolog_v12.fcl index d1028adf55..af583332c9 100644 --- a/CRVReco/fcl/prolog_v12.fcl +++ b/CRVReco/fcl/prolog_v12.fcl @@ -56,6 +56,7 @@ BEGIN_PROLOG //threshold used to determine the pulse area for the no-fit option doublePulseSeparation : 0.25 //25% of both ADC peaks of the double pulse //threshold at which double pulses can be separated in the no-fit option + useTimeOffsetDB : true //applies time offsets from the DB timeOffsetScale : 1.0 //scale factor for the time offsets from the database //examples: //-if a database table of measured time offset is used, @@ -63,10 +64,7 @@ BEGIN_PROLOG //-if a database table of a random gaussian distribution of time offsets // with a sigma equal to 1ns is used and one wants to run a simulation with a sigma of 0.5ns, // then the scale factor should be set to 0.5 (i.e. scaled to a sigma of 50%) - timeOffsetCutoffLow :-3.0 //the time offsets are cut off at -3ns - timeOffsetCutoffHigh : 3.0 //the time offsets are cut off at +3ns //note: if measured time offsets are used, the cutoffs should be set to the maximum values - useTimeOffsetDB : true //applies time offsets from the DB ignoreChannels : true //ignore channels that have status bit 1 ("ignore channels") in CRVstatus DB } diff --git a/CRVReco/src/CrvRecoPulsesFinder_module.cc b/CRVReco/src/CrvRecoPulsesFinder_module.cc index 874c839157..391704fdf3 100644 --- a/CRVReco/src/CrvRecoPulsesFinder_module.cc +++ b/CRVReco/src/CrvRecoPulsesFinder_module.cc @@ -66,10 +66,8 @@ namespace mu2e fhicl::Atom doublePulseSeparation{Name("doublePulseSeparation"), Comment("fraction of both peaks at which double pulses can be separated in the no-fit option")}; //0.25 fhicl::Atom eventWindowMarkerTag{Name("eventWindowMarkerTag"), Comment("EventWindowMarker producer"),"EWMProducer"}; fhicl::Atom protonBunchTimeTag{Name("protonBunchTimeTag"), Comment("ProtonBunchTime producer"),"EWMProducer"}; - fhicl::Atom timeOffsetScale{Name("timeOffsetScale"), Comment("scale factor for time offsets from database (use 1.0, if measured values)")}; //1.0 - fhicl::Atom timeOffsetCutoffLow{Name("timeOffsetCutoffLow"), Comment("lower cutoff of time offsets (for random values - otherwise set to minimum value)")}; //-3.0ns - fhicl::Atom timeOffsetCutoffHigh{Name("timeOffsetCutoffHigh"), Comment("upper cutoff of time offsets (for random values - otherwise set to maximum value)")}; //+3.0ns fhicl::Atom useTimeOffsetDB{Name("useTimeOffsetDB"), Comment("apply time offsets from the DB")}; //true + fhicl::Atom timeOffsetScale{Name("timeOffsetScale"), Comment("scale factor for time offsets from database (use 1.0, if measured values)")}; //1.0 fhicl::Atom ignoreChannels{Name("ignoreChannels"), Comment("ignore channels that have status 2 (bit 1) in CRVstatus DB")}; //true }; @@ -90,10 +88,8 @@ namespace mu2e art::InputTag _eventWindowMarkerTag; art::InputTag _protonBunchTimeTag; - float _timeOffsetScale; - float _timeOffsetCutoffLow; - float _timeOffsetCutoffHigh; bool _useTimeOffsetDB; + float _timeOffsetScale; bool _ignoreChannels; @@ -109,10 +105,8 @@ namespace mu2e _pedestalUndershootThreshold(conf().pedestalUndershootThreshold()), _eventWindowMarkerTag(conf().eventWindowMarkerTag()), _protonBunchTimeTag(conf().protonBunchTimeTag()), - _timeOffsetScale(conf().timeOffsetScale()), - _timeOffsetCutoffLow(conf().timeOffsetCutoffLow()), - _timeOffsetCutoffHigh(conf().timeOffsetCutoffHigh()), _useTimeOffsetDB(conf().useTimeOffsetDB()), + _timeOffsetScale(conf().timeOffsetScale()), _ignoreChannels(conf().ignoreChannels()) { if(conf().pulseAreaThreshold()>conf().minADCdifference()) @@ -219,10 +213,8 @@ namespace mu2e double timeOffset = 0.0; if(_useTimeOffsetDB) { - double timeOffset = calib.timeOffset(channel); + timeOffset = calib.timeOffset(channel); timeOffset*=_timeOffsetScale; //random time offsets can be scaled to a wider or smaller spread - if(timeOffset<_timeOffsetCutoffLow) timeOffset=_timeOffsetCutoffLow; //random time offsets can be cutoff at some limit - if(timeOffset>_timeOffsetCutoffHigh) timeOffset=_timeOffsetCutoffHigh; } _makeCrvRecoPulses->SetWaveform(ADCs, startTDC, CRVDigitizationPeriod, pedestal, calibPulseArea, calibPulseHeight); diff --git a/CRVResponse/fcl/prolog_v11.fcl b/CRVResponse/fcl/prolog_v11.fcl index 557b26c15b..c4e908b2ed 100644 --- a/CRVResponse/fcl/prolog_v11.fcl +++ b/CRVResponse/fcl/prolog_v11.fcl @@ -146,6 +146,7 @@ BEGIN_PROLOG //capacitance of one pixel (8.84e-14C) * overvoltage (3.0V) minVoltage : 0.0275 //27.5mV (corresponds to 5.5PE) noise : 4.0e-4 //0.4mV + useTimeOffsetDB : false //will be applied at reco timeOffsetScale : 1.0 //scale factor for the time offsets from the database //examples: //-if a database table of measured time offset is used, @@ -153,10 +154,6 @@ BEGIN_PROLOG //-if a database table of a random gaussian distribution of time offsets // with a sigma equal to 1ns is used and one wants to run a simulation with a sigma of 0.5ns, // then the scale factor should be set to 0.5 (i.e. scaled to a sigma of 50%) - timeOffsetCutoffLow :-3.0 //the time offsets are cut off at -3ns - timeOffsetCutoffHigh : 3.0 //the time offsets are cut off at +3ns - //note: if measured time offsets are used, the cutoffs should be set to the maximum values - useTimeOffsetDB : false //will be applied at reco numberSamplesZS : 12 numberSamplesNZS : @local::NumberSamplesNZS simulateNZS : @local::SimulateNZS diff --git a/CRVResponse/fcl/prolog_v12.fcl b/CRVResponse/fcl/prolog_v12.fcl index 9efd08e44a..135aeaa51f 100644 --- a/CRVResponse/fcl/prolog_v12.fcl +++ b/CRVResponse/fcl/prolog_v12.fcl @@ -145,6 +145,7 @@ BEGIN_PROLOG //capacitance of one pixel (8.84e-14C) * overvoltage (3.0V) minVoltage : 0.0275 //27.5mV (corresponds to 5.5PE) noise : 4.0e-4 //0.4mV + useTimeOffsetDB : false //will be applied at reco timeOffsetScale : 1.0 //scale factor for the time offsets from the database //examples: //-if a database table of measured time offset is used, @@ -152,10 +153,6 @@ BEGIN_PROLOG //-if a database table of a random gaussian distribution of time offsets // with a sigma equal to 1ns is used and one wants to run a simulation with a sigma of 0.5ns, // then the scale factor should be set to 0.5 (i.e. scaled to a sigma of 50%) - timeOffsetCutoffLow :-3.0 //the time offsets are cut off at -3ns - timeOffsetCutoffHigh : 3.0 //the time offsets are cut off at +3ns - //note: if measured time offsets are used, the cutoffs should be set to the maximum values - useTimeOffsetDB : false //will be applied at reco numberSamplesZS : 12 numberSamplesNZS : @local::NumberSamplesNZS simulateNZS : @local::SimulateNZS diff --git a/CRVResponse/src/CrvWaveformsGenerator_module.cc b/CRVResponse/src/CrvWaveformsGenerator_module.cc index 3d34f069c3..a2d4aa83ec 100644 --- a/CRVResponse/src/CrvWaveformsGenerator_module.cc +++ b/CRVResponse/src/CrvWaveformsGenerator_module.cc @@ -55,12 +55,8 @@ namespace mu2e fhicl::Atom protonBunchTimeMCTag{Name("protonBunchTimeMCTag"), Comment("ProtonBunchTimeMC producer"),"EWMProducer" }; fhicl::Atom minVoltage{Name("minVoltage")}; //0.022V (corresponds to 3.5PE) fhicl::Atom noise{Name("noise")}; //4.0e-4V - fhicl::Atom timeOffsetScale{Name("timeOffsetScale")}; // 1.0ns (scale factor applied to the database values) - fhicl::Atom timeOffsetCutoffLow{Name("timeOffsetCutoffLow")}; //-3.0ns - fhicl::Atom timeOffsetCutoffHigh{Name("timeOffsetCutoffHigh")}; // 3.0ns - //note: if measured time offsets are used, - //the cutoffs should be set to the maximum values - fhicl::Atom useTimeOffsetDB{Name("useTimeOffsetDB")}; //false, will be applied at reco + fhicl::Atom useTimeOffsetDB{Name("useTimeOffsetDB")}; //false, will be applied at reco + fhicl::Atom timeOffsetScale{Name("timeOffsetScale")}; //1.0ns (scale factor applied to the database values) fhicl::Atom singlePEWaveformMaxTime{Name("singlePEWaveformMaxTime")}; //100ns fhicl::Atom singlePEWaveformPrecision{Name("singlePEWaveformPrecision")}; //1.0 ns fhicl::Atom singlePEWaveformStretchFactor{Name("singlePEWaveformStretchFactor")}; //1.047 @@ -88,10 +84,8 @@ namespace mu2e double _digitizationEnd; double _minVoltage; double _noise; - double _timeOffsetScale; - double _timeOffsetCutoffLow; - double _timeOffsetCutoffHigh; bool _useTimeOffsetDB; + double _timeOffsetScale; double _singlePEWaveformMaxTime; int _numberSamplesZS; @@ -129,10 +123,8 @@ namespace mu2e _digitizationEnd(conf().digitizationEnd()), _minVoltage(conf().minVoltage()), _noise(conf().noise()), - _timeOffsetScale(conf().timeOffsetScale()), - _timeOffsetCutoffLow(conf().timeOffsetCutoffLow()), - _timeOffsetCutoffHigh(conf().timeOffsetCutoffHigh()), _useTimeOffsetDB(conf().useTimeOffsetDB()), + _timeOffsetScale(conf().timeOffsetScale()), _singlePEWaveformMaxTime(conf().singlePEWaveformMaxTime()), _numberSamplesZS(conf().numberSamplesZS()), _numberSamplesNZS(conf().numberSamplesNZS()), @@ -221,8 +213,6 @@ namespace mu2e //get the numbers from the database (either measured values of random values) timeOffset = calib.timeOffset(barIndex.asUint()*CRVId::nChanPerBar + SiPM); timeOffset*=_timeOffsetScale; //random time offsets can be scaled to a wider or smaller spread - if(timeOffset<_timeOffsetCutoffLow) timeOffset=_timeOffsetCutoffLow; //random time offsets can be cutoff at some limit - if(timeOffset>_timeOffsetCutoffHigh) timeOffset=_timeOffsetCutoffHigh; } //need to find where this FEB's TDC=0 (first point after the event window start, i.e. first clock tick after POT) is located with respect to the global time From 21910f19895cb2ba067f8052aeadb486f1ee3f41 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sat, 21 Feb 2026 21:19:54 -0600 Subject: [PATCH 165/174] added new CRV calibration/state DB txt files --- .../data/calib_extracted_20260221.txt | 4100 +++++++++++++++++ .../data/status_extracted_20260221.txt | 16 + 2 files changed, 4116 insertions(+) create mode 100644 CRVConditions/data/calib_extracted_20260221.txt create mode 100644 CRVConditions/data/status_extracted_20260221.txt diff --git a/CRVConditions/data/calib_extracted_20260221.txt b/CRVConditions/data/calib_extracted_20260221.txt new file mode 100644 index 0000000000..86aa5a440d --- /dev/null +++ b/CRVConditions/data/calib_extracted_20260221.txt @@ -0,0 +1,4100 @@ +TABLE CRVSiPM +#channel,pedestal,calibPulseHeight,calibPulseArea +0,2037.93,18.9526,547.439 +1,2044.15,16.5024,472.526 +2,2044.31,19.418,557.752 +3,2054.29,17.2825,475.84 +4,2055.95,20.5345,549.317 +5,2051.45,17.8845,487.655 +6,2049.14,18.7132,485.566 +7,2040.39,17.1369,433.021 +8,2038.35,19.6663,542.704 +9,2039.2,17.3518,498.176 +10,2052.45,20.0347,578.634 +11,2061.5,18.4575,520.179 +12,2029.31,20.0313,578.669 +13,2042.65,17.6076,496.996 +14,2037.7,19.8837,562.091 +15,2041.59,16.2456,466.927 +16,2045.08,19.7573,573.868 +17,2028.14,18.8008,552.257 +18,2027.77,20.3923,595.864 +19,2048.98,18.2867,541.006 +20,2047.76,21.3531,604.445 +21,2060.3,18.9102,549.38 +22,2053.14,21.4271,574.989 +23,2049.34,18.9311,523.392 +24,2041.99,21.3269,589.662 +25,2046.52,18.0447,516.316 +26,2038.41,20.8401,594.187 +27,2049.21,18.347,528.458 +28,2064.35,20.8903,594.498 +29,2048.66,17.7617,513.607 +30,2034.22,19.5539,574.194 +31,2066.75,18.1422,512.623 +32,2035.72,20.6003,599.543 +33,2039.05,18.022,505.005 +34,2040.27,21.3466,598.933 +35,2030.73,18.8823,520.684 +36,2050.94,20.4871,590.87 +37,2047.76,19.161,522.776 +38,2046.18,21.2021,589.127 +39,2051.14,17.5369,500.002 +40,2030.81,19.8276,573.698 +41,2051.4,17.2315,490.607 +42,2052.86,19.4669,575.682 +43,2046.36,16.9423,475.803 +44,2059.71,19.6399,563.342 +45,2037.83,17.0476,471.529 +46,2044.25,20.2759,560.751 +47,2034.56,17.1022,510.957 +48,2042.63,18.5342,514.773 +49,2044.87,19.4206,536.78 +50,2041.38,19.1299,536.031 +51,2042.05,18.1498,516.293 +52,2038.14,18.1238,523.831 +53,2042.42,19.741,543.542 +54,2038.7,18.5757,518.898 +55,2053.23,18.2827,512.181 +56,2053.22,17.6525,515.966 +57,2053.94,17.7513,515.134 +58,2068.27,17.6305,514.399 +59,2040.67,18.652,526.407 +60,2035.61,18.6741,526.86 +61,2047.6,18.2674,520.48 +62,2044.96,18.1981,529.438 +63,2045.85,18.0222,508.867 +64,2046.9,17.7786,523.622 +65,2058.68,19.0902,538.988 +66,2040.08,17.9451,517.271 +67,2032.76,18.9505,547.256 +68,2053.84,18.8568,508.618 +69,2054.29,19.2188,526.754 +70,2048.81,18.45,513.127 +71,2038.21,19.0787,514.823 +72,2037.67,19.3087,536.768 +73,2049.64,21.1055,595.332 +74,2040.69,18.2397,517.357 +75,2062.64,20.8556,590.824 +76,2054.17,17.9791,510.404 +77,2051.98,21.0711,594.775 +78,2044.39,18.6457,522.319 +79,2056.67,20.2586,582.29 +80,2039.78,20.3271,570.18 +81,2045.12,16.3202,471.238 +82,2058.96,19.3314,569.066 +83,2038.75,16.6634,481.233 +84,2042.37,20.191,571.107 +85,2042,15.6301,462.714 +86,2035.15,20.2884,565.285 +87,2050.83,15.6685,458.44 +88,2036.13,19.752,569.593 +89,2061.77,14.9228,433.093 +90,2046.16,21.0313,596.297 +91,2054.59,15.1346,438.882 +92,2038.98,19.2783,564.19 +93,2063.18,14.7869,437.582 +94,2039.22,21.5143,590.999 +95,2049.35,14.6228,424.202 +96,2054.02,19.2342,540.552 +97,2053.53,17.8603,519.722 +98,2047.68,18.7586,540.444 +99,2054.18,17.411,505.771 +100,2056.17,18.6018,518.826 +101,2036.3,18.4406,517.116 +102,2068.92,19.6637,548.018 +103,2048.56,18.1273,508.446 +104,2029.53,17.6873,500.657 +105,2030.99,17.924,514.171 +106,2047.06,18.8317,539.129 +107,2052.69,17.7352,509.859 +108,2059.62,17.8082,521.424 +109,2038.06,16.9054,492.868 +110,2038.54,19.0475,522.474 +111,2067.57,17.3411,506.699 +112,2054.81,17.9619,504.17 +113,2060.82,18.2597,528.911 +114,2047.47,18.228,508.753 +115,2054.65,18.4378,514.231 +116,2049.41,18.4021,509.978 +117,2048.23,18.9154,515.675 +118,2061.92,18.5881,506.406 +119,2061.4,18.6951,521.352 +120,2044.69,19.024,514.184 +121,2052.63,19.8455,550.846 +122,2057.32,18.9851,521.315 +123,2047.08,19.5325,552.312 +124,2045,17.8066,502.128 +125,2043.27,20.1725,564.584 +126,2056.67,19.0245,520.38 +127,2052.39,18.8217,543.48 +128,2047.18,19.4903,551.747 +129,2046.44,16.9836,476.532 +130,2038.43,20.6077,571.425 +131,2045.99,16.6188,468.053 +132,2027.81,20.0183,556.87 +133,2039.67,16.9142,471.981 +134,2043.61,18.6723,476.106 +135,2041.95,15.2788,399.535 +136,2042.42,19.9405,570.038 +137,2020.97,16.7069,497.236 +138,2039.57,20.4645,571.249 +139,2032.8,16.9325,515.655 +140,2054.38,20.1485,555.981 +141,2048.83,16.4581,450.214 +142,2035.53,20.4154,564.968 +143,2035.48,16.6018,456.257 +144,2050.91,19.9746,574.681 +145,2040.32,18.6423,522.758 +146,2049.72,20.8025,576.497 +147,2052.18,18.7408,530.261 +148,2040.1,19.686,544.606 +149,2037.89,16.9456,478.141 +150,2055.06,20.4865,539.514 +151,2054.73,18.3917,498.82 +152,2054.58,19.9092,567.38 +153,2051.2,17.0391,497.991 +154,2053.01,18.7874,549.497 +155,2042.1,17.4246,508.06 +156,2047.54,20.5694,571.991 +157,2037.69,17.1983,489.529 +158,2046.02,21.125,580.831 +159,2066.7,17.6311,503.995 +160,2043.03,19.0344,538.633 +161,2057.91,18.1553,513.627 +162,2063.81,19.9811,557.659 +163,2050.8,16.4657,483.508 +164,2049.76,19.6034,538.5 +165,2053.3,17.2556,495.514 +166,2049.36,20.4136,529.78 +167,2040.42,16.5856,472.824 +168,2054.31,20.242,561.991 +169,2043.24,17.2946,494.02 +170,2038.85,20.3354,562.972 +171,2053.55,17.499,497.256 +172,2052.99,19.2708,546.411 +173,2046.72,17.1693,489.514 +174,2057.5,21.1056,573.811 +175,2046.42,17.7256,470.286 +176,2044.75,17.7739,502.13 +177,2024.94,18.4046,521.588 +178,2063.4,16.9827,494.273 +179,2039.5,18.7065,557.764 +180,2047.53,17.7722,499.884 +181,2047.59,18.8952,528.908 +182,2045.67,18.4413,502.117 +183,2061.66,18.8129,520.128 +184,2039,19.3014,533.684 +185,2033.53,16.4312,485.266 +186,2043.45,17.6502,502.962 +187,2034.2,17.4066,501.85 +188,2052.69,18.5564,516.135 +189,2036.73,17.4044,492.954 +190,2058.29,18.8069,513.76 +191,2064.32,17.9205,500.754 +192,2049.58,22.2922,640.941 +193,2023.7,17.8385,509.252 +194,2039.85,22.0096,637.671 +195,2014.8,16.0928,487.524 +196,2030.68,23.1836,647.111 +197,2032.58,17.3022,496.196 +198,2046.06,21.4264,617.347 +199,2035.18,16.6989,494.225 +200,2049.65,22.9638,646.266 +201,2055.51,16.8656,503.536 +202,2054.98,21.4237,611.603 +203,2048.64,16.8503,503.342 +204,2055.21,20.7869,598.452 +205,2051.6,17.9965,524.617 +206,2062.19,21.3072,623.024 +207,2036,16.473,484.657 +208,2040.23,19.2178,533.213 +209,2048.33,18.8945,557.93 +210,2034.35,18.7938,529.002 +211,2062.54,19.0358,552.24 +212,2055.93,19.6218,531.443 +213,2038.86,17.806,536.208 +214,2049.48,20.6161,547.042 +215,2038.77,17.4974,516.877 +216,2054.03,20.4731,545.547 +217,2041.88,18.0899,526.994 +218,2041.29,20.0666,550.169 +219,2050.08,18.5109,537.029 +220,2046.46,19.3535,534.722 +221,2044.29,17.3185,523.27 +222,2048.04,19.5768,536.255 +223,2049.54,18.8143,541.256 +224,2039.36,17.4243,494.252 +225,2034.82,16.4537,468.876 +226,2024.73,18.3194,512.269 +227,2036.97,16.3615,479.052 +228,2035.47,17.1269,494.883 +229,2055.31,15.7262,463.48 +230,2044.73,17.7586,488.711 +231,2041.62,16.4741,466.411 +232,2036.98,17.2214,479.805 +233,2055.61,16.3318,474.095 +234,2054.74,16.6036,474.07 +235,2030.06,15.6333,466.49 +236,2044.46,18.3841,499.412 +237,2035.79,15.3666,450.412 +238,2048.65,16.1258,471.255 +239,2049.78,16.1717,460.753 +240,2043.22,18.5286,524.92 +241,2040.15,20.2578,598.385 +242,2047.94,18.8895,526.765 +243,2061.09,20.9541,602.465 +244,2031.2,19.016,525.436 +245,2045.08,21.035,596.192 +246,2050.17,18.9679,526.214 +247,2045.71,20.5111,592.084 +248,2036.32,19.2331,532.292 +249,2037.48,21.4998,614.827 +250,2070.51,18.0527,519.361 +251,2045.34,20.5022,606.173 +252,2043.6,17.6513,498.627 +253,2048.03,20.9434,600.815 +254,2060.06,17.4395,500.189 +255,2040.64,21.9295,620.17 +256,2039.82,17.0211,504.144 +257,2058.07,15.6589,431.142 +258,2034.94,16.5352,491.778 +259,2040.11,15.2356,397.807 +260,2046.43,16.4958,463.337 +261,2061.96,15.0967,414.026 +262,2021.58,16.4014,435.799 +263,2039.29,15.4561,370.616 +264,2033.37,16.5423,483.541 +265,2043.34,15.9284,435.919 +266,2055.89,17.2686,525.397 +267,2041.39,15.6654,436.484 +268,2045.89,16.38,475.387 +269,2041.75,14.9581,409.345 +270,2050.34,16.9733,474.108 +271,2046.98,16.196,432.344 +272,2041.69,16.0122,456.281 +273,2047.91,16.687,468.289 +274,2051.73,15.3986,459.509 +275,2031.35,16.4415,464.625 +276,2035.59,15.8026,446.787 +277,2055.13,16.7437,465.708 +278,2031.52,15.783,439.668 +279,2039.17,16.5721,460.826 +280,2038.22,16.699,482.913 +281,2058.92,15.0172,-1 +282,2044.73,16.5202,488.706 +283,2039.7,16.3521,466.553 +284,2033.22,15.6169,440.864 +285,2047.38,16.5795,469.226 +286,2034.71,15.6376,421.226 +287,2042.22,17.6369,480.863 +288,2038.19,15.5946,452.172 +289,2065.03,17.347,498.161 +290,2047.4,15.3781,448.638 +291,2042.04,17.3581,498.899 +292,2039.39,14.7381,412.737 +293,2042.37,17.2755,486.747 +294,2060.78,15.5096,447.43 +295,2044.22,17.4432,474.352 +296,2041.98,-1,-1 +297,2059.72,17.6612,515.794 +298,2056.83,15.713,465.626 +299,2041.68,17.2191,506.123 +300,2045.77,15.7195,455.422 +301,2045.47,18.0136,526.342 +302,2042.29,15.5523,430.043 +303,2047.53,17.2578,488.078 +304,2047.26,19.0273,546.479 +305,2038.06,13.8893,405.785 +306,2035.26,18.5136,551.828 +307,2025.61,13.6862,409.475 +308,2031.64,18.7568,527.282 +309,2056.97,13.6823,384.727 +310,2058.38,18.087,510.3 +311,2048.17,13.8847,395.778 +312,2047.95,18.8632,567.922 +313,2038.87,14.3196,425.337 +314,2045.24,18.7728,587.437 +315,2044.92,14.4499,448.847 +316,2051.47,18.8762,578.005 +317,2041.95,14.1269,415.862 +318,2048.42,19.0929,549.635 +319,2040.37,15.2551,433.663 +320,2035.6,17.3313,519.096 +321,2055.67,16.8594,483.549 +322,2028.91,17.2883,513.351 +323,2060.35,16.8113,482.801 +324,2043.13,17.1688,497.124 +325,2048.28,16.3617,446.44 +326,2050.73,16.7324,482.022 +327,2045.08,18.2217,488.325 +328,2046.44,17.9312,549.021 +329,2039.31,16.508,472.762 +330,2050.65,17.9298,579.993 +331,2044.63,17.1365,492.562 +332,2049.02,16.7878,513.388 +333,2047.73,16.0909,459.564 +334,2046.53,16.9909,494.976 +335,2051.02,17.6935,491.186 +336,2044.18,16.7708,517.43 +337,2037.8,16.9031,483.033 +338,2047.39,16.9061,511.54 +339,2047.81,15.6186,455.306 +340,2045.04,16.2619,461.162 +341,2034.22,16.2558,471.158 +342,2046.16,16.361,467.317 +343,2046.67,15.9003,462.318 +344,2041.95,16.7601,485.669 +345,2041.26,15.5534,453.864 +346,2050.52,16.4283,503.718 +347,2065.85,15.49,455.189 +348,2033.7,17.3389,490.071 +349,2043.93,15.155,440.834 +350,2032.54,17.1331,501.486 +351,2044.7,14.8535,432.784 +352,2039.14,15.2839,447.094 +353,2042.19,16.093,449.194 +354,2054.99,16.0392,461.577 +355,2050.93,15.8577,454.427 +356,2040.76,15.3158,443.906 +357,2036.12,16.1508,431.141 +358,2035.58,16.0415,459.991 +359,2039.99,15.7555,444.249 +360,2038.14,16.2543,496.063 +361,2053.77,16.1083,464.37 +362,2053.7,16.396,548.413 +363,2038.12,15.8171,456.408 +364,2053.45,15.9982,462.85 +365,2035.11,15.5615,447.595 +366,2052.93,16.7578,491.162 +367,2042.3,15.8372,432.354 +368,2050.17,16.4238,472.683 +369,2056.21,17.1265,489.02 +370,2038.41,15.9239,467.73 +371,2045.13,16.6213,474.106 +372,2038.01,16.2479,463.514 +373,2053.16,16.8832,477.9 +374,2011.73,17.2762,479.985 +375,2033,17.2107,471.773 +376,2034.8,16.9701,481.29 +377,2042.45,17.1331,485.143 +378,2052.05,16.1723,468.023 +379,2051.07,17.6504,493.417 +380,2058.37,17.1369,480.417 +381,2044.24,16.6515,474.792 +382,2033.72,16.5061,473.906 +383,2049.69,17.0555,473.765 +384,2049.96,16.2631,465.525 +385,2051.07,16.4936,460.155 +386,2055.28,15.8414,451.566 +387,2034.87,17.0331,473.857 +388,2052.78,16.0109,441.761 +389,2052.8,16.5126,456.395 +390,2066.21,15.164,383.311 +391,2053.44,16.459,393.764 +392,2050.29,16.2778,473.124 +393,2040.18,17.0091,479.598 +394,2060.93,16.7833,474.9 +395,2050.56,17.1355,480.343 +396,2027.12,15.4902,445.628 +397,2041.23,17.8517,484.532 +398,2045.13,16.1121,450.395 +399,2045.46,16.8238,443.162 +400,2038.31,19.1594,571.773 +401,2061.33,20.03,561.472 +402,2055.22,19.8917,575.204 +403,2043.52,20.0897,564.774 +404,2044.68,19.1415,536.897 +405,2055.8,20.5316,557.477 +406,2061.89,19.48,525.346 +407,2057.81,19.5702,542.256 +408,2052.59,20.4028,587.523 +409,2033.44,19.4965,552.835 +410,2060.49,20.051,562.615 +411,2049.37,19.6206,556.786 +412,2056.66,19.7814,534.487 +413,2051.79,19.5587,549.47 +414,2047.26,20.228,549.62 +415,2051.27,20.8377,568.347 +416,2046.41,19.0379,558.668 +417,2042.11,16.2018,471.532 +418,2050.66,18.6547,547.594 +419,2037.77,15.9235,461.725 +420,2060.6,18.9238,555.17 +421,2041.25,15.9368,455.594 +422,2065.3,20.5231,564.568 +423,2060.82,16.2046,441.494 +424,2046.38,21.2397,601.348 +425,2041.95,16.0021,466.054 +426,2059.45,21.2037,620.81 +427,2050.39,16.1101,475.271 +428,2066.01,19.5978,547.385 +429,2035.12,15.6575,430.323 +430,2040.31,20.2196,543.9 +431,2055.14,16.7403,469.689 +432,2050.63,15.9721,479.128 +433,2050.48,16.4739,482.936 +434,2045.64,16.1303,538.481 +435,2039.13,16.2643,473.388 +436,2051.98,15.4328,453.768 +437,2047.73,16.8261,476.134 +438,2037.76,17.2439,502.924 +439,2039.42,16.5493,447.514 +440,2042.61,15.3824,465.335 +441,2054.24,18.3101,514.8 +442,2038.81,15.8005,456.549 +443,2043.3,16.8386,485.247 +444,2045.51,15.1473,439.988 +445,2040.09,16.948,479.581 +446,2059.02,15.8836,460.095 +447,2049.09,16.4435,455.03 +448,2054.47,17.8968,500.332 +449,2048.69,16.8753,482.824 +450,2052.26,18.776,518.971 +451,2056.55,16.8507,486.381 +452,2042.29,18.0017,495.101 +453,2056.67,16.7603,477.022 +454,2045.38,17.3111,496.714 +455,2033.28,16.765,477.016 +456,2042.21,17.9388,510.564 +457,2057.6,17.2026,488.973 +458,2028.68,16.9812,500.712 +459,2045.95,16.8742,488.247 +460,2056.76,18.5155,514.694 +461,2036.63,16.2392,477.359 +462,2055.72,17.8533,519.483 +463,2060.25,16.4053,466.574 +464,2047.83,17.266,499.377 +465,2041.66,17.1383,486.236 +466,2034.65,18.3677,515.715 +467,2053.92,17.8642,503.09 +468,2037.58,17.7321,494.455 +469,2044.5,17.1635,477.577 +470,2044.05,18.2618,485.718 +471,2050.05,18.1669,493.782 +472,2061.18,18.5992,517.031 +473,2054.29,17.4999,495.193 +474,2063.26,18.0246,521.727 +475,2061.36,18.2005,501.992 +476,2065.14,17.5566,485.931 +477,2046.86,18.418,506.531 +478,2035.58,18.378,504.981 +479,2049.54,18.0117,496.79 +480,2050.26,17.8644,510.84 +481,2052.96,17.7226,501.956 +482,2051.3,16.6408,462.832 +483,2058.65,18.0173,505.611 +484,2056.3,16.5219,462.8 +485,2053.81,17.6386,495.987 +486,2057.21,16.4919,463.372 +487,2048.7,16.8718,483.154 +488,2059.13,16.2842,470.597 +489,2049.59,16.7816,490.687 +490,2036.56,17.3272,476.249 +491,2051.71,18.3476,515.564 +492,2043.22,17.1311,466.464 +493,2047.62,18.6537,512.633 +494,2067.55,16.2093,455.87 +495,2048.95,17.3149,487.817 +496,2053.11,16.3295,473.492 +497,2053.32,17.9216,512.233 +498,2044.63,16.9237,482.635 +499,2058.25,18.054,511.234 +500,2042.73,16.6069,468.2 +501,2058.21,18.212,513.871 +502,2043.09,17.5919,487.608 +503,2041.42,17.8612,495.081 +504,2032.38,16.7667,482.877 +505,2035.26,18.1468,513.106 +506,2035.5,16.2987,473.491 +507,2037.49,16.9785,499.582 +508,2033.25,17.1592,479.928 +509,2031.87,18.3166,514.849 +510,2039.05,16.4911,470.669 +511,2047.88,19.1838,539.637 +512,2047.39,16.8154,508.15 +513,2048.27,15.6311,434.299 +514,2039.7,16.1112,476.874 +515,2049.27,14.5978,398.481 +516,2031.76,16.2277,462.236 +517,2051.35,15.3853,413.244 +518,2057.2,15.9415,-1 +519,2052.74,15.4968,386.032 +520,2042.02,-1,-1 +521,2054.79,15.2073,439.384 +522,2056.04,15.876,455.22 +523,2049.8,15.1097,433.436 +524,2052.08,16.0193,450.854 +525,2044.01,15.8619,432.289 +526,2053.12,16.7332,448.651 +527,2047.19,14.6869,400.092 +528,2036.7,17.766,507.889 +529,2049.73,15.6852,449.489 +530,2029.56,18.434,581.792 +531,2063.15,16.6055,472.022 +532,2037.95,17.5277,499.664 +533,2050.48,15.5397,441.731 +534,2037.53,17.9849,493.832 +535,2039.53,17.0837,462.887 +536,2045.53,18.1862,535.952 +537,2034.02,17.1826,478.251 +538,2065.56,18.7631,598.439 +539,2056.98,16.1431,469.899 +540,2072.15,18.0707,524.66 +541,2060.07,16.3028,441.535 +542,2030.91,17.995,530.289 +543,2053.2,16.2007,437.263 +544,2048.51,16.0893,466.741 +545,2058.91,16.6513,467.324 +546,2032.44,16.2213,470.114 +547,2046.5,15.8301,460.511 +548,2028.81,16.0407,443.3 +549,2054.08,16.1682,450.578 +550,2031.97,16.796,434.349 +551,2051.39,16.1984,454.442 +552,2054.17,16.7624,530.047 +553,2052.14,16.3864,464.262 +554,2046.59,17.4248,511.267 +555,2056.72,15.445,449.955 +556,2036.87,16.273,462.334 +557,2050.46,16.6041,469.222 +558,2055.69,16.6652,463.312 +559,2057.71,16.39,458.266 +560,2054.04,18.3268,556.978 +561,2047.47,16.3836,464.011 +562,2051.35,17.6309,550.542 +563,2049.9,16.141,458.361 +564,2030.94,18.1503,524.214 +565,2054.39,16.1329,460.872 +566,2050.52,17.899,499.865 +567,2051.95,16.4294,450.907 +568,2052.87,19.2965,585.07 +569,2046.06,16.6421,466.134 +570,2047.79,17.333,544.48 +571,2061.09,15.8836,460.012 +572,2055.8,17.821,524.111 +573,2042.96,15.8491,454.446 +574,2056.08,18.2975,569.666 +575,2052.57,16.2087,445.88 +576,2034.17,16.3376,475.813 +577,2049.26,16.4823,482.516 +578,2055.17,17.2094,509.585 +579,2038.48,17.0261,493.301 +580,2041.45,16.8022,469.943 +581,2040.77,16.4661,468.128 +582,2043.4,16.8809,451.836 +583,2066.1,17.1839,471.433 +584,2038.52,16.6098,478.543 +585,2045.52,16.8641,483.353 +586,2060.83,16.231,468.712 +587,2045.94,17.2156,493.924 +588,2043.33,16.6141,470.21 +589,2055.55,16.6382,480.011 +590,2023.92,15.7937,454.488 +591,2046.47,17.2106,486.028 +592,2043.79,16.6649,476.069 +593,2056.62,16.4895,475.085 +594,2045.55,15.9233,465.218 +595,2039.7,16.2163,467.921 +596,2054.27,15.9431,462.125 +597,2043.66,16.0441,464.634 +598,2046.74,16.2582,454.991 +599,2042.57,16.3321,458.256 +600,2054.59,16.6467,478.532 +601,2044.57,16.5519,472.951 +602,2059.81,16.4964,474.92 +603,2043.31,16.941,482.291 +604,2052.85,15.9881,458.03 +605,2033.69,15.2495,457.401 +606,2035.44,15.1704,432.983 +607,2040.03,17.0936,481.73 +608,2033.32,13.6912,403.987 +609,2039.02,17.6937,518.939 +610,2049.6,13.4385,394.29 +611,2046.44,17.9187,503.845 +612,2022.64,13.4933,383.693 +613,2045.71,17.6554,485.549 +614,2037.97,13.8295,378.74 +615,2065.41,17.7075,495.036 +616,2051.82,13.479,384.631 +617,2052.3,18.4202,525.903 +618,2034.48,13.0839,386.38 +619,2039.92,17.0436,497.559 +620,2050.86,13.6461,393.786 +621,2052.96,17.7703,491.161 +622,2041.07,14.0898,401.366 +623,2058.96,17.6589,489.153 +624,2038.06,13.3874,384.067 +625,2045.26,14.2912,421.771 +626,2040.5,13.9011,404.435 +627,2053.52,13.9862,409.56 +628,2045.74,13.1337,372.477 +629,2035.48,14.2918,403.345 +630,2043.35,14.0831,389.628 +631,2039.19,14.1092,400.763 +632,2040.15,13.9225,402.827 +633,2023.34,13.8982,404.496 +634,2045.26,13.3173,383.448 +635,2039.13,13.9767,407.957 +636,2034.58,13.157,376.451 +637,2037.99,13.5086,390.594 +638,2044.81,13.0555,371.951 +639,2051.55,14.1613,412.718 +640,2041.06,17.4673,509.807 +641,2046.41,16.048,465.095 +642,2047.88,17.662,502.074 +643,2041.2,15.4039,420.605 +644,2057.01,17.7021,496.906 +645,2025.3,15.2912,414.646 +646,2051.24,17.9799,456.059 +647,2031.15,15.9707,377.823 +648,2046.34,18.4777,524.796 +649,2044.83,16.7161,494.888 +650,2041.6,17.243,508.177 +651,2053.92,16.2794,480.615 +652,2052.17,16.3853,438.809 +653,2035,15.6565,466.952 +654,2049.21,16.6623,452.044 +655,2041.21,15.06,440.924 +656,2058.18,18.1183,583.003 +657,2026.84,18.2902,532.031 +658,2038.47,16.9958,511.091 +659,2045.61,16.4222,496.175 +660,2040.01,17.3055,505.516 +661,2048.35,17.8676,520.785 +662,2056.21,17.4728,496.78 +663,2042.56,18.1122,513.188 +664,2040.86,17.7238,515.337 +665,2040.29,17.089,504.011 +666,2043.14,17.4487,513.128 +667,2055.06,17.4176,526.314 +668,2050.2,17.4161,497.828 +669,2031.4,16.2116,491.738 +670,2045.99,17.8648,498.225 +671,2041.56,16.78,476.918 +672,2044.62,16.1907,470.793 +673,2043.03,16.6884,479.553 +674,2045.31,16.7298,475.543 +675,2042.17,15.4993,453.932 +676,2044.81,16.6422,456.993 +677,2024.2,16.7318,463.298 +678,2038.78,16.3484,421.501 +679,2060.21,15.3579,425.606 +680,2061.05,17.3774,548.124 +681,2047.18,16.8393,487.386 +682,2051.38,16.3145,475.004 +683,2060.42,15.8604,466.151 +684,2061.89,15.8793,450.983 +685,2046.03,16.6551,477.143 +686,2029.97,16.115,461.454 +687,2043.13,16.4158,480.951 +688,2047.12,15.8593,475.024 +689,2044.87,18.0595,512.063 +690,2043.05,15.3857,447.446 +691,2042.87,17.9167,509.771 +692,2066.43,15.8351,450.54 +693,2052.71,18.2219,514.738 +694,2051.49,15.8892,427.53 +695,2052.75,17.5019,497.874 +696,2036.53,16.3249,467.454 +697,2043.24,17.7482,541.096 +698,2051.93,16.314,472.151 +699,2038.76,16.9149,500.486 +700,2051.63,16.6955,474.175 +701,2040.56,18.1693,511.754 +702,2056.48,16.1629,450.708 +703,2046.71,17.2933,518.944 +704,2055.58,15.6849,445.091 +705,2039.48,18.7381,531.385 +706,2045.59,15.2383,437.667 +707,2025.97,17.1059,506.806 +708,2046.58,15.4711,427.671 +709,2042.74,18.3853,504.144 +710,2047.57,14.7393,415.618 +711,2049.49,17.2473,484.805 +712,2053.08,15.4866,445.823 +713,2034.9,18.5195,531.331 +714,2047.59,14.3172,422.019 +715,2040.09,16.8205,495.14 +716,2044.08,15.4385,440.085 +717,2061.07,17.962,524.095 +718,2043.7,13.5801,396.457 +719,2061.58,18.4637,537.571 +720,2057.79,16.484,478.674 +721,2054.51,17.3424,513.437 +722,2037.14,16.3264,470.608 +723,2042.83,18.8457,540.251 +724,2035.81,15.3732,436.63 +725,2046.52,18.2037,521.122 +726,2036.76,15.9701,458.222 +727,2041.69,18.0517,512.703 +728,2054.63,17.3799,538.338 +729,2055.28,18.5625,532.547 +730,2037,16.7666,505.476 +731,2038.85,18.7,533.886 +732,2037.42,15.9399,470.297 +733,2041.26,17.1929,501.348 +734,2039.38,17.0606,498.302 +735,2046.57,18.3384,523.143 +736,2033.47,12.8,387.608 +737,2052.72,15.7695,463.583 +738,2053.74,13.0333,388.115 +739,2048.78,16.44,480.019 +740,2055.95,13.0182,364.72 +741,2043.69,15.4067,447.279 +742,2037.44,13.6235,379.413 +743,2047.77,15.5951,453.546 +744,2054.81,13.0825,377.76 +745,2063.52,15.9192,441.526 +746,2054.93,13.4875,389.791 +747,2040.38,15.8289,462.805 +748,2055.03,12.2408,348.457 +749,2050.42,15.6089,449.035 +750,2048.84,13.2673,378.78 +751,2070.04,15.4755,455.982 +752,2050.38,17.6744,512.084 +753,2046.71,14.9493,432.161 +754,2038.06,16.2961,478.08 +755,2046.53,14.6328,426.941 +756,2047.9,16.6794,482.935 +757,2044.87,14.222,412.34 +758,2044.83,16.6365,470.647 +759,2040.56,14.0221,404.339 +760,2031.96,17.0254,498.688 +761,2047.96,14.8329,429.465 +762,2050.49,17.172,500.462 +763,2043.78,14.6171,426.819 +764,2044.48,16.3751,481.889 +765,2037.31,14.9087,431.411 +766,2038.21,16.5238,484.872 +767,2042.66,14.2992,425.861 +768,2047.88,15.3461,447.547 +769,2035.24,19.3936,550.23 +770,2029.63,14.9797,412.207 +771,2040.12,19.3487,543.154 +772,2028.03,15.5346,411.87 +773,2043.48,18.914,523.437 +774,2040.21,13.9449,336.481 +775,2037.98,18.1743,452.082 +776,2039.94,15.6335,447.438 +777,2048.19,18.4306,531.851 +778,2046.04,16.0608,471.494 +779,2049.17,18.5086,536.012 +780,2043.1,14.4407,419.094 +781,2045.02,19.7728,554.001 +782,2058.48,15.4415,419.106 +783,2046.19,18.4234,503.928 +784,2062.06,16.9258,470.144 +785,2026.39,16.7679,485.302 +786,2037.44,17.316,491.773 +787,2032.51,17.3157,492.083 +788,2041.01,15.7995,442.454 +789,2036.28,16.7463,460.088 +790,2061.76,16.3456,467.322 +791,2052.9,16.8531,470.907 +792,2058.3,15.5542,468.822 +793,2049.79,17.4201,494.879 +794,2034.04,16.3384,479.828 +795,2043.47,17.0407,498.704 +796,2048.09,16.433,465.324 +797,2054.88,16.4036,463.901 +798,2043.71,16.5984,463.099 +799,2032.04,17.6042,490.193 +800,2052.28,18.3991,512.458 +801,2054.75,15.4449,454.097 +802,2031.21,18.2397,513.398 +803,2042.52,15.9917,461.589 +804,2045.7,17.9652,494.155 +805,2045.84,16.3269,468.011 +806,2045.11,17.5418,464.848 +807,2038.59,15.8921,444.655 +808,2049.01,18.5553,509.964 +809,2050.06,15.9141,464.56 +810,2053.29,17.5452,503.182 +811,2053.1,15.7814,463.684 +812,2063.65,18.2753,500.748 +813,2038.47,16.0465,455.129 +814,2052.44,17.1945,485.852 +815,2052.82,15.7277,453.988 +816,2051.2,18.1094,497.61 +817,2037.93,16.1028,463.561 +818,2034.77,18.1803,503.457 +819,2048.74,15.5772,455.661 +820,2050.03,18.2068,489.886 +821,2042.55,15.9499,454.172 +822,2035.58,18.1413,474.105 +823,2041.63,15.6337,441.514 +824,2043.58,18.7749,512.131 +825,2037.74,16.3593,471.753 +826,2057.59,19.0767,512.884 +827,2042.84,15.6539,455.97 +828,2049.16,18.6351,507.447 +829,2043.6,16.3388,469.251 +830,2039.29,18.2712,505.899 +831,2036.56,15.961,457.449 +832,2044.67,16.3087,455.901 +833,2028.38,17.4141,495.293 +834,2068.21,15.8922,453.357 +835,2038.21,17.3129,506.848 +836,2053.55,16.1993,463.169 +837,2043.93,17.6707,498.654 +838,2059.51,15.3034,411.792 +839,2040.14,16.8458,482.503 +840,2053.72,15.7423,454.791 +841,2026.18,16.906,494.796 +842,2061.83,16.2297,470.653 +843,2047.33,17.4171,502.035 +844,2043.93,16.0664,460.337 +845,2038.68,16.8409,485.503 +846,2052.05,15.6468,452.332 +847,2044.4,17.2319,496.296 +848,2037.83,17.9574,518.811 +849,2047.59,18.3514,520.211 +850,2048.12,17.6584,512.987 +851,2036.53,17.5796,510.863 +852,2045.37,16.0509,484.014 +853,2035.1,18.4127,516.247 +854,2028.8,17.9889,511.523 +855,2049.04,17.6999,508.987 +856,2041.08,16.9663,511.474 +857,2043.4,18.4355,523.099 +858,2051.01,18.1887,521.852 +859,2038.98,17.7665,515.866 +860,2049.25,17.1539,489.77 +861,2053.84,18.274,514.028 +862,2037.38,17.7808,500.357 +863,2052.41,-1,-1 +864,2041.1,18.2275,520.775 +865,2040.57,15.6714,454.741 +866,2039.77,18.663,531.039 +867,2043.07,15.0119,443.706 +868,2037.87,18.9686,528.765 +869,2045.87,14.2809,420.473 +870,2045.65,18.6205,526.694 +871,2037.39,15.4091,442.699 +872,2045.75,18.9712,535.328 +873,2046.18,14.57,440.408 +874,2067.71,18.3487,526.93 +875,2044.05,15.325,447.335 +876,2028.43,18.0855,512.023 +877,2056,14.4513,432.78 +878,2047.18,19.2436,535.598 +879,2063.52,15.3608,448.655 +880,2052.02,16.064,482.125 +881,2029.57,17.4492,528.159 +882,2048.29,17.3814,508 +883,2043.99,18.1295,532.212 +884,2056.69,16.1522,480.952 +885,2048.42,18.2341,531.107 +886,2050.28,17.0306,480.771 +887,2050.4,17.2845,521.911 +888,2043.58,16.4639,467.852 +889,2037.35,18.0839,528.107 +890,2047.14,16.706,481.245 +891,2034.57,18.1315,536.027 +892,2034.76,15.6385,451.51 +893,2050.68,17.6866,517.026 +894,2030.9,16.0362,462.505 +895,2040.31,17.8635,532.888 +896,2040.13,19.2831,543.341 +897,2052.54,18.2006,522.093 +898,2033.14,18.3559,515.534 +899,2030.09,17.8609,509.093 +900,2024.3,18.7284,495.646 +901,2043.6,18.8133,492.059 +902,2037.41,16.9344,441.876 +903,2053.32,16.9326,407.672 +904,2043.27,19.4764,567.941 +905,2055.41,17.7485,511.064 +906,2039.38,19.3267,661.239 +907,2042.56,17.7431,511.114 +908,2037.11,17.9876,510.839 +909,2055.01,18.1253,493.287 +910,2043.15,17.6901,513.443 +911,2038.68,17.74,493.119 +912,2045.88,16.667,485.237 +913,2037.44,16.5314,481.206 +914,2041.84,17.5261,488.906 +915,2042.53,15.9026,467.125 +916,2040.45,16.7476,463.115 +917,2048.44,15.9104,447.991 +918,2053.48,17.1305,475.587 +919,2038.92,16.2297,445.771 +920,2052.65,17.2544,494.824 +921,2039.58,16.1563,485.148 +922,2052.75,16.9538,477.515 +923,2031.67,15.6744,457.192 +924,2070.14,16.8223,451.709 +925,2042.2,16.1463,468.14 +926,2061.91,17.9756,476.252 +927,2034.01,16.3447,465.435 +928,2052.83,20.609,566.821 +929,2033.76,20.3974,569.86 +930,2046.89,20.4713,571.57 +931,2043.67,18.9223,544.714 +932,2042.14,20.5536,557.227 +933,2050.44,19.855,551.028 +934,2041.08,19.9119,539.022 +935,2045.29,19.5661,517.006 +936,2047.9,20.0757,559.518 +937,2047.44,18.4224,528.839 +938,2050.97,19.0793,540.035 +939,2036.63,18.8487,544.64 +940,2036.84,18.7007,506.526 +941,2016.32,19.2053,548.252 +942,2043.27,20.0949,538.047 +943,2039.74,19.2826,526.905 +944,2053,18.2946,529.973 +945,2048.02,17.5346,519.922 +946,2049.99,18.751,539.288 +947,2041.88,17.9397,519.661 +948,2031.23,19.1088,532.19 +949,2055.25,18.0239,524.724 +950,2045.58,19.5392,547.671 +951,2049.65,18.2054,511.109 +952,2062.76,18.7576,540.833 +953,2054.93,17.5106,516.867 +954,2044.01,18.2906,539.956 +955,2044.03,17.4683,508.421 +956,2052.83,18.648,519.619 +957,2035.29,18.6176,533.403 +958,2029.15,19.2088,543.876 +959,2047.62,18.0231,514.276 +960,2059.28,14.2137,416.171 +961,2037.61,16.9074,489.718 +962,2046.86,14.9419,434.556 +963,2044.49,15.6761,467.419 +964,2036.55,15.3104,427.129 +965,2036.67,15.6268,436.633 +966,2050.55,14.4777,413.473 +967,2047.82,15.6429,430.238 +968,2024.28,14.7499,425.115 +969,2048.04,17.0665,496.435 +970,2041.91,14.7494,424.095 +971,2041.45,16.2623,486.255 +972,2032.92,14.6427,412.984 +973,2064.85,15.8703,460.495 +974,2061.52,14.8706,426.503 +975,2037.33,15.3298,435.43 +976,2047.27,14.3219,410.814 +977,2045.97,16.4548,478.515 +978,2027.77,14.3007,418.494 +979,2036,16.1699,478.765 +980,2036.19,14.7434,412.58 +981,2048.84,15.8827,460.542 +982,2055.03,14.4083,396.496 +983,2044.59,16.2471,470.292 +984,2045.97,15.2217,421.009 +985,2037.64,16.0048,488.019 +986,2043.43,13.8959,398.935 +987,2045.44,16.8156,490.642 +988,2056.27,14.7495,415.553 +989,2043.83,16.0168,467.833 +990,2041.31,14.3129,404.757 +991,2038.83,16.547,478.645 +992,2051.19,14.2076,411.521 +993,2032.3,16.69,476.749 +994,2036.52,14.6424,413.034 +995,2046.31,16.9526,483.659 +996,2045.23,14.841,420.846 +997,2035.45,16.0369,464.318 +998,2040.99,14.2031,400.743 +999,2055.1,16.4916,473.489 +1000,2059.94,14.9864,421.177 +1001,2032.45,16.4396,477.386 +1002,2054.34,14.2601,408.299 +1003,2049.4,16.9419,481.254 +1004,2061.37,14.5466,410.758 +1005,2036.29,16.9789,481.195 +1006,2045.3,14.1229,405.899 +1007,2051.08,17.0431,481.239 +1008,2055.66,17.9182,508.006 +1009,2045.46,19.6129,563.761 +1010,2043.28,17.3117,495.621 +1011,2046.84,19.516,567.537 +1012,2039.91,17.7403,497.21 +1013,2036.06,18.9715,546.599 +1014,2056.55,17.9627,504.947 +1015,2046.02,19.2678,553.903 +1016,2044.73,17.9769,502.029 +1017,2057.93,18.4169,548.218 +1018,2045.74,17.5114,502.475 +1019,2050.79,19.5602,571.741 +1020,2034.14,17.808,499.507 +1021,2046.05,18.8155,539.839 +1022,2043.18,17.8687,507.986 +1023,2047.95,19.8772,571.36 +1024,0,-1,-1 +1025,2046.73,16.5208,450.378 +1026,0,-1,-1 +1027,2042.52,16.9992,442.041 +1028,0,-1,-1 +1029,2049.8,16.4145,444.694 +1030,0,-1,-1 +1031,2044.28,16.4095,397.826 +1032,0,-1,-1 +1033,2050.64,16.6501,429.94 +1034,0,-1,-1 +1035,2052.09,16.5862,443.998 +1036,0,-1,-1 +1037,2034.04,16.7443,415.651 +1038,0,-1,-1 +1039,2050.24,16.7167,422.221 +1040,0,-1,-1 +1041,2033.3,18.9729,515.488 +1042,0,-1,-1 +1043,2045.74,20.1252,534.659 +1044,0,-1,-1 +1045,2047.96,18.7592,485.971 +1046,0,-1,-1 +1047,2039.54,18.9093,472.427 +1048,0,-1,-1 +1049,2014.7,21.4451,599.742 +1050,0,-1,-1 +1051,2050.49,20.8546,603.421 +1052,0,-1,-1 +1053,2034.87,19.2256,563.955 +1054,0,-1,-1 +1055,2037.28,19.4728,544.177 +1056,0,-1,-1 +1057,2032.98,15.9009,434.847 +1058,0,-1,-1 +1059,2036,16.0799,434.229 +1060,0,-1,-1 +1061,2044.22,16.2922,435.568 +1062,0,-1,-1 +1063,2032.73,15.6395,388.7 +1064,0,-1,-1 +1065,2027.8,18.2497,544.856 +1066,0,-1,-1 +1067,2044.72,18.7389,520.894 +1068,0,-1,-1 +1069,2036.36,17.2207,479.781 +1070,0,-1,-1 +1071,2044.09,16.6792,467.792 +1072,0,-1,-1 +1073,2042.1,16.0019,430.693 +1074,0,-1,-1 +1075,2035.5,16.6744,438.542 +1076,0,-1,-1 +1077,2041,17.0322,455.246 +1078,0,-1,-1 +1079,2035.28,16.1619,415.093 +1080,0,-1,-1 +1081,2033.73,15.2409,425.276 +1082,0,-1,-1 +1083,2049.52,16.5995,438.62 +1084,0,-1,-1 +1085,2033.83,17.21,461.028 +1086,0,-1,-1 +1087,2045.23,16.7689,453.789 +1088,0,-1,-1 +1089,2020.03,19.1143,517.092 +1090,0,-1,-1 +1091,2038.05,20.1006,524.37 +1092,0,-1,-1 +1093,2048.92,19.0562,512.689 +1094,0,-1,-1 +1095,2035.65,18.1072,486.175 +1096,0,-1,-1 +1097,2034.05,19.4319,516.508 +1098,0,-1,-1 +1099,2048.58,18.8636,507.689 +1100,0,-1,-1 +1101,2049.28,18.2151,496.861 +1102,0,-1,-1 +1103,2061.68,20.1925,521.043 +1104,0,-1,-1 +1105,2048.28,20.0361,578.447 +1106,0,-1,-1 +1107,2051.07,-1,-1 +1108,0,-1,-1 +1109,2026.18,17.7483,480.82 +1110,0,-1,-1 +1111,2026.48,17.4493,469.026 +1112,0,-1,-1 +1113,2036.87,17.7293,506.135 +1114,0,-1,-1 +1115,2033.81,17.4599,481.702 +1116,0,-1,-1 +1117,2043.12,17.7842,478.755 +1118,0,-1,-1 +1119,2036.95,17.5597,487.992 +1120,0,-1,-1 +1121,2035.46,17.9283,479.827 +1122,0,-1,-1 +1123,2052.14,18.573,497.701 +1124,0,-1,-1 +1125,2024.6,17.2476,456.032 +1126,0,-1,-1 +1127,2061.43,17.1912,472.653 +1128,0,-1,-1 +1129,2046.98,18.1216,486.448 +1130,0,-1,-1 +1131,2037.1,18.3936,478.567 +1132,0,-1,-1 +1133,2036.15,18.1045,472.189 +1134,0,-1,-1 +1135,2044.21,18.2605,477.734 +1136,0,-1,-1 +1137,2041.68,21.9278,576.644 +1138,0,-1,-1 +1139,2043.33,20.1666,546.666 +1140,0,-1,-1 +1141,2044.28,21.7031,568.63 +1142,0,-1,-1 +1143,2035.35,21.0593,547.143 +1144,0,-1,-1 +1145,2044.86,20.1249,541.232 +1146,0,-1,-1 +1147,2039,20.6102,546.72 +1148,0,-1,-1 +1149,2033.35,20.6805,542.316 +1150,0,-1,-1 +1151,2039.13,20.4139,555.684 +1152,0,-1,-1 +1153,2024.97,15.6489,420 +1154,0,-1,-1 +1155,2045.38,16.5322,413.466 +1156,0,-1,-1 +1157,2039.25,15.7694,387.916 +1158,0,-1,-1 +1159,2048.57,14.7364,354.001 +1160,0,-1,-1 +1161,2051.12,15.5204,433.131 +1162,0,-1,-1 +1163,2048.91,15.8927,439.049 +1164,0,-1,-1 +1165,2059.91,15.9139,428.928 +1166,0,-1,-1 +1167,2034.11,16.8309,428.71 +1168,0,-1,-1 +1169,2030.04,18.6939,537.66 +1170,0,-1,-1 +1171,2038.57,17.9644,516.087 +1172,0,-1,-1 +1173,2033.09,17.8698,500.331 +1174,0,-1,-1 +1175,2039.75,17.7763,478.433 +1176,0,-1,-1 +1177,2043.35,17.9969,498.773 +1178,0,-1,-1 +1179,2037.19,19.3787,507.997 +1180,0,-1,-1 +1181,2036.15,19.6011,550.054 +1182,0,-1,-1 +1183,2033.02,19.3835,515.029 +1184,0,-1,-1 +1185,2050.87,16.7498,467.855 +1186,0,-1,-1 +1187,2048.62,17.3269,472.284 +1188,0,-1,-1 +1189,2035.54,17.2211,461.707 +1190,0,-1,-1 +1191,2057.85,16.7656,439.471 +1192,0,-1,-1 +1193,2050.08,17.8102,547.052 +1194,0,-1,-1 +1195,2043.74,17.4718,525.425 +1196,0,-1,-1 +1197,2041.15,18.8811,530.326 +1198,0,-1,-1 +1199,2040.5,18.6964,497.044 +1200,0,-1,-1 +1201,2033.85,21.729,695.414 +1202,0,-1,-1 +1203,2044.55,19.2203,622.499 +1204,0,-1,-1 +1205,2040.35,18.4642,548.375 +1206,0,-1,-1 +1207,2035.65,18.7515,561.565 +1208,0,-1,-1 +1209,2047.45,19.7061,524.829 +1210,0,-1,-1 +1211,2054.3,17.9834,496.45 +1212,0,-1,-1 +1213,2038.03,19.823,549.237 +1214,0,-1,-1 +1215,2029.8,17.9036,517.997 +1216,0,-1,-1 +1217,2052.19,18.5172,494.708 +1218,0,-1,-1 +1219,2036.83,18.822,500.181 +1220,0,-1,-1 +1221,2054.84,20.0551,521.967 +1222,0,-1,-1 +1223,2049.24,18.1429,481.283 +1224,0,-1,-1 +1225,2042.55,19.6466,515.567 +1226,0,-1,-1 +1227,2029.93,17.3127,477.132 +1228,0,-1,-1 +1229,2027.16,16.875,446.955 +1230,0,-1,-1 +1231,2047.7,17.0585,454.31 +1232,0,-1,-1 +1233,2028.06,17.2638,497.179 +1234,0,-1,-1 +1235,2037.1,17.4582,508.025 +1236,0,-1,-1 +1237,2041.53,17.0258,477.595 +1238,0,-1,-1 +1239,2035.65,18.8005,496.1 +1240,0,-1,-1 +1241,2031.32,16.7616,467.531 +1242,0,-1,-1 +1243,2031.13,17.7648,478.899 +1244,0,-1,-1 +1245,2065.02,17.5831,472.297 +1246,0,-1,-1 +1247,2040.74,17.2569,471.845 +1248,0,-1,-1 +1249,2039.5,19.927,546.642 +1250,0,-1,-1 +1251,2056.09,19.5983,536.682 +1252,0,-1,-1 +1253,2055.75,19.3025,516.605 +1254,0,-1,-1 +1255,2038.31,19.7806,520.063 +1256,0,-1,-1 +1257,2054.51,20.3723,542.111 +1258,0,-1,-1 +1259,2028.1,20.3674,539.145 +1260,0,-1,-1 +1261,2050.38,20.1795,525.066 +1262,0,-1,-1 +1263,2051.24,20.4197,523.819 +1264,0,-1,-1 +1265,2053.97,19.2394,532.134 +1266,0,-1,-1 +1267,2043.06,20.4924,547.971 +1268,0,-1,-1 +1269,2052.25,20.1625,538.33 +1270,0,-1,-1 +1271,2052.33,19.8348,532.713 +1272,0,-1,-1 +1273,2036.8,20.4096,543.762 +1274,0,-1,-1 +1275,2058.2,21.5276,562.594 +1276,0,-1,-1 +1277,2037.38,21.4734,576.073 +1278,0,-1,-1 +1279,2032.39,21.4763,571.557 +1280,0,-1,-1 +1281,2030.15,15.8101,443.23 +1282,0,-1,-1 +1283,2039.48,15.3946,430.494 +1284,0,-1,-1 +1285,2051.94,16.0983,430.899 +1286,0,-1,-1 +1287,2048.48,15.3355,413.198 +1288,0,-1,-1 +1289,2049.05,15.6207,436.2 +1290,0,-1,-1 +1291,2046.48,15.7969,437.541 +1292,0,-1,-1 +1293,2036.95,15.8453,430.477 +1294,0,-1,-1 +1295,2048.81,15.9505,435.214 +1296,0,-1,-1 +1297,2066.26,17.414,482.822 +1298,0,-1,-1 +1299,2046.13,18.1927,489.223 +1300,0,-1,-1 +1301,2039.12,18.3862,498.9 +1302,0,-1,-1 +1303,2045.51,18.399,495.139 +1304,0,-1,-1 +1305,2046.23,18.4114,487.263 +1306,0,-1,-1 +1307,2045.91,18.3341,495.883 +1308,0,-1,-1 +1309,2026.14,17.6465,480.853 +1310,0,-1,-1 +1311,2035.63,18.9556,506.512 +1312,0,-1,-1 +1313,2036.69,19.3323,514.596 +1314,0,-1,-1 +1315,2065.36,19.1013,513.614 +1316,0,-1,-1 +1317,2054.88,18.5469,505.717 +1318,0,-1,-1 +1319,2062.09,19.0764,510.955 +1320,0,-1,-1 +1321,2063.68,18.5523,500.291 +1322,0,-1,-1 +1323,2043.9,18.4205,495.999 +1324,0,-1,-1 +1325,2045.3,18.4506,495.584 +1326,0,-1,-1 +1327,2045.06,18.9566,509.39 +1328,0,-1,-1 +1329,2048.24,22.1621,605.998 +1330,0,-1,-1 +1331,2037.86,22.1501,603.303 +1332,0,-1,-1 +1333,2043.34,21.2207,581.639 +1334,0,-1,-1 +1335,2050.86,21.9874,597.217 +1336,0,-1,-1 +1337,2045.74,21.4204,552.843 +1338,0,-1,-1 +1339,2065.5,21.7586,595.099 +1340,0,-1,-1 +1341,2040.71,21.42,548.806 +1342,0,-1,-1 +1343,2044.99,21.5109,581.941 +1344,0,-1,-1 +1345,2030.3,17.7006,487.979 +1346,0,-1,-1 +1347,2044.34,17.1222,474.134 +1348,0,-1,-1 +1349,2042.74,17.6867,478.294 +1350,0,-1,-1 +1351,2046.56,17.4753,475.372 +1352,0,-1,-1 +1353,2044.74,16.3991,447.559 +1354,0,-1,-1 +1355,2050.04,16.6656,457.035 +1356,0,-1,-1 +1357,2055.57,16.8332,499.696 +1358,0,-1,-1 +1359,2043.01,16.8683,488.803 +1360,0,-1,-1 +1361,2037.85,18.4578,496.337 +1362,0,-1,-1 +1363,2038.11,17.8851,507.933 +1364,0,-1,-1 +1365,2043.34,17.4138,496.706 +1366,0,-1,-1 +1367,2038.46,18.122,525.953 +1368,0,-1,-1 +1369,2046.51,17.5548,471.556 +1370,0,-1,-1 +1371,2040.84,17.3851,541.648 +1372,0,-1,-1 +1373,2046.87,17.5811,484.762 +1374,0,-1,-1 +1375,2052.17,18.2776,502.671 +1376,0,-1,-1 +1377,2041.2,19.1698,561.237 +1378,0,-1,-1 +1379,2054.64,19.8044,563.997 +1380,0,-1,-1 +1381,2050.15,19.9938,589.151 +1382,0,-1,-1 +1383,2037.54,19.7042,580.49 +1384,0,-1,-1 +1385,2054.08,19.2942,539.446 +1386,0,-1,-1 +1387,2048.79,20.3301,550.831 +1388,0,-1,-1 +1389,2053.9,19.8261,549.943 +1390,0,-1,-1 +1391,2040,19.3934,553.848 +1392,0,-1,-1 +1393,2043.1,16.1482,447.885 +1394,0,-1,-1 +1395,2048.17,15.9402,444.274 +1396,0,-1,-1 +1397,2059.99,17.1673,466.513 +1398,0,-1,-1 +1399,2046.7,15.916,452.168 +1400,0,-1,-1 +1401,2060.27,16.2907,468.837 +1402,0,-1,-1 +1403,2051.33,16.0635,445.194 +1404,0,-1,-1 +1405,2046.32,16.2495,476.964 +1406,0,-1,-1 +1407,2042.67,16.2145,482.521 +1408,0,-1,-1 +1409,2043.29,20.414,544.555 +1410,0,-1,-1 +1411,2045.23,19.9501,526.289 +1412,0,-1,-1 +1413,2040.5,19.9642,554.541 +1414,0,-1,-1 +1415,2057.99,20.3354,590.686 +1416,0,-1,-1 +1417,2045.91,19.8738,519.277 +1418,0,-1,-1 +1419,2056.39,19.9521,523.884 +1420,0,-1,-1 +1421,2039.08,20.3846,547.692 +1422,0,-1,-1 +1423,2030.9,19.7091,536.159 +1424,0,-1,-1 +1425,2039.08,18.0344,478.651 +1426,0,-1,-1 +1427,2035.09,18.27,498.947 +1428,0,-1,-1 +1429,2051.25,18.733,523.741 +1430,0,-1,-1 +1431,2054.8,18.5256,516.363 +1432,0,-1,-1 +1433,2024.18,17.8507,453.558 +1434,0,-1,-1 +1435,2052.05,18.1118,492.923 +1436,0,-1,-1 +1437,2056.26,18.7896,513.378 +1438,0,-1,-1 +1439,2045.35,18.3456,513.785 +1440,0,-1,-1 +1441,2044.55,17.5378,479.515 +1442,0,-1,-1 +1443,2030.79,17.8505,466.48 +1444,0,-1,-1 +1445,2038.37,17.8792,513.813 +1446,0,-1,-1 +1447,2052.05,18.7139,582.977 +1448,0,-1,-1 +1449,2044.88,18.0531,462.105 +1450,0,-1,-1 +1451,2044.28,17.7117,470.295 +1452,0,-1,-1 +1453,2040.61,18.1871,482.97 +1454,0,-1,-1 +1455,2053.26,18.0794,490.381 +1456,0,-1,-1 +1457,2057.77,19.7177,502.293 +1458,0,-1,-1 +1459,2047.11,19.7836,522.248 +1460,0,-1,-1 +1461,2037.79,21.2672,631.189 +1462,0,-1,-1 +1463,2039.39,20.5206,594.935 +1464,0,-1,-1 +1465,2042.03,19.6726,452.27 +1466,0,-1,-1 +1467,2058.01,19.7071,499.701 +1468,0,-1,-1 +1469,2044.38,19.9021,498.573 +1470,0,-1,-1 +1471,2044.96,20.021,538.774 +1472,0,-1,-1 +1473,2044.87,18.9881,524.698 +1474,0,-1,-1 +1475,2059.74,18.8102,508.303 +1476,0,-1,-1 +1477,2060.28,19.1447,492.118 +1478,0,-1,-1 +1479,2033.49,18.7536,493.809 +1480,0,-1,-1 +1481,2047.47,18.7118,482.902 +1482,0,-1,-1 +1483,2049.94,18.5997,473.639 +1484,0,-1,-1 +1485,2057.16,19.3484,500.513 +1486,0,-1,-1 +1487,2035.5,18.5851,485.151 +1488,0,-1,-1 +1489,2056.12,20.045,520.157 +1490,0,-1,-1 +1491,2043.81,20.5417,536.621 +1492,0,-1,-1 +1493,2046.93,20.776,543.94 +1494,0,-1,-1 +1495,2046.52,20.0082,528.589 +1496,0,-1,-1 +1497,2053.68,20.8306,531.701 +1498,0,-1,-1 +1499,2049.01,20.8093,538.6 +1500,0,-1,-1 +1501,2016.48,20.943,544.754 +1502,0,-1,-1 +1503,2047.63,20.8914,547.709 +1504,0,-1,-1 +1505,2050.26,19.1499,500.715 +1506,0,-1,-1 +1507,2058.76,19.8235,517.773 +1508,0,-1,-1 +1509,2043.81,19.9191,516.139 +1510,0,-1,-1 +1511,2043.43,19.3868,509.392 +1512,0,-1,-1 +1513,2030.92,19.1359,499.335 +1514,0,-1,-1 +1515,2044.86,19.3749,506.299 +1516,0,-1,-1 +1517,2035.16,20.0139,514.486 +1518,0,-1,-1 +1519,2037.22,19.77,525.141 +1520,0,-1,-1 +1521,2048.94,19.9684,531.55 +1522,0,-1,-1 +1523,2047.03,21.2832,570.298 +1524,0,-1,-1 +1525,2056.76,21.8967,554.819 +1526,0,-1,-1 +1527,2047.63,21.0501,559.272 +1528,0,-1,-1 +1529,2049.22,21.7266,550.644 +1530,0,-1,-1 +1531,2041.37,20.6019,551.679 +1532,0,-1,-1 +1533,2034.24,21.205,555.685 +1534,0,-1,-1 +1535,2031.54,21.5403,569.187 +1536,2037.21,16.7739,490.321 +1537,2053.77,18.7314,576.289 +1538,2058.91,15.9713,438.496 +1539,2038.75,20.1006,619.458 +1540,2040.09,16.3698,453.895 +1541,2050.41,20.2291,589.062 +1542,2033.08,16.0828,411.889 +1543,2036.41,18.7813,486.285 +1544,2047.55,17.2692,494.864 +1545,2051.66,19.9471,625.21 +1546,2058.5,16.8916,502.61 +1547,2044.65,19.4155,621.922 +1548,2048.63,16.2426,438.707 +1549,2042.77,19.7061,570.268 +1550,2045.48,17.0333,455.18 +1551,2041.03,19.8505,573.578 +1552,2055.78,19.2885,559.02 +1553,2027.08,19.6269,580.791 +1554,2061.04,18.8758,555.997 +1555,2035.5,19.9699,586.91 +1556,2044.51,19.7161,556.092 +1557,2040.18,19.7621,567.586 +1558,2051.64,20.2574,558.727 +1559,2045.8,19.6381,545.571 +1560,2033.2,19.7491,566.515 +1561,2064.58,20.2888,625.703 +1562,2048.52,19.2029,555.779 +1563,2047.48,19.937,565.731 +1564,2034.86,19.6248,538.734 +1565,2039.99,20.2161,574.796 +1566,2056.58,19.4172,539.833 +1567,2055.88,19.4943,551.585 +1568,2050.51,16.2107,476.139 +1569,2034.63,19.8826,562.02 +1570,2041.51,16.387,489.792 +1571,2057.77,17.7241,518.997 +1572,2053.6,15.7951,462.167 +1573,2052.37,17.8636,496.901 +1574,2042.08,16.9407,463.042 +1575,2053.52,18.9772,482.992 +1576,2037.27,16.2242,479.628 +1577,2035.67,19.0878,537.37 +1578,2058.02,18.2463,506.225 +1579,2047.82,18.7197,531.731 +1580,2046.45,16.2382,470.981 +1581,2047.52,18.4546,534.793 +1582,2052.85,15.5195,430.898 +1583,2060.54,17.7911,493.023 +1584,2032.61,17.7223,529.545 +1585,2034.25,17.6119,509.382 +1586,2033.19,17.6327,522.931 +1587,0,-1,-1 +1588,2045.12,17.7066,518.402 +1589,2047.79,17.557,499.228 +1590,2028.8,17.7302,516.054 +1591,2045.93,18.7443,524.905 +1592,2048.55,19.2921,545.567 +1593,2047.9,19.6925,537.635 +1594,2053.49,17.688,520.589 +1595,2041.51,18.1165,516.511 +1596,2046.01,19.5146,545.502 +1597,2066.95,19.8587,530.956 +1598,2059.02,18.2407,513.999 +1599,2053.92,17.3929,510.877 +1600,2049.65,16.8222,488.552 +1601,2033.68,18.1584,526.2 +1602,2041.44,16.6629,496.537 +1603,2063.96,18.5292,526.133 +1604,2051.16,16.3371,485.559 +1605,2043.2,18.5076,522.977 +1606,2041.47,16.6398,453.68 +1607,2074.06,18.2733,525.208 +1608,2050.95,16.76,495.806 +1609,2022.08,18.969,533.567 +1610,2056.73,16.9001,499.197 +1611,2042.67,18.3129,532.635 +1612,2046.44,15.8414,473.225 +1613,2057.61,18.2104,522.368 +1614,2034.28,16.7104,478.63 +1615,2043.97,18.1016,513.76 +1616,2056.08,16.9694,512.413 +1617,2039.94,20.7547,587.939 +1618,2036.99,17.4119,520.122 +1619,2035.89,19.239,560.118 +1620,2038.79,16.9111,501.483 +1621,2052.58,18.5325,543.945 +1622,2049.7,19.7595,537.195 +1623,2029.28,18.7287,549.37 +1624,2053.18,18.6144,570.849 +1625,2047.42,19.4408,563.373 +1626,2043.4,19.6273,567.081 +1627,2041.65,20.1587,570.522 +1628,2057.08,17.3674,513.843 +1629,2057.84,20.7797,575.434 +1630,2039.58,17.5308,524.682 +1631,2034.86,19.9176,568.572 +1632,2042.11,21.1131,609.926 +1633,2058.56,19.2456,531.395 +1634,2045.42,21.0737,600.25 +1635,2046.77,19.5671,536.709 +1636,2060.04,20.9266,609.887 +1637,2050.53,19.2309,513.875 +1638,2042.56,21.8971,612.254 +1639,2037.26,17.0253,465.887 +1640,2047.66,21.4133,604.196 +1641,2067.2,19.5644,532.138 +1642,2042.66,19.8423,585.291 +1643,2045.11,19.3656,527.642 +1644,2053.35,19.8954,587.489 +1645,2049.44,19.995,529.359 +1646,2057.86,20.8928,585.856 +1647,2056.39,19.5169,526.357 +1648,2043.88,20.0421,568.533 +1649,2042.26,20.6543,585.182 +1650,2058.66,18.6163,553.736 +1651,2031.71,20.6655,583.54 +1652,2026.99,20.9923,571.182 +1653,2043.04,20.6969,580.174 +1654,2043.6,18.0612,522.797 +1655,2053.62,20.0099,568.539 +1656,2050.26,20.5395,583.947 +1657,2052.2,19.9669,582.488 +1658,2047.41,20.3709,581.755 +1659,2069.53,19.1866,562.551 +1660,2053.83,19.4693,560.439 +1661,2056.43,20.0177,579.68 +1662,2047.44,20.1627,573.195 +1663,2037.26,18.8671,545.07 +1664,2060.3,19.8367,571.779 +1665,2058.71,20.7268,578.297 +1666,2043.04,19.5909,561.81 +1667,2046.8,19.2714,531.679 +1668,2037.47,20.3536,572.947 +1669,2044.21,21.0308,565.771 +1670,2054.36,19.2829,488.03 +1671,2050.44,18.4726,459.078 +1672,2041.5,19.7265,573.347 +1673,2057.56,20.73,566.935 +1674,2050.91,20.4665,583.09 +1675,2051.56,19.0873,549.103 +1676,2051.73,19.6367,556.902 +1677,2041.21,19.185,518.404 +1678,2050.98,19.8295,547.974 +1679,2047.57,18.692,509.007 +1680,2045.16,18.9533,544.773 +1681,2040.2,21.6116,599.8 +1682,2044.38,19.676,555.895 +1683,2042.01,21.5239,597.966 +1684,2054.26,19.344,548.206 +1685,2051.57,20.804,541.756 +1686,2071.37,19.4327,547.889 +1687,2047.21,20.8935,564.546 +1688,2043.62,19.7989,564.37 +1689,2038.26,21.4846,593.427 +1690,2040.33,19.3426,546.481 +1691,2029.05,18.6204,542.953 +1692,2048.78,19.1406,541.305 +1693,2042.71,21.4455,587.335 +1694,2061.48,19.5425,543.412 +1695,2045.55,18.7969,535.133 +1696,2044.69,17.7989,502.857 +1697,2043.25,20.2466,579.782 +1698,2030.9,18.0577,506.499 +1699,2046.81,19.9374,574.806 +1700,2042.93,17.8495,496.097 +1701,2054.89,19.32,531.747 +1702,2048.95,17.7182,451.2 +1703,2040.46,19.7217,557.591 +1704,2036.49,17.2313,489.732 +1705,2058.37,20.0404,579.949 +1706,2062.06,17.741,502.112 +1707,2049.16,20.4329,585.829 +1708,2050.57,17.75,475.514 +1709,2057.64,19.8735,562.957 +1710,2043.74,16.9298,482.573 +1711,2060.45,19.7281,563.215 +1712,2039.11,19.5296,559.643 +1713,2038.52,17.6899,499.336 +1714,2048.14,20.3126,584.818 +1715,2028.67,17.3081,489.455 +1716,2060.49,19.4721,559.172 +1717,2033.42,17.503,484.284 +1718,2043.52,19.4545,551.558 +1719,2046.96,18.7296,493.799 +1720,2064.14,20.4291,570.484 +1721,2039.22,20.906,557.018 +1722,2037.59,20.3705,574.102 +1723,2034.52,19.61,529.69 +1724,2053.5,20.9206,580.58 +1725,2051.65,21.2224,554.8 +1726,2068.27,20.6841,580.453 +1727,2052,20.0925,524.542 +1728,2043.79,18.4027,528.296 +1729,2042.94,20.9773,591.669 +1730,2048.12,18.6717,529.003 +1731,2045.14,19.9376,584.231 +1732,2059.5,19.5555,539.178 +1733,2041.85,19.2364,565.209 +1734,2052.54,19.2353,538.583 +1735,2046.47,20.136,573.167 +1736,2047.21,19.3274,546.509 +1737,2055.08,21.5828,616.448 +1738,2051.07,18.6538,535.324 +1739,2040.84,22.464,621.834 +1740,2037.68,19.1591,535.536 +1741,2059.08,22.1851,621.573 +1742,2043.36,18.8008,528.679 +1743,2043.92,23.1671,640.996 +1744,2060.28,19.2453,560.982 +1745,2046.74,18.7174,535.385 +1746,2046.48,19.2056,565.602 +1747,2047.94,17.8496,523.141 +1748,2037.43,19.6814,553.162 +1749,2063.75,17.6015,493.839 +1750,2039.58,19.4904,559.264 +1751,2061.76,20.5234,551.501 +1752,2041.04,20.5035,638.075 +1753,2046.33,19.6528,544.768 +1754,2036.62,19.6793,573.565 +1755,2053.94,19.5793,557.859 +1756,2034.79,20.3776,574.108 +1757,2055.19,19.4532,547.143 +1758,2056.47,20.7956,573.576 +1759,2048.95,19.5842,547.242 +1760,2062.61,20.4463,569.339 +1761,2041.11,16.8605,492.06 +1762,2053.98,20.3642,568.902 +1763,2045.01,16.9553,493.844 +1764,2046.1,19.1689,547.334 +1765,2043.57,16.9451,479.277 +1766,2040.54,19.4289,551.181 +1767,2061.05,19.0698,517.572 +1768,2045.6,20.4018,571.42 +1769,2062.01,18.6322,526.739 +1770,2052.52,21.2401,593.097 +1771,2059,18.664,531.071 +1772,2040.98,19.8659,557.797 +1773,2063.44,18.5153,525.356 +1774,2056.63,19.6385,556.311 +1775,2033.49,17.8838,505.56 +1776,2045.63,17.121,481.889 +1777,2055.55,19.4425,541.861 +1778,2044.84,15.2842,453.756 +1779,2053.3,18.2625,532.391 +1780,2038.02,15.4978,449.348 +1781,2032.02,17.4959,511.714 +1782,2036.93,15.8919,457.957 +1783,2041.9,18.7804,531.353 +1784,2055.29,15.6916,472.752 +1785,2055.74,19.7293,549.317 +1786,2058.36,15.659,470.115 +1787,2035.85,20.0076,558.745 +1788,2040.11,15.8857,468.204 +1789,2041.67,19.9353,550.188 +1790,2045.22,16.0975,470.705 +1791,2067,18.8836,540.169 +1792,2050.1,19.8692,573.642 +1793,2049.17,17.3238,496.091 +1794,2050.16,19.6303,531.191 +1795,2052.46,17.1376,477.504 +1796,2030.86,19.8889,540.081 +1797,2070.06,17.1114,461.221 +1798,2048.02,19.3289,489.541 +1799,2042.17,17.2474,419.263 +1800,2045.23,19.5634,563.142 +1801,2054.88,17.3544,498.84 +1802,2060.89,20.2827,587.265 +1803,2042.98,18.1018,509.424 +1804,2060.6,19.9741,560.33 +1805,2054.72,17.3754,499.362 +1806,2046.38,19.3029,529.922 +1807,2050.48,17.2865,487.528 +1808,2054.52,18.9663,556.64 +1809,2043.98,19.8013,564.473 +1810,2039.23,18.9428,555.776 +1811,2047.68,19.3362,551.04 +1812,2043.02,19.2137,555.706 +1813,2038.23,19.2157,539.306 +1814,2042.12,20.0903,542.641 +1815,2060.66,19.2353,511.35 +1816,2045.41,20.4076,581.944 +1817,2055.52,20.2666,580.043 +1818,2051.46,20.0883,579.168 +1819,2054.67,20.4013,577.059 +1820,2046.51,20.8504,583.448 +1821,2072.39,20.0665,551.897 +1822,2053.61,19.5076,554.858 +1823,2037.17,19.3254,539.726 +1824,2039.12,18.87,529.391 +1825,2049,19.8714,566.208 +1826,2045.56,19.0903,528.084 +1827,2054.86,18.9395,549.859 +1828,2035.42,19.1571,523.989 +1829,2056.78,19.6385,545.895 +1830,2050.7,17.7838,465.705 +1831,2048.76,18.7997,511.121 +1832,2040.15,17.1266,521.495 +1833,2052.92,20.3261,577.826 +1834,2053.57,19.2078,576.085 +1835,2040.84,20.5205,575.245 +1836,2042.93,18.4021,528.811 +1837,2045.32,19.5274,561.29 +1838,2044.3,17.6749,487.007 +1839,2050.24,18.6766,534.808 +1840,2053.55,18.3097,515.735 +1841,2049.42,19.8348,585.005 +1842,2051.5,17.7523,505.39 +1843,2036.23,19.7819,578.271 +1844,2037.52,18.0799,505.532 +1845,2049.62,20.687,585.567 +1846,2032.58,17.9988,482.45 +1847,2050.01,20.4033,579.761 +1848,2059.31,17.8691,503.783 +1849,2047.42,19.1309,564.742 +1850,2061.43,17.8454,511.596 +1851,2034.16,20.3545,583.494 +1852,2046.58,18.6148,517.988 +1853,2055.26,19.2754,567.842 +1854,2053.81,18.0949,502.987 +1855,2037.13,20.7435,579.745 +1856,2054.96,20.4504,598.221 +1857,2034.83,19.1634,554.502 +1858,2048.71,21.2405,609.348 +1859,2043.36,19.1167,569.499 +1860,2063.31,20.9757,591.852 +1861,2053.44,19.9847,566.436 +1862,2059.34,20.0572,585.618 +1863,2052.57,19.5852,554.678 +1864,2042.82,21.396,605.528 +1865,2052.62,19.4567,569.869 +1866,2043.44,19.9584,594.543 +1867,2035.76,19.8943,577.748 +1868,2060.02,20.0335,579.723 +1869,2038.23,19.5805,567.207 +1870,2041.46,20.3411,593.25 +1871,2057.21,19.6784,570.552 +1872,2029.27,18.2154,539.843 +1873,2060.9,16.8781,490.4 +1874,2057.16,17.8732,530.688 +1875,2035.87,16.8597,489.823 +1876,2053.87,18.3845,540.948 +1877,2057.23,16.8958,484.311 +1878,2049.81,18.3595,538.08 +1879,2053.43,15.9592,467.402 +1880,2056,18.9593,563.136 +1881,2052.96,16.8857,490.188 +1882,2046.76,19.6827,566.682 +1883,2049.33,16.9253,495.594 +1884,2038.99,19.039,555.164 +1885,2050.59,15.9009,464.022 +1886,2063.57,20.1965,569.843 +1887,2047.73,16.9979,483.882 +1888,2044.59,18.3857,535.337 +1889,2033.06,20.5849,590.091 +1890,2057.42,18.8368,547.65 +1891,2031.83,20.17,582.559 +1892,2036.92,18.5741,533.16 +1893,2032.29,19.7419,571.434 +1894,2039.17,19.7451,558.598 +1895,2050.85,20.6928,596.019 +1896,2043.83,20.7252,574.866 +1897,2055.17,19.9681,582.198 +1898,2062.63,21.493,600.108 +1899,2054.35,20.3293,599.067 +1900,2054.65,18.9915,562.109 +1901,2060.18,20.4143,586.131 +1902,2049.01,20.7165,566.912 +1903,2050.88,19.9258,578.46 +1904,2038.73,20.6505,580.54 +1905,2045.08,19.25,553.623 +1906,2052.3,21.5202,597.766 +1907,2037.43,18.793,538.823 +1908,2030.36,20.2753,561.502 +1909,2047.89,18.8857,541.743 +1910,2048.03,20.6022,575.433 +1911,2036.81,18.221,535.291 +1912,2031.42,20.5851,575.577 +1913,2038.64,18.165,526.867 +1914,2028.57,20.6034,588.94 +1915,2052.67,18.3514,538.003 +1916,2039.78,21.6279,588.256 +1917,2054.28,18.4528,532.61 +1918,2047.62,21.2213,587.651 +1919,2052.92,18.6161,537.873 +1920,2035.48,19.3262,558.781 +1921,2044.04,18.5276,541.964 +1922,2040.86,19.6151,562.23 +1923,2035.38,18.7296,533.034 +1924,2056.02,18.9132,531.828 +1925,2058.12,18.5256,510.87 +1926,2042.34,18.467,463.235 +1927,2050.91,19.9718,473.826 +1928,2029.48,17.2837,527.733 +1929,2050.09,19.4672,558 +1930,2075.9,19.0046,551.219 +1931,2050.37,18.8204,553.936 +1932,2045.34,19.4577,551.314 +1933,2047.75,20.7478,567.489 +1934,2053.03,19.0152,546.091 +1935,2049.19,18.7536,513.488 +1936,2048.12,15.6767,487.976 +1937,2050.3,16.3901,493.943 +1938,2043.57,17.7221,529.927 +1939,2047.85,16.9978,517.804 +1940,2051.67,17.9881,508.325 +1941,2040.45,18.7682,515.868 +1942,2038.83,17.6752,508.746 +1943,2060.19,16.4191,459.029 +1944,2040.64,18.3466,542.529 +1945,2046.72,16.9502,517.662 +1946,2029.92,17.8869,529.347 +1947,2060.82,18.9593,545.585 +1948,2037.44,17.9269,521.696 +1949,2054.63,17.4808,500.188 +1950,2039.87,17.8714,507.292 +1951,2065.52,16.4956,484.141 +1952,2049.06,16.8018,509.147 +1953,2041.04,22.6789,641.693 +1954,2048.31,17.0014,517.163 +1955,2045.01,22.4331,638.262 +1956,2043.38,16.4022,481.728 +1957,2052.74,21.9882,623.961 +1958,2029.67,17.2917,508.519 +1959,2059.23,21.5323,613.434 +1960,2035.88,17.5394,525.302 +1961,2046.03,21.2892,626.672 +1962,2056.38,17.9319,538.322 +1963,2056.71,22.9712,667.4 +1964,2039.19,17.7976,518.698 +1965,2043.47,22.0459,627.872 +1966,2062.12,17.282,484.929 +1967,2044.26,22.4734,641.102 +1968,2040.95,17.5093,531.217 +1969,2057.75,19.3209,560.516 +1970,2043.36,16.6449,505.774 +1971,2052.9,19.0879,584.983 +1972,2046.83,17.4567,501.86 +1973,2044.34,17.8988,529.498 +1974,2054.36,17.3928,472.008 +1975,2031.22,18.673,511.891 +1976,2032.77,18.3642,550.851 +1977,2052.37,19.3695,561.163 +1978,2040.46,18.9105,551.97 +1979,2045.39,19.1436,540.339 +1980,2043.49,18.2393,533.313 +1981,2036.82,18.5718,512.257 +1982,2031.38,18.9155,550.145 +1983,2042.47,18.4998,500.015 +1984,2051.05,18.4633,543.98 +1985,2038.59,18.6662,544.873 +1986,2038.2,19.0017,554.369 +1987,2029.27,19.0385,546.428 +1988,2031.99,18.9914,550.155 +1989,2049.77,18.2586,525.491 +1990,2044.33,19.0373,538.306 +1991,2037.12,19.8062,556.35 +1992,2034.2,19.0621,544.871 +1993,2034.22,18.8682,547.921 +1994,2047.49,18.334,536.195 +1995,2030.75,19.0372,553.065 +1996,2026.19,18.2877,531.026 +1997,2055.74,19.0157,524.067 +1998,2049.49,18.9652,538.568 +1999,2037.3,18.9196,546.135 +2000,2052.24,16.4403,491.668 +2001,2056.71,20.9682,591.108 +2002,2052.84,16.6658,494.285 +2003,2032.16,20.912,588.212 +2004,2041.46,16.3649,480.81 +2005,2055.5,20.3802,576.246 +2006,2044.08,15.9942,463.769 +2007,2047.12,21.0983,584.465 +2008,2045.99,17.5069,509.24 +2009,2063.29,19.1992,562.328 +2010,2043.32,17.4988,512.975 +2011,2065.59,19.456,581.214 +2012,2047.78,17.7564,510.19 +2013,2048.28,20.8291,587.603 +2014,2052.11,18.0256,517.836 +2015,2054.83,19.2134,562.203 +2016,2047.67,18.9604,554.228 +2017,2054.82,19.384,552.614 +2018,2037.07,18.3379,559.022 +2019,2046.17,18.6918,537.839 +2020,2053.1,17.6903,538.62 +2021,2060.66,19.9604,555.748 +2022,2037.36,18.0136,539.401 +2023,2045.64,18.2495,515.231 +2024,2041.46,17.9542,543.661 +2025,2066.12,19.1965,548.955 +2026,2038.97,18.2035,562.047 +2027,2043.08,18.8213,537.513 +2028,2044.15,18.1102,540.729 +2029,2041.71,19.2816,547.265 +2030,2042.43,18.0799,539.54 +2031,2051.98,18.9315,534.112 +2032,2044.84,19.1571,552.134 +2033,2039.13,19.3985,576.149 +2034,2051.64,17.621,532.086 +2035,2035.89,19.5934,568.45 +2036,2031.18,17.4701,517.816 +2037,2055.07,19.7707,561.343 +2038,2051.31,18.0207,531.611 +2039,2049.25,19.2036,561.513 +2040,2047.24,19.459,552.219 +2041,2047.12,18.6806,550.76 +2042,2038.05,18.9561,550.27 +2043,2041.69,18.9227,552.427 +2044,2053.36,17.444,519.705 +2045,2057.32,19.4643,558.608 +2046,2043.56,17.9121,529.615 +2047,2049.32,18.9751,549.814 +TABLE CRVTime +#channel,timeOffset +0,0 +1,-25.3202 +2,0 +3,-25.3202 +4,0 +5,-25.3202 +6,0 +7,-25.3202 +8,0 +9,-25.3202 +10,0 +11,-25.3202 +12,0 +13,-25.3202 +14,0 +15,-25.3202 +16,0 +17,-25.3202 +18,0 +19,-25.3202 +20,0 +21,-25.3202 +22,0 +23,-25.3202 +24,0 +25,-25.3202 +26,0 +27,-25.3202 +28,0 +29,-25.3202 +30,0 +31,-25.3202 +32,0.578138 +33,-26.009 +34,0.578138 +35,-26.009 +36,0.578138 +37,-26.009 +38,0.578138 +39,-26.009 +40,0.578138 +41,-26.009 +42,0.578138 +43,-26.009 +44,0.578138 +45,-26.009 +46,0.578138 +47,-26.009 +48,0.578138 +49,-26.009 +50,0.578138 +51,-26.009 +52,0.578138 +53,-26.009 +54,0.578138 +55,-26.009 +56,0.578138 +57,-26.009 +58,0.578138 +59,-26.009 +60,0.578138 +61,-26.009 +62,0.578138 +63,-26.009 +64,-0.545545 +65,-26.4481 +66,-0.545545 +67,-26.4481 +68,-0.545545 +69,-26.4481 +70,-0.545545 +71,-26.4481 +72,-0.545545 +73,-26.4481 +74,-0.545545 +75,-26.4481 +76,-0.545545 +77,-26.4481 +78,-0.545545 +79,-26.4481 +80,-0.545545 +81,-26.4481 +82,-0.545545 +83,-26.4481 +84,-0.545545 +85,-26.4481 +86,-0.545545 +87,-26.4481 +88,-0.545545 +89,-26.4481 +90,-0.545545 +91,-26.4481 +92,-0.545545 +93,-26.4481 +94,-0.545545 +95,-26.4481 +96,-1.51252 +97,-27.5498 +98,-1.51252 +99,-27.5498 +100,-1.51252 +101,-27.5498 +102,-1.51252 +103,-27.5498 +104,-1.51252 +105,-27.5498 +106,-1.51252 +107,-27.5498 +108,-1.51252 +109,-27.5498 +110,-1.51252 +111,-27.5498 +112,-1.51252 +113,-27.5498 +114,-1.51252 +115,-27.5498 +116,-1.51252 +117,-27.5498 +118,-1.51252 +119,-27.5498 +120,-1.51252 +121,-27.5498 +122,-1.51252 +123,-27.5498 +124,-1.51252 +125,-27.5498 +126,-1.51252 +127,-27.5498 +128,-1.37198 +129,-25.2844 +130,-1.37198 +131,-25.2844 +132,-1.37198 +133,-25.2844 +134,-1.37198 +135,-25.2844 +136,-1.37198 +137,-25.2844 +138,-1.37198 +139,-25.2844 +140,-1.37198 +141,-25.2844 +142,-1.37198 +143,-25.2844 +144,-1.37198 +145,-25.2844 +146,-1.37198 +147,-25.2844 +148,-1.37198 +149,-25.2844 +150,-1.37198 +151,-25.2844 +152,-1.37198 +153,-25.2844 +154,-1.37198 +155,-25.2844 +156,-1.37198 +157,-25.2844 +158,-1.37198 +159,-25.2844 +160,-7.4944 +161,-25.6114 +162,-7.4944 +163,-25.6114 +164,-7.4944 +165,-25.6114 +166,-7.4944 +167,-25.6114 +168,-7.4944 +169,-25.6114 +170,-7.4944 +171,-25.6114 +172,-7.4944 +173,-25.6114 +174,-7.4944 +175,-25.6114 +176,-7.4944 +177,-25.6114 +178,-7.4944 +179,-25.6114 +180,-7.4944 +181,-25.6114 +182,-7.4944 +183,-25.6114 +184,-7.4944 +185,-25.6114 +186,-7.4944 +187,-25.6114 +188,-7.4944 +189,-25.6114 +190,-7.4944 +191,-25.6114 +192,-6.92331 +193,-25.6896 +194,-6.92331 +195,-25.6896 +196,-6.92331 +197,-25.6896 +198,-6.92331 +199,-25.6896 +200,-6.92331 +201,-25.6896 +202,-6.92331 +203,-25.6896 +204,-6.92331 +205,-25.6896 +206,-6.92331 +207,-25.6896 +208,-6.92331 +209,-25.6896 +210,-6.92331 +211,-25.6896 +212,-6.92331 +213,-25.6896 +214,-6.92331 +215,-25.6896 +216,-6.92331 +217,-25.6896 +218,-6.92331 +219,-25.6896 +220,-6.92331 +221,-25.6896 +222,-6.92331 +223,-25.6896 +224,-8.38702 +225,-26.5647 +226,-8.38702 +227,-26.5647 +228,-8.38702 +229,-26.5647 +230,-8.38702 +231,-26.5647 +232,-8.38702 +233,-26.5647 +234,-8.38702 +235,-26.5647 +236,-8.38702 +237,-26.5647 +238,-8.38702 +239,-26.5647 +240,-8.38702 +241,-26.5647 +242,-8.38702 +243,-26.5647 +244,-8.38702 +245,-26.5647 +246,-8.38702 +247,-26.5647 +248,-8.38702 +249,-26.5647 +250,-8.38702 +251,-26.5647 +252,-8.38702 +253,-26.5647 +254,-8.38702 +255,-26.5647 +256,-109.716 +257,-27.5925 +258,-109.716 +259,-27.5925 +260,-109.716 +261,-27.5925 +262,-109.716 +263,-27.5925 +264,-109.716 +265,-27.5925 +266,-109.716 +267,-27.5925 +268,-109.716 +269,-27.5925 +270,-109.716 +271,-27.5925 +272,-109.716 +273,-27.5925 +274,-109.716 +275,-27.5925 +276,-109.716 +277,-27.5925 +278,-109.716 +279,-27.5925 +280,-109.716 +281,-27.5925 +282,-109.716 +283,-27.5925 +284,-109.716 +285,-27.5925 +286,-109.716 +287,-27.5925 +288,-110.186 +289,-27.274 +290,-110.186 +291,-27.274 +292,-110.186 +293,-27.274 +294,-110.186 +295,-27.274 +296,-110.186 +297,-27.274 +298,-110.186 +299,-27.274 +300,-110.186 +301,-27.274 +302,-110.186 +303,-27.274 +304,-110.186 +305,-27.274 +306,-110.186 +307,-27.274 +308,-110.186 +309,-27.274 +310,-110.186 +311,-27.274 +312,-110.186 +313,-27.274 +314,-110.186 +315,-27.274 +316,-110.186 +317,-27.274 +318,-110.186 +319,-27.274 +320,-110.624 +321,-27.632 +322,-110.624 +323,-27.632 +324,-110.624 +325,-27.632 +326,-110.624 +327,-27.632 +328,-110.624 +329,-27.632 +330,-110.624 +331,-27.632 +332,-110.624 +333,-27.632 +334,-110.624 +335,-27.632 +336,-110.624 +337,-27.632 +338,-110.624 +339,-27.632 +340,-110.624 +341,-27.632 +342,-110.624 +343,-27.632 +344,-110.624 +345,-27.632 +346,-110.624 +347,-27.632 +348,-110.624 +349,-27.632 +350,-110.624 +351,-27.632 +352,-111.522 +353,-29.1769 +354,-111.522 +355,-29.1769 +356,-111.522 +357,-29.1769 +358,-111.522 +359,-29.1769 +360,-111.522 +361,-29.1769 +362,-111.522 +363,-29.1769 +364,-111.522 +365,-29.1769 +366,-111.522 +367,-29.1769 +368,-111.522 +369,-29.1769 +370,-111.522 +371,-29.1769 +372,-111.522 +373,-29.1769 +374,-111.522 +375,-29.1769 +376,-111.522 +377,-29.1769 +378,-111.522 +379,-29.1769 +380,-111.522 +381,-29.1769 +382,-111.522 +383,-29.1769 +384,1.06952 +385,-27.839 +386,1.06952 +387,-27.839 +388,1.06952 +389,-27.839 +390,1.06952 +391,-27.839 +392,1.06952 +393,-27.839 +394,1.06952 +395,-27.839 +396,1.06952 +397,-27.839 +398,1.06952 +399,-27.839 +400,1.06952 +401,-27.839 +402,1.06952 +403,-27.839 +404,1.06952 +405,-27.839 +406,1.06952 +407,-27.839 +408,1.06952 +409,-27.839 +410,1.06952 +411,-27.839 +412,1.06952 +413,-27.839 +414,1.06952 +415,-27.839 +416,0.916677 +417,-28.5529 +418,0.916677 +419,-28.5529 +420,0.916677 +421,-28.5529 +422,0.916677 +423,-28.5529 +424,0.916677 +425,-28.5529 +426,0.916677 +427,-28.5529 +428,0.916677 +429,-28.5529 +430,0.916677 +431,-28.5529 +432,0.916677 +433,-28.5529 +434,0.916677 +435,-28.5529 +436,0.916677 +437,-28.5529 +438,0.916677 +439,-28.5529 +440,0.916677 +441,-28.5529 +442,0.916677 +443,-28.5529 +444,0.916677 +445,-28.5529 +446,0.916677 +447,-28.5529 +448,0.00523895 +449,-28.0203 +450,0.00523895 +451,-28.0203 +452,0.00523895 +453,-28.0203 +454,0.00523895 +455,-28.0203 +456,0.00523895 +457,-28.0203 +458,0.00523895 +459,-28.0203 +460,0.00523895 +461,-28.0203 +462,0.00523895 +463,-28.0203 +464,0.00523895 +465,-28.0203 +466,0.00523895 +467,-28.0203 +468,0.00523895 +469,-28.0203 +470,0.00523895 +471,-28.0203 +472,0.00523895 +473,-28.0203 +474,0.00523895 +475,-28.0203 +476,0.00523895 +477,-28.0203 +478,0.00523895 +479,-28.0203 +480,-0.700077 +481,-29.2939 +482,-0.700077 +483,-29.2939 +484,-0.700077 +485,-29.2939 +486,-0.700077 +487,-29.2939 +488,-0.700077 +489,-29.2939 +490,-0.700077 +491,-29.2939 +492,-0.700077 +493,-29.2939 +494,-0.700077 +495,-29.2939 +496,-0.700077 +497,-29.2939 +498,-0.700077 +499,-29.2939 +500,-0.700077 +501,-29.2939 +502,-0.700077 +503,-29.2939 +504,-0.700077 +505,-29.2939 +506,-0.700077 +507,-29.2939 +508,-0.700077 +509,-29.2939 +510,-0.700077 +511,-29.2939 +512,-11.4532 +513,-36.1776 +514,-11.4532 +515,-36.1776 +516,-11.4532 +517,-36.1776 +518,-11.4532 +519,-36.1776 +520,-11.4532 +521,-36.1776 +522,-11.4532 +523,-36.1776 +524,-11.4532 +525,-36.1776 +526,-11.4532 +527,-36.1776 +528,-11.4532 +529,-36.1776 +530,-11.4532 +531,-36.1776 +532,-11.4532 +533,-36.1776 +534,-11.4532 +535,-36.1776 +536,-11.4532 +537,-36.1776 +538,-11.4532 +539,-36.1776 +540,-11.4532 +541,-36.1776 +542,-11.4532 +543,-36.1776 +544,-10.5125 +545,-36.1453 +546,-10.5125 +547,-36.1453 +548,-10.5125 +549,-36.1453 +550,-10.5125 +551,-36.1453 +552,-10.5125 +553,-36.1453 +554,-10.5125 +555,-36.1453 +556,-10.5125 +557,-36.1453 +558,-10.5125 +559,-36.1453 +560,-10.5125 +561,-36.1453 +562,-10.5125 +563,-36.1453 +564,-10.5125 +565,-36.1453 +566,-10.5125 +567,-36.1453 +568,-10.5125 +569,-36.1453 +570,-10.5125 +571,-36.1453 +572,-10.5125 +573,-36.1453 +574,-10.5125 +575,-36.1453 +576,-11.9359 +577,-36.7237 +578,-11.9359 +579,-36.7237 +580,-11.9359 +581,-36.7237 +582,-11.9359 +583,-36.7237 +584,-11.9359 +585,-36.7237 +586,-11.9359 +587,-36.7237 +588,-11.9359 +589,-36.7237 +590,-11.9359 +591,-36.7237 +592,-11.9359 +593,-36.7237 +594,-11.9359 +595,-36.7237 +596,-11.9359 +597,-36.7237 +598,-11.9359 +599,-36.7237 +600,-11.9359 +601,-36.7237 +602,-11.9359 +603,-36.7237 +604,-11.9359 +605,-36.7237 +606,-11.9359 +607,-36.7237 +608,-12.4648 +609,-37.281 +610,-12.4648 +611,-37.281 +612,-12.4648 +613,-37.281 +614,-12.4648 +615,-37.281 +616,-12.4648 +617,-37.281 +618,-12.4648 +619,-37.281 +620,-12.4648 +621,-37.281 +622,-12.4648 +623,-37.281 +624,-12.4648 +625,-37.281 +626,-12.4648 +627,-37.281 +628,-12.4648 +629,-37.281 +630,-12.4648 +631,-37.281 +632,-12.4648 +633,-37.281 +634,-12.4648 +635,-37.281 +636,-12.4648 +637,-37.281 +638,-12.4648 +639,-37.281 +640,-6.68486 +641,-34.539 +642,-6.68486 +643,-34.539 +644,-6.68486 +645,-34.539 +646,-6.68486 +647,-34.539 +648,-6.68486 +649,-34.539 +650,-6.68486 +651,-34.539 +652,-6.68486 +653,-34.539 +654,-6.68486 +655,-34.539 +656,-6.68486 +657,-34.539 +658,-6.68486 +659,-34.539 +660,-6.68486 +661,-34.539 +662,-6.68486 +663,-34.539 +664,-6.68486 +665,-34.539 +666,-6.68486 +667,-34.539 +668,-6.68486 +669,-34.539 +670,-6.68486 +671,-34.539 +672,-8.79856 +673,-36.1952 +674,-8.79856 +675,-36.1952 +676,-8.79856 +677,-36.1952 +678,-8.79856 +679,-36.1952 +680,-8.79856 +681,-36.1952 +682,-8.79856 +683,-36.1952 +684,-8.79856 +685,-36.1952 +686,-8.79856 +687,-36.1952 +688,-8.79856 +689,-36.1952 +690,-8.79856 +691,-36.1952 +692,-8.79856 +693,-36.1952 +694,-8.79856 +695,-36.1952 +696,-8.79856 +697,-36.1952 +698,-8.79856 +699,-36.1952 +700,-8.79856 +701,-36.1952 +702,-8.79856 +703,-36.1952 +704,-8.00774 +705,-36.3394 +706,-8.00774 +707,-36.3394 +708,-8.00774 +709,-36.3394 +710,-8.00774 +711,-36.3394 +712,-8.00774 +713,-36.3394 +714,-8.00774 +715,-36.3394 +716,-8.00774 +717,-36.3394 +718,-8.00774 +719,-36.3394 +720,-8.00774 +721,-36.3394 +722,-8.00774 +723,-36.3394 +724,-8.00774 +725,-36.3394 +726,-8.00774 +727,-36.3394 +728,-8.00774 +729,-36.3394 +730,-8.00774 +731,-36.3394 +732,-8.00774 +733,-36.3394 +734,-8.00774 +735,-36.3394 +736,-9.42012 +737,-36.9919 +738,-9.42012 +739,-36.9919 +740,-9.42012 +741,-36.9919 +742,-9.42012 +743,-36.9919 +744,-9.42012 +745,-36.9919 +746,-9.42012 +747,-36.9919 +748,-9.42012 +749,-36.9919 +750,-9.42012 +751,-36.9919 +752,-9.42012 +753,-36.9919 +754,-9.42012 +755,-36.9919 +756,-9.42012 +757,-36.9919 +758,-9.42012 +759,-36.9919 +760,-9.42012 +761,-36.9919 +762,-9.42012 +763,-36.9919 +764,-9.42012 +765,-36.9919 +766,-9.42012 +767,-36.9919 +768,-8.21244 +769,-34.7867 +770,-8.21244 +771,-34.7867 +772,-8.21244 +773,-34.7867 +774,-8.21244 +775,-34.7867 +776,-8.21244 +777,-34.7867 +778,-8.21244 +779,-34.7867 +780,-8.21244 +781,-34.7867 +782,-8.21244 +783,-34.7867 +784,-8.21244 +785,-34.7867 +786,-8.21244 +787,-34.7867 +788,-8.21244 +789,-34.7867 +790,-8.21244 +791,-34.7867 +792,-8.21244 +793,-34.7867 +794,-8.21244 +795,-34.7867 +796,-8.21244 +797,-34.7867 +798,-8.21244 +799,-34.7867 +800,-8.78974 +801,-35.0804 +802,-8.78974 +803,-35.0804 +804,-8.78974 +805,-35.0804 +806,-8.78974 +807,-35.0804 +808,-8.78974 +809,-35.0804 +810,-8.78974 +811,-35.0804 +812,-8.78974 +813,-35.0804 +814,-8.78974 +815,-35.0804 +816,-8.78974 +817,-35.0804 +818,-8.78974 +819,-35.0804 +820,-8.78974 +821,-35.0804 +822,-8.78974 +823,-35.0804 +824,-8.78974 +825,-35.0804 +826,-8.78974 +827,-35.0804 +828,-8.78974 +829,-35.0804 +830,-8.78974 +831,-35.0804 +832,-8.86492 +833,-35.832 +834,-8.86492 +835,-35.832 +836,-8.86492 +837,-35.832 +838,-8.86492 +839,-35.832 +840,-8.86492 +841,-35.832 +842,-8.86492 +843,-35.832 +844,-8.86492 +845,-35.832 +846,-8.86492 +847,-35.832 +848,-8.86492 +849,-35.832 +850,-8.86492 +851,-35.832 +852,-8.86492 +853,-35.832 +854,-8.86492 +855,-35.832 +856,-8.86492 +857,-35.832 +858,-8.86492 +859,-35.832 +860,-8.86492 +861,-35.832 +862,-8.86492 +863,-35.832 +864,-9.46984 +865,-36.2304 +866,-9.46984 +867,-36.2304 +868,-9.46984 +869,-36.2304 +870,-9.46984 +871,-36.2304 +872,-9.46984 +873,-36.2304 +874,-9.46984 +875,-36.2304 +876,-9.46984 +877,-36.2304 +878,-9.46984 +879,-36.2304 +880,-9.46984 +881,-36.2304 +882,-9.46984 +883,-36.2304 +884,-9.46984 +885,-36.2304 +886,-9.46984 +887,-36.2304 +888,-9.46984 +889,-36.2304 +890,-9.46984 +891,-36.2304 +892,-9.46984 +893,-36.2304 +894,-9.46984 +895,-36.2304 +896,-7.74688 +897,-35.1967 +898,-7.74688 +899,-35.1967 +900,-7.74688 +901,-35.1967 +902,-7.74688 +903,-35.1967 +904,-7.74688 +905,-35.1967 +906,-7.74688 +907,-35.1967 +908,-7.74688 +909,-35.1967 +910,-7.74688 +911,-35.1967 +912,-7.74688 +913,-35.1967 +914,-7.74688 +915,-35.1967 +916,-7.74688 +917,-35.1967 +918,-7.74688 +919,-35.1967 +920,-7.74688 +921,-35.1967 +922,-7.74688 +923,-35.1967 +924,-7.74688 +925,-35.1967 +926,-7.74688 +927,-35.1967 +928,-8.77951 +929,-35.6291 +930,-8.77951 +931,-35.6291 +932,-8.77951 +933,-35.6291 +934,-8.77951 +935,-35.6291 +936,-8.77951 +937,-35.6291 +938,-8.77951 +939,-35.6291 +940,-8.77951 +941,-35.6291 +942,-8.77951 +943,-35.6291 +944,-8.77951 +945,-35.6291 +946,-8.77951 +947,-35.6291 +948,-8.77951 +949,-35.6291 +950,-8.77951 +951,-35.6291 +952,-8.77951 +953,-35.6291 +954,-8.77951 +955,-35.6291 +956,-8.77951 +957,-35.6291 +958,-8.77951 +959,-35.6291 +960,-9.44359 +961,-36.4005 +962,-9.44359 +963,-36.4005 +964,-9.44359 +965,-36.4005 +966,-9.44359 +967,-36.4005 +968,-9.44359 +969,-36.4005 +970,-9.44359 +971,-36.4005 +972,-9.44359 +973,-36.4005 +974,-9.44359 +975,-36.4005 +976,-9.44359 +977,-36.4005 +978,-9.44359 +979,-36.4005 +980,-9.44359 +981,-36.4005 +982,-9.44359 +983,-36.4005 +984,-9.44359 +985,-36.4005 +986,-9.44359 +987,-36.4005 +988,-9.44359 +989,-36.4005 +990,-9.44359 +991,-36.4005 +992,-9.71026 +993,-36.8504 +994,-9.71026 +995,-36.8504 +996,-9.71026 +997,-36.8504 +998,-9.71026 +999,-36.8504 +1000,-9.71026 +1001,-36.8504 +1002,-9.71026 +1003,-36.8504 +1004,-9.71026 +1005,-36.8504 +1006,-9.71026 +1007,-36.8504 +1008,-9.71026 +1009,-36.8504 +1010,-9.71026 +1011,-36.8504 +1012,-9.71026 +1013,-36.8504 +1014,-9.71026 +1015,-36.8504 +1016,-9.71026 +1017,-36.8504 +1018,-9.71026 +1019,-36.8504 +1020,-9.71026 +1021,-36.8504 +1022,-9.71026 +1023,-36.8504 +1024,0 +1025,-7.8 +1026,0 +1027,-7.8 +1028,0 +1029,-7.8 +1030,0 +1031,-7.8 +1032,0 +1033,-7.8 +1034,0 +1035,-7.8 +1036,0 +1037,-7.8 +1038,0 +1039,-7.8 +1040,0 +1041,-7.8 +1042,0 +1043,-7.8 +1044,0 +1045,-7.8 +1046,0 +1047,-7.8 +1048,0 +1049,-7.8 +1050,0 +1051,-7.8 +1052,0 +1053,-7.8 +1054,0 +1055,-7.8 +1056,0 +1057,-7.42759 +1058,0 +1059,-7.42759 +1060,0 +1061,-7.42759 +1062,0 +1063,-7.42759 +1064,0 +1065,-7.42759 +1066,0 +1067,-7.42759 +1068,0 +1069,-7.42759 +1070,0 +1071,-7.42759 +1072,0 +1073,-7.42759 +1074,0 +1075,-7.42759 +1076,0 +1077,-7.42759 +1078,0 +1079,-7.42759 +1080,0 +1081,-7.42759 +1082,0 +1083,-7.42759 +1084,0 +1085,-7.42759 +1086,0 +1087,-7.42759 +1088,0 +1089,-13.1395 +1090,0 +1091,-13.1395 +1092,0 +1093,-13.1395 +1094,0 +1095,-13.1395 +1096,0 +1097,-13.1395 +1098,0 +1099,-13.1395 +1100,0 +1101,-13.1395 +1102,0 +1103,-13.1395 +1104,0 +1105,-13.1395 +1106,0 +1107,-13.1395 +1108,0 +1109,-13.1395 +1110,0 +1111,-13.1395 +1112,0 +1113,-13.1395 +1114,0 +1115,-13.1395 +1116,0 +1117,-13.1395 +1118,0 +1119,-13.1395 +1120,0 +1121,-13.5592 +1122,0 +1123,-13.5592 +1124,0 +1125,-13.5592 +1126,0 +1127,-13.5592 +1128,0 +1129,-13.5592 +1130,0 +1131,-13.5592 +1132,0 +1133,-13.5592 +1134,0 +1135,-13.5592 +1136,0 +1137,-13.5592 +1138,0 +1139,-13.5592 +1140,0 +1141,-13.5592 +1142,0 +1143,-13.5592 +1144,0 +1145,-13.5592 +1146,0 +1147,-13.5592 +1148,0 +1149,-13.5592 +1150,0 +1151,-13.5592 +1152,0 +1153,-8.52569 +1154,0 +1155,-8.52569 +1156,0 +1157,-8.52569 +1158,0 +1159,-8.52569 +1160,0 +1161,-8.52569 +1162,0 +1163,-8.52569 +1164,0 +1165,-8.52569 +1166,0 +1167,-8.52569 +1168,0 +1169,-8.52569 +1170,0 +1171,-8.52569 +1172,0 +1173,-8.52569 +1174,0 +1175,-8.52569 +1176,0 +1177,-8.52569 +1178,0 +1179,-8.52569 +1180,0 +1181,-8.52569 +1182,0 +1183,-8.52569 +1184,0 +1185,-7.38951 +1186,0 +1187,-7.38951 +1188,0 +1189,-7.38951 +1190,0 +1191,-7.38951 +1192,0 +1193,-7.38951 +1194,0 +1195,-7.38951 +1196,0 +1197,-7.38951 +1198,0 +1199,-7.38951 +1200,0 +1201,-7.38951 +1202,0 +1203,-7.38951 +1204,0 +1205,-7.38951 +1206,0 +1207,-7.38951 +1208,0 +1209,-7.38951 +1210,0 +1211,-7.38951 +1212,0 +1213,-7.38951 +1214,0 +1215,-7.38951 +1216,0 +1217,-13.8636 +1218,0 +1219,-13.8636 +1220,0 +1221,-13.8636 +1222,0 +1223,-13.8636 +1224,0 +1225,-13.8636 +1226,0 +1227,-13.8636 +1228,0 +1229,-13.8636 +1230,0 +1231,-13.8636 +1232,0 +1233,-13.8636 +1234,0 +1235,-13.8636 +1236,0 +1237,-13.8636 +1238,0 +1239,-13.8636 +1240,0 +1241,-13.8636 +1242,0 +1243,-13.8636 +1244,0 +1245,-13.8636 +1246,0 +1247,-13.8636 +1248,0 +1249,-13.5132 +1250,0 +1251,-13.5132 +1252,0 +1253,-13.5132 +1254,0 +1255,-13.5132 +1256,0 +1257,-13.5132 +1258,0 +1259,-13.5132 +1260,0 +1261,-13.5132 +1262,0 +1263,-13.5132 +1264,0 +1265,-13.5132 +1266,0 +1267,-13.5132 +1268,0 +1269,-13.5132 +1270,0 +1271,-13.5132 +1272,0 +1273,-13.5132 +1274,0 +1275,-13.5132 +1276,0 +1277,-13.5132 +1278,0 +1279,-13.5132 +1280,0 +1281,-8.70193 +1282,0 +1283,-8.70193 +1284,0 +1285,-8.70193 +1286,0 +1287,-8.70193 +1288,0 +1289,-8.70193 +1290,0 +1291,-8.70193 +1292,0 +1293,-8.70193 +1294,0 +1295,-8.70193 +1296,0 +1297,-8.70193 +1298,0 +1299,-8.70193 +1300,0 +1301,-8.70193 +1302,0 +1303,-8.70193 +1304,0 +1305,-8.70193 +1306,0 +1307,-8.70193 +1308,0 +1309,-8.70193 +1310,0 +1311,-8.70193 +1312,0 +1313,-9.45429 +1314,0 +1315,-9.45429 +1316,0 +1317,-9.45429 +1318,0 +1319,-9.45429 +1320,0 +1321,-9.45429 +1322,0 +1323,-9.45429 +1324,0 +1325,-9.45429 +1326,0 +1327,-9.45429 +1328,0 +1329,-9.45429 +1330,0 +1331,-9.45429 +1332,0 +1333,-9.45429 +1334,0 +1335,-9.45429 +1336,0 +1337,-9.45429 +1338,0 +1339,-9.45429 +1340,0 +1341,-9.45429 +1342,0 +1343,-9.45429 +1344,0 +1345,-15.1315 +1346,0 +1347,-15.1315 +1348,0 +1349,-15.1315 +1350,0 +1351,-15.1315 +1352,0 +1353,-15.1315 +1354,0 +1355,-15.1315 +1356,0 +1357,-15.1315 +1358,0 +1359,-15.1315 +1360,0 +1361,-15.1315 +1362,0 +1363,-15.1315 +1364,0 +1365,-15.1315 +1366,0 +1367,-15.1315 +1368,0 +1369,-15.1315 +1370,0 +1371,-15.1315 +1372,0 +1373,-15.1315 +1374,0 +1375,-15.1315 +1376,0 +1377,-14.3197 +1378,0 +1379,-14.3197 +1380,0 +1381,-14.3197 +1382,0 +1383,-14.3197 +1384,0 +1385,-14.3197 +1386,0 +1387,-14.3197 +1388,0 +1389,-14.3197 +1390,0 +1391,-14.3197 +1392,0 +1393,-14.3197 +1394,0 +1395,-14.3197 +1396,0 +1397,-14.3197 +1398,0 +1399,-14.3197 +1400,0 +1401,-14.3197 +1402,0 +1403,-14.3197 +1404,0 +1405,-14.3197 +1406,0 +1407,-14.3197 +1408,0 +1409,-8.59418 +1410,0 +1411,-8.59418 +1412,0 +1413,-8.59418 +1414,0 +1415,-8.59418 +1416,0 +1417,-8.59418 +1418,0 +1419,-8.59418 +1420,0 +1421,-8.59418 +1422,0 +1423,-8.59418 +1424,0 +1425,-8.59418 +1426,0 +1427,-8.59418 +1428,0 +1429,-8.59418 +1430,0 +1431,-8.59418 +1432,0 +1433,-8.59418 +1434,0 +1435,-8.59418 +1436,0 +1437,-8.59418 +1438,0 +1439,-8.59418 +1440,0 +1441,-9.60307 +1442,0 +1443,-9.60307 +1444,0 +1445,-9.60307 +1446,0 +1447,-9.60307 +1448,0 +1449,-9.60307 +1450,0 +1451,-9.60307 +1452,0 +1453,-9.60307 +1454,0 +1455,-9.60307 +1456,0 +1457,-9.60307 +1458,0 +1459,-9.60307 +1460,0 +1461,-9.60307 +1462,0 +1463,-9.60307 +1464,0 +1465,-9.60307 +1466,0 +1467,-9.60307 +1468,0 +1469,-9.60307 +1470,0 +1471,-9.60307 +1472,0 +1473,-6.60789 +1474,0 +1475,-6.60789 +1476,0 +1477,-6.60789 +1478,0 +1479,-6.60789 +1480,0 +1481,-6.60789 +1482,0 +1483,-6.60789 +1484,0 +1485,-6.60789 +1486,0 +1487,-6.60789 +1488,0 +1489,-6.60789 +1490,0 +1491,-6.60789 +1492,0 +1493,-6.60789 +1494,0 +1495,-6.60789 +1496,0 +1497,-6.60789 +1498,0 +1499,-6.60789 +1500,0 +1501,-6.60789 +1502,0 +1503,-6.60789 +1504,0 +1505,-12.5184 +1506,0 +1507,-12.5184 +1508,0 +1509,-12.5184 +1510,0 +1511,-12.5184 +1512,0 +1513,-12.5184 +1514,0 +1515,-12.5184 +1516,0 +1517,-12.5184 +1518,0 +1519,-12.5184 +1520,0 +1521,-12.5184 +1522,0 +1523,-12.5184 +1524,0 +1525,-12.5184 +1526,0 +1527,-12.5184 +1528,0 +1529,-12.5184 +1530,0 +1531,-12.5184 +1532,0 +1533,-12.5184 +1534,0 +1535,-12.5184 +1536,-112 +1537,-25.18 +1538,-112 +1539,-25.18 +1540,-112 +1541,-25.18 +1542,-112 +1543,-25.18 +1544,-112 +1545,-25.18 +1546,-112 +1547,-25.18 +1548,-112 +1549,-25.18 +1550,-112 +1551,-25.18 +1552,-112 +1553,-25.18 +1554,-112 +1555,-25.18 +1556,-112 +1557,-25.18 +1558,-112 +1559,-25.18 +1560,-112 +1561,-25.18 +1562,-112 +1563,-25.18 +1564,-112 +1565,-25.18 +1566,-112 +1567,-25.18 +1568,-112.089 +1569,-26.8822 +1570,-112.089 +1571,-26.8822 +1572,-112.089 +1573,-26.8822 +1574,-112.089 +1575,-26.8822 +1576,-112.089 +1577,-26.8822 +1578,-112.089 +1579,-26.8822 +1580,-112.089 +1581,-26.8822 +1582,-112.089 +1583,-26.8822 +1584,-112.089 +1585,-26.8822 +1586,-112.089 +1587,-26.8822 +1588,-112.089 +1589,-26.8822 +1590,-112.089 +1591,-26.8822 +1592,-112.089 +1593,-26.8822 +1594,-112.089 +1595,-26.8822 +1596,-112.089 +1597,-26.8822 +1598,-112.089 +1599,-26.8822 +1600,-112.993 +1601,-26.3162 +1602,-112.993 +1603,-26.3162 +1604,-112.993 +1605,-26.3162 +1606,-112.993 +1607,-26.3162 +1608,-112.993 +1609,-26.3162 +1610,-112.993 +1611,-26.3162 +1612,-112.993 +1613,-26.3162 +1614,-112.993 +1615,-26.3162 +1616,-112.993 +1617,-26.3162 +1618,-112.993 +1619,-26.3162 +1620,-112.993 +1621,-26.3162 +1622,-112.993 +1623,-26.3162 +1624,-112.993 +1625,-26.3162 +1626,-112.993 +1627,-26.3162 +1628,-112.993 +1629,-26.3162 +1630,-112.993 +1631,-26.3162 +1632,-113.005 +1633,-27.5795 +1634,-113.005 +1635,-27.5795 +1636,-113.005 +1637,-27.5795 +1638,-113.005 +1639,-27.5795 +1640,-113.005 +1641,-27.5795 +1642,-113.005 +1643,-27.5795 +1644,-113.005 +1645,-27.5795 +1646,-113.005 +1647,-27.5795 +1648,-113.005 +1649,-27.5795 +1650,-113.005 +1651,-27.5795 +1652,-113.005 +1653,-27.5795 +1654,-113.005 +1655,-27.5795 +1656,-113.005 +1657,-27.5795 +1658,-113.005 +1659,-27.5795 +1660,-113.005 +1661,-27.5795 +1662,-113.005 +1663,-27.5795 +1664,-111.758 +1665,-26.1125 +1666,-111.758 +1667,-26.1125 +1668,-111.758 +1669,-26.1125 +1670,-111.758 +1671,-26.1125 +1672,-111.758 +1673,-26.1125 +1674,-111.758 +1675,-26.1125 +1676,-111.758 +1677,-26.1125 +1678,-111.758 +1679,-26.1125 +1680,-111.758 +1681,-26.1125 +1682,-111.758 +1683,-26.1125 +1684,-111.758 +1685,-26.1125 +1686,-111.758 +1687,-26.1125 +1688,-111.758 +1689,-26.1125 +1690,-111.758 +1691,-26.1125 +1692,-111.758 +1693,-26.1125 +1694,-111.758 +1695,-26.1125 +1696,-111.971 +1697,-26.4388 +1698,-111.971 +1699,-26.4388 +1700,-111.971 +1701,-26.4388 +1702,-111.971 +1703,-26.4388 +1704,-111.971 +1705,-26.4388 +1706,-111.971 +1707,-26.4388 +1708,-111.971 +1709,-26.4388 +1710,-111.971 +1711,-26.4388 +1712,-111.971 +1713,-26.4388 +1714,-111.971 +1715,-26.4388 +1716,-111.971 +1717,-26.4388 +1718,-111.971 +1719,-26.4388 +1720,-111.971 +1721,-26.4388 +1722,-111.971 +1723,-26.4388 +1724,-111.971 +1725,-26.4388 +1726,-111.971 +1727,-26.4388 +1728,-112.772 +1729,-27.6161 +1730,-112.772 +1731,-27.6161 +1732,-112.772 +1733,-27.6161 +1734,-112.772 +1735,-27.6161 +1736,-112.772 +1737,-27.6161 +1738,-112.772 +1739,-27.6161 +1740,-112.772 +1741,-27.6161 +1742,-112.772 +1743,-27.6161 +1744,-112.772 +1745,-27.6161 +1746,-112.772 +1747,-27.6161 +1748,-112.772 +1749,-27.6161 +1750,-112.772 +1751,-27.6161 +1752,-112.772 +1753,-27.6161 +1754,-112.772 +1755,-27.6161 +1756,-112.772 +1757,-27.6161 +1758,-112.772 +1759,-27.6161 +1760,-112.944 +1761,-27.7397 +1762,-112.944 +1763,-27.7397 +1764,-112.944 +1765,-27.7397 +1766,-112.944 +1767,-27.7397 +1768,-112.944 +1769,-27.7397 +1770,-112.944 +1771,-27.7397 +1772,-112.944 +1773,-27.7397 +1774,-112.944 +1775,-27.7397 +1776,-112.944 +1777,-27.7397 +1778,-112.944 +1779,-27.7397 +1780,-112.944 +1781,-27.7397 +1782,-112.944 +1783,-27.7397 +1784,-112.944 +1785,-27.7397 +1786,-112.944 +1787,-27.7397 +1788,-112.944 +1789,-27.7397 +1790,-112.944 +1791,-27.7397 +1792,-9.711 +1793,-34.0805 +1794,-9.711 +1795,-34.0805 +1796,-9.711 +1797,-34.0805 +1798,-9.711 +1799,-34.0805 +1800,-9.711 +1801,-34.0805 +1802,-9.711 +1803,-34.0805 +1804,-9.711 +1805,-34.0805 +1806,-9.711 +1807,-34.0805 +1808,-9.711 +1809,-34.0805 +1810,-9.711 +1811,-34.0805 +1812,-9.711 +1813,-34.0805 +1814,-9.711 +1815,-34.0805 +1816,-9.711 +1817,-34.0805 +1818,-9.711 +1819,-34.0805 +1820,-9.711 +1821,-34.0805 +1822,-9.711 +1823,-34.0805 +1824,-10.633 +1825,-35.2304 +1826,-10.633 +1827,-35.2304 +1828,-10.633 +1829,-35.2304 +1830,-10.633 +1831,-35.2304 +1832,-10.633 +1833,-35.2304 +1834,-10.633 +1835,-35.2304 +1836,-10.633 +1837,-35.2304 +1838,-10.633 +1839,-35.2304 +1840,-10.633 +1841,-35.2304 +1842,-10.633 +1843,-35.2304 +1844,-10.633 +1845,-35.2304 +1846,-10.633 +1847,-35.2304 +1848,-10.633 +1849,-35.2304 +1850,-10.633 +1851,-35.2304 +1852,-10.633 +1853,-35.2304 +1854,-10.633 +1855,-35.2304 +1856,-10.6 +1857,-35.2817 +1858,-10.6 +1859,-35.2817 +1860,-10.6 +1861,-35.2817 +1862,-10.6 +1863,-35.2817 +1864,-10.6 +1865,-35.2817 +1866,-10.6 +1867,-35.2817 +1868,-10.6 +1869,-35.2817 +1870,-10.6 +1871,-35.2817 +1872,-10.6 +1873,-35.2817 +1874,-10.6 +1875,-35.2817 +1876,-10.6 +1877,-35.2817 +1878,-10.6 +1879,-35.2817 +1880,-10.6 +1881,-35.2817 +1882,-10.6 +1883,-35.2817 +1884,-10.6 +1885,-35.2817 +1886,-10.6 +1887,-35.2817 +1888,-11.6641 +1889,-35.6611 +1890,-11.6641 +1891,-35.6611 +1892,-11.6641 +1893,-35.6611 +1894,-11.6641 +1895,-35.6611 +1896,-11.6641 +1897,-35.6611 +1898,-11.6641 +1899,-35.6611 +1900,-11.6641 +1901,-35.6611 +1902,-11.6641 +1903,-35.6611 +1904,-11.6641 +1905,-35.6611 +1906,-11.6641 +1907,-35.6611 +1908,-11.6641 +1909,-35.6611 +1910,-11.6641 +1911,-35.6611 +1912,-11.6641 +1913,-35.6611 +1914,-11.6641 +1915,-35.6611 +1916,-11.6641 +1917,-35.6611 +1918,-11.6641 +1919,-35.6611 +1920,-9.6382 +1921,-33.5254 +1922,-9.6382 +1923,-33.5254 +1924,-9.6382 +1925,-33.5254 +1926,-9.6382 +1927,-33.5254 +1928,-9.6382 +1929,-33.5254 +1930,-9.6382 +1931,-33.5254 +1932,-9.6382 +1933,-33.5254 +1934,-9.6382 +1935,-33.5254 +1936,-9.6382 +1937,-33.5254 +1938,-9.6382 +1939,-33.5254 +1940,-9.6382 +1941,-33.5254 +1942,-9.6382 +1943,-33.5254 +1944,-9.6382 +1945,-33.5254 +1946,-9.6382 +1947,-33.5254 +1948,-9.6382 +1949,-33.5254 +1950,-9.6382 +1951,-33.5254 +1952,-9.29078 +1953,-35.6892 +1954,-9.29078 +1955,-35.6892 +1956,-9.29078 +1957,-35.6892 +1958,-9.29078 +1959,-35.6892 +1960,-9.29078 +1961,-35.6892 +1962,-9.29078 +1963,-35.6892 +1964,-9.29078 +1965,-35.6892 +1966,-9.29078 +1967,-35.6892 +1968,-9.29078 +1969,-35.6892 +1970,-9.29078 +1971,-35.6892 +1972,-9.29078 +1973,-35.6892 +1974,-9.29078 +1975,-35.6892 +1976,-9.29078 +1977,-35.6892 +1978,-9.29078 +1979,-35.6892 +1980,-9.29078 +1981,-35.6892 +1982,-9.29078 +1983,-35.6892 +1984,-10.2681 +1985,-34.8443 +1986,-10.2681 +1987,-34.8443 +1988,-10.2681 +1989,-34.8443 +1990,-10.2681 +1991,-34.8443 +1992,-10.2681 +1993,-34.8443 +1994,-10.2681 +1995,-34.8443 +1996,-10.2681 +1997,-34.8443 +1998,-10.2681 +1999,-34.8443 +2000,-10.2681 +2001,-34.8443 +2002,-10.2681 +2003,-34.8443 +2004,-10.2681 +2005,-34.8443 +2006,-10.2681 +2007,-34.8443 +2008,-10.2681 +2009,-34.8443 +2010,-10.2681 +2011,-34.8443 +2012,-10.2681 +2013,-34.8443 +2014,-10.2681 +2015,-34.8443 +2016,-10.8294 +2017,-36.0505 +2018,-10.8294 +2019,-36.0505 +2020,-10.8294 +2021,-36.0505 +2022,-10.8294 +2023,-36.0505 +2024,-10.8294 +2025,-36.0505 +2026,-10.8294 +2027,-36.0505 +2028,-10.8294 +2029,-36.0505 +2030,-10.8294 +2031,-36.0505 +2032,-10.8294 +2033,-36.0505 +2034,-10.8294 +2035,-36.0505 +2036,-10.8294 +2037,-36.0505 +2038,-10.8294 +2039,-36.0505 +2040,-10.8294 +2041,-36.0505 +2042,-10.8294 +2043,-36.0505 +2044,-10.8294 +2045,-36.0505 +2046,-10.8294 +2047,-36.0505 diff --git a/CRVConditions/data/status_extracted_20260221.txt b/CRVConditions/data/status_extracted_20260221.txt new file mode 100644 index 0000000000..4577c921b7 --- /dev/null +++ b/CRVConditions/data/status_extracted_20260221.txt @@ -0,0 +1,16 @@ +TABLE CRVBadChan +#A channel can have more than one status bit. Add all status bits for the complete status. +#status 1 (bit 0): not connected +#status 2 (bit 1): ignore channel in reconstruction +#status 4 (bit 2): no data +#status 8 (bit 3): no pedestal +#status 16 (bit 4): no calibration constant +#status 32 (bit 5): noisy +#channel,status +281,3 +296,3 +518,3 +520,3 +863,3 +1107,3 +1587,3 From 9e06500fc2abb6b2e560ca9feb719899905a28a7 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sat, 21 Feb 2026 21:43:51 -0600 Subject: [PATCH 166/174] small adjustment to CRV calibration parameters --- CRVReco/src/CrvCalibration_module.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 7283815bdf..6133314f7b 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -46,16 +46,16 @@ namespace mu2e fhicl::Atom histMaxPulseHeight{Name("histMaxPulseHeight"), Comment("end range of pulseArea histogram"), 150.0}; fhicl::Atom fitRangeStart{Name("fitRangeStart"), Comment("low end of the 1PE fit range as fraction of peak"), 0.8}; fhicl::Atom fitRangeEnd{Name("fitRangeEnd"), Comment("high end of the 1PE fit range as fraction of peak"), 1.2}; - fhicl::Atom minPeakPulseArea{Name("minPeakPulseArea"), Comment("minimum accepted SPE peak for pulseArea histogram"), 250.0}; + fhicl::Atom minPeakPulseArea{Name("minPeakPulseArea"), Comment("minimum accepted SPE peak for pulseArea histogram"), 300.0}; fhicl::Atom minPeakPulseHeight{Name("minPeakPulseHeight"), Comment("minimum accepted SPE peak for pulseHeight histogram"), 10.0}; fhicl::Atom minHistEntries{Name("minHistEntries"), Comment("minimum number of entries required for a fit"), 100}; fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; fhicl::Atom maxFitDifferencePulseArea{Name("maxFitDifferencePulseArea"), - Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse areas). Indicates fit problems."), 100.0}; + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse areas). Indicates fit problems."), 75.0}; fhicl::Atom maxFitDifferencePulseHeight{Name("maxFitDifferencePulseHeight"), - Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 4.0}; + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 3.0}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; @@ -156,7 +156,7 @@ namespace mu2e outputFile.open(_tmpDBfileName); if(!outputFile.is_open()) throw cet::exception("CRVCALIB") << "Couldn't create output txt file " << _tmpDBfileName << "."; outputFile<<"TABLE CRVSiPM"<Branch("timeOffset", &offset); outputFile<<"TABLE CRVTime"< Date: Sat, 21 Feb 2026 21:47:40 -0600 Subject: [PATCH 167/174] small adjustment to CRV calibration parameters --- CRVReco/src/CrvCalibration_module.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index 6133314f7b..f9c08fb197 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -55,7 +55,7 @@ namespace mu2e fhicl::Atom maxFitDifferencePulseArea{Name("maxFitDifferencePulseArea"), Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse areas). Indicates fit problems."), 75.0}; fhicl::Atom maxFitDifferencePulseHeight{Name("maxFitDifferencePulseHeight"), - Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 3.0}; + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 2.5}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; From c777fa7d008e2472a47742765a64d58cf0f7ea00 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sun, 22 Feb 2026 12:40:26 -0600 Subject: [PATCH 168/174] small adjustments to CRV calibration parameters. --- CRVReco/src/CrvCalibration_module.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRVReco/src/CrvCalibration_module.cc b/CRVReco/src/CrvCalibration_module.cc index f9c08fb197..a5fbb1888b 100644 --- a/CRVReco/src/CrvCalibration_module.cc +++ b/CRVReco/src/CrvCalibration_module.cc @@ -46,16 +46,16 @@ namespace mu2e fhicl::Atom histMaxPulseHeight{Name("histMaxPulseHeight"), Comment("end range of pulseArea histogram"), 150.0}; fhicl::Atom fitRangeStart{Name("fitRangeStart"), Comment("low end of the 1PE fit range as fraction of peak"), 0.8}; fhicl::Atom fitRangeEnd{Name("fitRangeEnd"), Comment("high end of the 1PE fit range as fraction of peak"), 1.2}; - fhicl::Atom minPeakPulseArea{Name("minPeakPulseArea"), Comment("minimum accepted SPE peak for pulseArea histogram"), 300.0}; + fhicl::Atom minPeakPulseArea{Name("minPeakPulseArea"), Comment("minimum accepted SPE peak for pulseArea histogram"), 280.0}; fhicl::Atom minPeakPulseHeight{Name("minPeakPulseHeight"), Comment("minimum accepted SPE peak for pulseHeight histogram"), 10.0}; fhicl::Atom minHistEntries{Name("minHistEntries"), Comment("minimum number of entries required for a fit"), 100}; fhicl::Atom spectrumNPeaks{Name("spectrumNPeaks"), Comment("maximum number of peaks searched by TSpectrum"), 100}; fhicl::Atom spectrumPeakSigma{Name("spectrumPeakSigma"), Comment("TSpectrum search parameter sigma"), 4.0}; fhicl::Atom spectrumPeakThreshold{Name("spectrumPeakThreshold"), Comment("TSpectrum search parameter threshold"), 0.01}; fhicl::Atom maxFitDifferencePulseArea{Name("maxFitDifferencePulseArea"), - Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse areas). Indicates fit problems."), 75.0}; + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse areas). Indicates fit problems."), 80.0}; fhicl::Atom maxFitDifferencePulseHeight{Name("maxFitDifferencePulseHeight"), - Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 2.5}; + Comment("maximum difference between the TSpectrum peak and the fitted peak (for pulse heights). Indicates fit problems."), 3.0}; fhicl::Atom tmpDBfileName{Name("tmpDBfileName"), Comment("name of the tmp. DB file name for the pedestals")}; }; From cf93b85b61a53b5c8329bfd8c10c67c086b1d078 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Sun, 22 Feb 2026 18:25:18 -0600 Subject: [PATCH 169/174] applying time offsets to CRV waveforms in EventDisplay --- EventDisplay/fcl/EventDisplayExtracted.fcl | 7 ++++--- EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl | 2 +- EventDisplay/src/DataInterface.cc | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/EventDisplay/fcl/EventDisplayExtracted.fcl b/EventDisplay/fcl/EventDisplayExtracted.fcl index c6a87a69b6..64ad5935b0 100644 --- a/EventDisplay/fcl/EventDisplayExtracted.fcl +++ b/EventDisplay/fcl/EventDisplayExtracted.fcl @@ -2,6 +2,7 @@ physics.analyzers.eventdisplay.extracted : true services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common_extracted.txt" -#services.ProditionsService.crvStatus.useDb : false -#services.ProditionsService.crvCalib.useDb : false -#services.ProditionsService.crvCalib.pedestal : 2047 +services.ProditionsService.crvCalib.useDb : true +services.ProditionsService.crvStatus.useDb : true +#comment out this line, if displaying simulated events +#services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260221.txt","Offline/CRVConditions/data/calib_extracted_20260221.txt"] diff --git a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl index e15ccaf87e..6edbd2b48c 100644 --- a/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl +++ b/EventDisplay/fcl/EventDisplayExtractedCrvOnly.fcl @@ -5,4 +5,4 @@ services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom services.ProditionsService.crvCalib.useDb : true services.ProditionsService.crvStatus.useDb : true #comment out this line, if displaying simulated events -services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260214.txt","Offline/CRVConditions/data/calib_extracted_20260214.txt"] +services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260221.txt","Offline/CRVConditions/data/calib_extracted_20260221.txt"] diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index 80608be64f..4dbe9687f5 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -1025,6 +1025,8 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS mu2e::CrvDigi const& digi(crvDigis->at(j)); int index = digi.GetScintillatorBarIndex().asInt(); int sipm = digi.GetSiPMNumber(); + size_t channel = index*4 + sipm; + double timeOffset = _calib->timeOffset(channel); std::string multigraphName = Form("Waveform (%s) SiPM %i",moduleLabel.c_str(),sipm); std::map >::iterator crvbar=_crvscintillatorbars.find(index); if(crvbar!=_crvscintillatorbars.end()) @@ -1050,7 +1052,7 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS graph->SetMarkerSize(2); for(size_t k=0; kSetPoint(k,TDC0time+(digi.GetStartTDC()+k)*mu2e::CRVDigitizationPeriod,digi.GetADCs()[k]); + graph->SetPoint(k,TDC0time+(digi.GetStartTDC()+k)*mu2e::CRVDigitizationPeriod+timeOffset,digi.GetADCs()[k]); } boost::dynamic_pointer_cast(v[multigraphIndex])->Add(graph,"p"); } From 81cced9f1adfd83e5e6b6263b6ca4c69a2a40869 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Mon, 23 Feb 2026 21:25:20 -0600 Subject: [PATCH 170/174] updated CRV timeOffsets --- .../data/calib_extracted_20260214.txt | 4100 ----------------- .../data/calib_extracted_20260221.txt | 3552 +++++++------- .../data/status_extracted_20260214.txt | 10 - 3 files changed, 1776 insertions(+), 5886 deletions(-) delete mode 100644 CRVConditions/data/calib_extracted_20260214.txt delete mode 100644 CRVConditions/data/status_extracted_20260214.txt diff --git a/CRVConditions/data/calib_extracted_20260214.txt b/CRVConditions/data/calib_extracted_20260214.txt deleted file mode 100644 index d1d1a85d48..0000000000 --- a/CRVConditions/data/calib_extracted_20260214.txt +++ /dev/null @@ -1,4100 +0,0 @@ -TABLE CRVSiPM -#channel,pedestal,calibPulseHeight,calibPulseArea -0,2037.6,18.1472,535.761 -1,2043.79,15.4787,443.857 -2,2044.18,18.5364,538.844 -3,2053.86,16.3699,464.341 -4,2056.01,19.5205,526.858 -5,2051.25,16.8603,465.98 -6,2049.14,17.9909,476.984 -7,2039.7,16.4851,441.712 -8,2037.68,18.9057,540.808 -9,2039.09,16.3066,467.38 -10,2052.27,19.0443,549.861 -11,2061.3,17.2745,492.273 -12,2029.24,19.0483,548.758 -13,2042.74,16.5823,471.871 -14,2037.73,18.9138,536.526 -15,2041.45,15.2902,440.88 -16,2045.63,18.51,516.476 -17,2028.34,17.6383,520.355 -18,2027.78,19.3541,565.813 -19,2049.09,17.0971,509.498 -20,2047.82,20.3552,577.345 -21,2060.1,17.6319,505.198 -22,2052.6,20.5236,565.058 -23,2049.19,17.9582,512.712 -24,2042.09,20.4211,574.549 -25,2046.42,16.8462,484.486 -26,2038.4,19.8149,564.594 -27,2049.08,17.1644,494.472 -28,2064.7,19.8679,566.867 -29,2048.79,16.5371,474.892 -30,2034.48,18.6275,545.439 -31,2067.1,16.9101,479.623 -32,2035.8,19.5845,571.872 -33,2039.14,16.8292,472.187 -34,2040.2,20.3571,576.202 -35,2030.8,17.7024,488.783 -36,2050.73,19.3713,554.749 -37,2047.83,17.9607,491.762 -38,2045.73,20.1958,563.538 -39,2051.3,16.2849,451.328 -40,2030.94,18.8597,546.541 -41,2051.69,16.0066,441.151 -42,2052.5,18.5387,548.448 -43,2046.49,15.9121,444.807 -44,2059.93,18.734,537.054 -45,2038.12,15.8831,430.115 -46,2043.75,19.3911,546.118 -47,2035.2,15.684,439.207 -48,2042.58,17.5375,489.407 -49,2044.88,18.2219,501.129 -50,2041.57,18.1364,507.837 -51,2041.97,16.9653,482.21 -52,2038.2,17.1285,495.512 -53,2042.35,18.5063,510.665 -54,2038.73,17.5482,491.585 -55,2053.35,16.9856,467.315 -56,2053.4,16.6798,486.687 -57,2054.01,16.5832,479.822 -58,2068.36,16.655,487.129 -59,2040.59,17.395,496.417 -60,2035.27,17.7033,503.555 -61,2047.45,17.1725,490.003 -62,2045.02,17.2118,502.523 -63,2046.1,16.8737,471.917 -64,2046.94,16.7257,491.377 -65,2058.71,17.8555,500.41 -66,2039.89,16.8932,485.624 -67,2032.94,17.7972,512.589 -68,2053.4,17.8796,488.612 -69,2053.97,18.2664,516.144 -70,2048.93,17.2541,470.226 -71,2038.01,17.9413,491.263 -72,2037.75,18.2258,509.046 -73,2049.65,19.8462,560.225 -74,2040.71,17.0995,489.898 -75,2062.41,19.6271,556.072 -76,2054.26,16.8768,468.72 -77,2051.75,19.8408,559.856 -78,2044.25,17.6376,498.608 -79,2056.5,19.1006,550.746 -80,2039.36,19.3462,544.082 -81,2045.06,15.1815,437.397 -82,2058.77,18.3978,541.008 -83,2038.67,15.3933,446.53 -84,2042.05,19.1489,544.283 -85,2042.03,14.4017,422.664 -86,2034.73,19.3333,549.3 -87,2050.66,14.654,431.046 -88,2035.96,18.9516,562.873 -89,2061.02,16.3728,500.911 -90,2045.67,20.174,578.514 -91,2054.34,15.9678,464.165 -92,2038.77,18.4974,538.201 -93,2063.12,15.1806,446.114 -94,2039.34,20.2955,562.131 -95,2049.3,15.6091,458.918 -96,2054.01,18.3114,516.467 -97,2053.75,16.6143,478.7 -98,2047.35,17.7478,507.148 -99,2054.07,16.3062,473.249 -100,2056.1,17.7472,504.745 -101,2036.65,17.2488,481.531 -102,2069.19,18.5811,518.533 -103,2048.64,16.8755,473.112 -104,2029.12,16.9097,495.473 -105,2030.95,14.7098,424.419 -106,2047.23,17.8296,512.184 -107,2052.39,14.7895,434.022 -108,2059.45,16.8575,493.837 -109,2037.88,14.2679,421.163 -110,2038.31,18.1561,509.412 -111,2067.69,14.224,411.912 -112,2054.72,17.0236,478.363 -113,2061.01,17.1266,495.628 -114,2047.41,17.2445,483.934 -115,2054.5,17.2722,481.936 -116,2049.23,17.3768,483.883 -117,2048.25,17.7403,482.3 -118,2061.88,17.5795,484.059 -119,2061.34,17.3955,477.501 -120,2044.8,18.0201,485.678 -121,2052.41,18.6171,518.283 -122,2057.26,17.9772,493.713 -123,2046.96,18.3839,520.263 -124,2045.15,16.8616,476.527 -125,2043.16,18.9485,531.246 -126,2056.59,18.0306,489.638 -127,2052.71,17.7528,508.161 -128,2047.11,18.6656,539.929 -129,2046.46,15.8353,442.142 -130,2038.47,19.3347,521.202 -131,2046.23,15.3179,419.007 -132,2027.54,19.1768,543.836 -133,2039.84,15.7246,438.56 -134,2043.03,17.792,465.717 -135,2041.9,14.2398,375.704 -136,2042.06,18.942,545.016 -137,2020.82,15.4469,450.238 -138,2039.38,19.3865,548.091 -139,2033.24,15.5395,451.158 -140,2054.37,19.0322,525.128 -141,2048.84,15.3708,420.579 -142,2035.33,19.3796,539.429 -143,2035.55,15.5457,430.016 -144,2050.58,18.9918,549.595 -145,2040.52,17.3562,487.455 -146,2049.56,19.7293,545.561 -147,2051.97,17.4513,492.812 -148,2039.48,18.845,536.477 -149,2037.79,15.8536,452.44 -150,2054.96,19.5705,536.763 -151,2054.54,17.2716,473.507 -152,2054.62,18.8556,538.177 -153,2050.95,16.0372,476.677 -154,2052.99,17.7983,520.533 -155,2041.84,16.2361,468.366 -156,2047.71,19.4619,540.97 -157,2037.97,16.1107,469.206 -158,2045.57,20.0152,555.653 -159,2067.07,16.3047,454.637 -160,2042.94,18.0213,508.234 -161,2057.75,16.9318,476.847 -162,2063.93,18.9222,526.799 -163,2050.87,15.5075,451.087 -164,2049.44,18.6911,519.19 -165,2053.27,16.2366,463.878 -166,2048.97,19.4087,515.138 -167,2040.69,15.3648,418.171 -168,2054.33,19.112,532.373 -169,2043.14,16.1872,460.547 -170,2039.17,19.245,533.008 -171,2053.63,16.3359,467.019 -172,2052.92,18.3348,525.257 -173,2046.85,16.0537,457.521 -174,2057.52,20.0394,545.979 -175,2045.88,16.7451,465.495 -176,2044.65,16.773,476.349 -177,2024.78,17.2257,487.999 -178,2063.18,16.0139,466.951 -179,2040.22,17.3244,495.507 -180,2047.26,16.7576,475.277 -181,2047.29,17.8166,493.778 -182,2045.28,17.4261,479.822 -183,2061.47,17.7338,493.233 -184,2039.14,18.232,500.026 -185,2033.57,15.4195,455.382 -186,2043.25,16.6465,474.289 -187,2034.19,16.3838,476.361 -188,2052.77,17.6071,489.845 -189,2036.7,16.3999,464.432 -190,2058.16,17.7609,484.541 -191,2064.38,16.5617,454.237 -192,2044.68,21.0347,602.173 -193,2021.42,16.504,469.553 -194,2036.53,20.8919,609.297 -195,2013.23,14.9675,454.969 -196,2030.89,21.8835,609.749 -197,2032.52,16.0599,461.834 -198,2046.13,20.2789,584.83 -199,2035.35,15.5253,460.569 -200,2049.68,21.6931,608.389 -201,2055.61,15.7332,467.575 -202,2054.89,20.2135,575.963 -203,2048.71,15.6039,464.347 -204,2054.97,19.5205,558.459 -205,2051.82,16.7839,487.529 -206,2062.18,20.0739,577.425 -207,2035.95,15.3872,457.891 -208,2040.47,18.0898,501.013 -209,2048.16,17.4849,508.114 -210,2034.09,17.7122,497.121 -211,2062.56,17.6658,511.652 -212,2055.81,18.4928,504.455 -213,2039.41,16.4061,485.872 -214,2049.43,19.4005,522.032 -215,2039.1,16.1705,469.82 -216,2054.11,19.2698,512.278 -217,2041.83,16.8206,490.659 -218,2041.44,18.8944,520.021 -219,2050.26,17.1987,498.799 -220,2046.21,18.1786,500.417 -221,2044.3,16.2049,487.101 -222,2048.25,18.2908,504.401 -223,2049.24,17.6193,507.162 -224,2039.39,16.3005,463.27 -225,2034.62,15.2189,432.925 -226,2024.72,17.1078,478.207 -227,2036.87,15.1656,442.533 -228,2035.43,16.0239,463.737 -229,2054.81,14.5625,430.54 -230,2044.9,16.424,443.011 -231,2041.44,15.2875,432.708 -232,2036.74,16.0492,448.002 -233,2055.65,15.0132,437.147 -234,2054.46,15.5103,444.155 -235,2030.01,14.3731,429.134 -236,2044.72,17.2267,468.949 -237,2035.97,14.0965,410.686 -238,2048.48,15.0132,440.706 -239,2049.51,14.9194,427.57 -240,2043.27,17.3771,493.131 -241,2040.34,18.8647,558.359 -242,2047.95,17.7019,493.825 -243,2060.82,19.5074,559.746 -244,2031.26,17.8356,492.742 -245,2045.19,19.633,555.659 -246,2050.02,17.7893,492.161 -247,2045.85,19.0961,551.252 -248,2036.64,18.0813,501.316 -249,2037.68,20.0254,571.138 -250,2070.68,16.9867,487.759 -251,2045.31,19.1109,566.109 -252,2043.55,16.5487,467.625 -253,2047.86,19.4555,559.303 -254,2060.1,16.4002,469.483 -255,2040.74,20.4426,578.504 -256,2039.82,16.0852,473.062 -257,2057.77,15.2387,419.45 -258,2034.85,15.5994,458.989 -259,2040.38,14.8208,382.841 -260,2046.12,15.7318,447.524 -261,2061.72,14.9837,397.215 -262,2021.8,15.5202,405.763 -263,2038.85,14.9044,366.84 -264,2033.1,15.7726,477.968 -265,2043.19,15.567,419.226 -266,2056.35,16.2853,479.889 -267,2041.49,15.1894,422.466 -268,2045.71,15.5291,447.48 -269,2041.46,14.2736,394.309 -270,2049.98,16.2599,463.156 -271,2047.4,14.7202,377.939 -272,2041.56,15.1468,429.041 -273,2047.69,16.0001,453.521 -274,2051.7,14.7286,431.917 -275,2031.38,16.108,456.489 -276,2035.9,14.9316,422.999 -277,2054.86,15.5165,439.412 -278,2031.4,14.9771,422.148 -279,2039.24,17.0127,464.867 -280,2038.34,15.8382,456.63 -281,2055.06,15.9213,450.253 -282,2044.62,15.7207,468.855 -283,2039.57,16.7096,461.118 -284,2033.74,14.5799,395.986 -285,2047.8,17.1117,465.84 -286,2034.27,15.1246,426.52 -287,2042,16.915,460.137 -288,2038.28,14.7603,429.776 -289,2064.76,16.3699,478.463 -290,2047.5,14.6165,427.123 -291,2041.99,16.3126,474.964 -292,2039.31,13.9684,393.356 -293,2042.15,16.2832,462.875 -294,2061.18,14.5204,405.534 -295,2044.39,16.3096,443.303 -296,2041.08,14.7646,423.565 -297,2059.35,16.6088,480.764 -298,2056.64,14.8632,439.057 -299,2041.67,16.1819,474.497 -300,2046,14.8817,430.63 -301,2045.81,16.9529,482.886 -302,2041.94,14.8111,418.944 -303,2047.65,16.1844,443.516 -304,2047.26,18.168,523.182 -305,2038.36,13.0969,383.679 -306,2035.59,17.6605,526.116 -307,2025.59,12.8126,385.065 -308,2031.71,17.8666,503.653 -309,2056.74,12.8665,368.899 -310,2058.11,17.2844,493.258 -311,2048,12.9923,373.85 -312,2048.48,17.7781,518.94 -313,2038.97,13.315,386.324 -314,2045.29,17.8682,561.902 -315,2045.01,13.3559,408.425 -316,2052.05,17.6483,519.367 -317,2042.07,13.1114,382.122 -318,2048.42,18.1515,516.877 -319,2040.27,14.2338,408.409 -320,2035.5,16.2667,479.687 -321,2055.97,15.4751,442.254 -322,2029,16.2987,481.582 -323,2060.11,15.8749,450.972 -324,2042.88,16.1802,468.385 -325,2047.97,14.7348,411.302 -326,2050.56,15.8767,462.193 -327,2044.76,16.5569,455.335 -328,2046.24,17.0959,532.856 -329,2039.26,15.2734,440.474 -330,2050.42,17.0588,561.264 -331,2044.68,16.2421,462.6 -332,2048.79,15.9382,490.145 -333,2047.86,16.0472,454.637 -334,2046.32,16.2691,485.25 -335,2051,16.3056,464.254 -336,2043.9,15.9554,500.745 -337,2038.06,14.887,431.08 -338,2047.11,16.0739,488.496 -339,2047.81,14.642,420.871 -340,2044.84,15.417,439.577 -341,2034.27,14.6235,419.735 -342,2046.14,15.539,447.817 -343,2046.67,14.5291,417.962 -344,2041.91,15.8494,452.794 -345,2041.28,14.2283,417.556 -346,2050.83,15.389,458.433 -347,2065.88,14.092,416.478 -348,2033.89,16.4173,462.624 -349,2043.99,14.297,415.017 -350,2032.51,16.2234,475.294 -351,2044.45,14.6393,418.946 -352,2039.01,14.4208,428.288 -353,2041.98,15.1301,428.303 -354,2055.12,15.1566,437.746 -355,2051.15,14.8614,428.579 -356,2040.91,14.3972,414.719 -357,2036.03,15.1706,413.671 -358,2035.34,15.2086,438.604 -359,2039.86,14.7404,411.035 -360,2037.26,15.7651,512.89 -361,2053.67,15.1628,438.444 -362,2053.17,15.7087,548.483 -363,2038.14,14.7837,428.274 -364,2052.96,15.3554,460.742 -365,2034.97,14.5649,419.958 -366,2052.48,16.0333,488.545 -367,2041.82,14.8826,415.08 -368,2050.25,15.489,444.637 -369,2056.18,16.0366,457.182 -370,2038.37,15.0844,443.463 -371,2045.12,15.6391,446.765 -372,2037.9,15.3501,438.319 -373,2052.94,15.8117,447.7 -374,2011.87,16.3917,460.921 -375,2033.03,16.1701,444.25 -376,2034.74,16.0387,456.87 -377,2042.11,16.1792,459.751 -378,2051.88,15.2926,441.72 -379,2050.86,16.5266,464.923 -380,2058.28,16.2411,455.703 -381,2044.27,15.617,443.54 -382,2033.63,15.5566,443.623 -383,2049.51,16.0095,449.477 -384,2049.89,15.266,434.303 -385,2050.9,15.5717,437.013 -386,2055.56,14.88,424.705 -387,2034.98,15.5122,426.15 -388,2052.45,15.1651,424.252 -389,2052.91,15.8397,418.978 -390,2065.93,14.2389,359.218 -391,2053.08,16.0009,393.57 -392,2049.45,15.6726,480.96 -393,2040.44,15.9811,453.255 -394,2060.91,15.8188,448.953 -395,2050.47,15.7543,446.701 -396,2027.16,14.606,423.07 -397,2041.3,15.5412,431.595 -398,2045.11,15.1722,428.562 -399,2044.94,15.9414,420.35 -400,2038.47,17.9342,528.081 -401,2061.23,19.799,551.586 -402,2055.22,18.7616,545.55 -403,2043.61,18.8072,536.401 -404,2044.9,17.9209,495.353 -405,2055.38,19.7815,550.649 -406,2061.66,18.4797,504.618 -407,2057.54,18.6458,529.18 -408,2052.98,19.1778,555.013 -409,2033.24,18.5124,533.322 -410,2060.29,18.8876,530.649 -411,2049.42,18.6707,527.561 -412,2056.5,18.6729,508.568 -413,2051.53,18.2299,524.78 -414,2047.26,19.013,523.313 -415,2051.37,18.3556,515.363 -416,2046.53,17.9425,528.353 -417,2042.31,15.0199,438.612 -418,2050.62,17.6382,520.082 -419,2037.67,14.7688,430.313 -420,2060.69,17.7803,513.939 -421,2041.37,14.7522,420.092 -422,2064.91,19.4159,537.314 -423,2061.47,14.7334,378.076 -424,2046.26,19.9113,558.091 -425,2041.91,14.8198,432.333 -426,2059.67,19.8421,564.597 -427,2050.28,14.9661,442.65 -428,2066.08,18.4769,518.358 -429,2034.39,14.6895,416.641 -430,2039.84,19.32,542.409 -431,2055.05,15.3154,420.427 -432,2050.9,14.915,442.186 -433,2050.35,15.278,447.006 -434,2046.68,14.4031,430.295 -435,2039.05,15.0839,437.966 -436,2052.04,14.4484,425.119 -437,2047.69,15.6432,446.425 -438,2038,15.9829,452.375 -439,2038.72,15.6073,441.382 -440,2042.8,14.2641,418.307 -441,2054.14,16.9739,477.343 -442,2038.75,14.8015,430.17 -443,2043.21,15.683,454.55 -444,2045.17,14.1565,407.653 -445,2040.2,15.6058,431.55 -446,2058.85,14.9631,436.218 -447,2048.96,15.2224,426.664 -448,2054.26,16.6538,467.062 -449,2048.57,14.8711,426.148 -450,2052.2,17.4754,485.652 -451,2056.74,15.1528,439.15 -452,2042.54,16.7013,457.829 -453,2056.74,14.4937,426.932 -454,2045.52,16.1152,454.161 -455,2033.15,15.0971,431.65 -456,2041.96,16.6521,471.849 -457,2057.59,15.0402,439.195 -458,2028.47,15.812,463.647 -459,2045.71,15.0017,438.148 -460,2056.87,17.239,478.268 -461,2036.49,14.5971,427.394 -462,2056.02,16.449,464.698 -463,2060.14,15.2552,426.86 -464,2047.78,16.2682,480.919 -465,2041.63,15.3745,430.641 -466,2034.1,17.4093,514.94 -467,2053.75,15.6558,444.845 -468,2037.44,16.5186,463.998 -469,2044.46,15.9278,436.005 -470,2044.03,17.1553,470.377 -471,2049.89,15.2926,429.391 -472,2061.27,17.312,480.735 -473,2054.24,15.508,445.502 -474,2063.01,16.7965,484.239 -475,2061.37,15.4655,440.298 -476,2064.91,16.4465,464.592 -477,2046.95,15.307,429.328 -478,2035.65,17.0608,467.875 -479,2049.55,16.114,449.085 -480,2050.35,16.4342,455.966 -481,2052.94,16.2619,462.785 -482,2051.18,15.4661,429.635 -483,2058.76,16.5047,464.784 -484,2056.24,15.4215,432.961 -485,2053.87,16.0741,450.574 -486,2056.95,15.3985,431.449 -487,2048.59,15.5348,447.156 -488,2059.06,15.1731,435.326 -489,2049.44,15.3604,451.141 -490,2036.53,16.1862,445.431 -491,2051.7,16.7796,474.99 -492,2042.8,15.9571,435.341 -493,2047.68,17.0647,471.684 -494,2067.92,15.0415,420.342 -495,2048.91,15.9399,452.504 -496,2053.11,15.227,445.333 -497,2053.32,16.5007,473.039 -498,2044.45,15.7051,446.879 -499,2058.07,16.6199,471.521 -500,2042.98,15.4344,434.767 -501,2058.01,16.7861,472.977 -502,2043.37,16.3522,453.787 -503,2041.17,16.4768,457.814 -504,2032.23,15.5404,448.558 -505,2035.43,16.7127,472.949 -506,2035.44,15.163,441.709 -507,2037.67,15.6607,462.133 -508,2032.89,15.9482,446.559 -509,2030.24,16.9846,478.056 -510,2038.24,15.394,444.445 -511,2045.73,17.5203,497.137 -512,2047.52,15.7911,462.844 -513,2048.17,14.641,412.092 -514,2040.23,14.9338,418.643 -515,2048.93,13.7099,387.703 -516,2032.16,15.2438,426.534 -517,2050.91,14.5409,409.502 -518,2058.24,14.5581,371.1 -519,2052.5,14.5856,366.057 -520,2041.63,14.4309,418.265 -521,2054.49,14.2279,412.447 -522,2056.24,15.0219,428.775 -523,2049.79,14.1404,402.886 -524,2052.64,14.9272,406.054 -525,2043.88,14.8495,410.841 -526,2053.36,15.8263,425.976 -527,2046.95,13.9669,396.971 -528,2036.64,16.7626,475.535 -529,2049.74,14.6928,424.919 -530,2030.53,16.9536,490.077 -531,2063.02,15.6675,447.191 -532,2038.67,16.4145,449.527 -533,2050.43,14.5852,417.612 -534,2037.67,17.0521,467.177 -535,2039.75,16.0204,431.763 -536,2046.01,16.9502,472.506 -537,2033.97,16.0924,454.426 -538,2066.39,17.1723,510.133 -539,2057,15.1666,436.681 -540,2072.76,16.6353,446.761 -541,2059.8,15.2935,422.872 -542,2031.7,16.6585,458.502 -543,2053.28,15.1566,408.431 -544,2048.77,15.2063,432.617 -545,2059.15,15.4911,434.549 -546,2032.35,15.3483,446.175 -547,2046.22,14.7925,435.531 -548,2028.81,15.2244,422.476 -549,2054.69,14.972,405.829 -550,2031.59,15.9781,421.772 -551,2051.58,14.7521,404.944 -552,2054.79,15.4934,465.49 -553,2052.03,15.3261,435.442 -554,2046.72,16.39,475.124 -555,2056.66,14.4877,423.351 -556,2037.04,15.3778,434.856 -557,2050.49,15.3985,433.869 -558,2055.68,15.742,437.689 -559,2057.79,15.1556,415.366 -560,2054.52,17.1991,508.914 -561,2047.33,15.2857,438.509 -562,2051.26,16.8849,541.588 -563,2049.9,15.1432,429.374 -564,2030.92,17.1886,491.57 -565,2054.62,14.9635,428.704 -566,2050.5,16.986,470.945 -567,2051.77,15.281,425.098 -568,2053.46,17.9923,520.742 -569,2045.88,15.4636,435.12 -570,2048.69,16.1041,478.325 -571,2061.07,14.8006,434.502 -572,2055.99,16.6916,474.945 -573,2042.83,14.6256,416.498 -574,2056.84,16.7907,478.919 -575,2052.51,15.2141,427.654 -576,2034.34,15.3165,440.691 -577,2049.02,15.4249,450.955 -578,2055.44,16.0714,462.771 -579,2038.36,16.0009,462.021 -580,2041.58,15.8567,442.852 -581,2040.2,15.4216,440.782 -582,2042.99,16.1292,448.872 -583,2065.84,16.1637,457.282 -584,2038.53,15.6743,450.064 -585,2045.62,15.7874,453.636 -586,2060.78,15.3278,447.419 -587,2045.86,16.0997,463.096 -588,2043.68,15.4499,418.846 -589,2055.4,15.5896,451.94 -590,2023.94,14.7331,413.578 -591,2046.33,16.032,450.82 -592,2043.89,15.5148,450.813 -593,2056.63,15.4543,443.97 -594,2045.41,14.8938,433.796 -595,2039.63,15.1784,438.491 -596,2054.27,14.7295,424.735 -597,2043.64,14.9674,432.971 -598,2046.45,15.3643,435.86 -599,2042.58,15.2204,429.937 -600,2054.19,15.7155,453.539 -601,2044.64,15.36,435.688 -602,2059.67,15.5076,446.967 -603,2043.25,15.7938,453.419 -604,2052.95,14.893,421.657 -605,2033.68,14.2343,425.295 -606,2036.01,13.9909,384.43 -607,2040.03,15.9712,446.946 -608,2032.95,12.2844,353.587 -609,2038.53,16.7465,510.977 -610,2048.72,12.0518,414.626 -611,2046.44,16.8473,475.94 -612,2021.66,12.9526,390.371 -613,2045.39,16.5482,460.996 -614,2037.46,13.4141,383.163 -615,2065.06,16.8329,489.271 -616,2051.54,12.8845,373.447 -617,2051.69,17.4527,518.92 -618,2034.39,13.0999,390.832 -619,2039.62,16.0052,471.38 -620,2051.15,12.4589,360.984 -621,2052.78,16.5887,463.902 -622,2041.02,12.976,359.92 -623,2058.74,16.5347,458.558 -624,2038.03,12.8056,372.895 -625,2045.27,13.2124,387.159 -626,2040.49,12.453,364.307 -627,2053.64,12.9353,380.347 -628,2045.63,12.3668,348.69 -629,2035.18,13.3122,376.741 -630,2043.28,12.9236,361.491 -631,2039.07,13.03,367.479 -632,2040.21,13.0658,377.632 -633,2023.15,12.8518,373.181 -634,2045.21,12.453,358.617 -635,2039.13,12.9444,382.706 -636,2034.38,12.347,356.245 -637,2037.8,12.4945,364.287 -638,2044.88,12.1875,348.499 -639,2051.59,13.1938,390.784 -640,2041,16.5822,478.602 -641,2046.29,14.9679,436.277 -642,2047.93,16.6281,465.148 -643,2040.82,14.4755,400.523 -644,2057.81,16.4928,439.784 -645,2025.19,14.293,388.431 -646,2051.32,17.0244,436.126 -647,2031.13,14.7924,357.74 -648,2046.19,17.4765,493.9 -649,2044.74,15.6528,454.693 -650,2041.81,16.2249,474.585 -651,2054.03,15.2127,442.319 -652,2051.1,15.8903,456.317 -653,2035.17,14.4473,417.434 -654,2048.92,15.7969,431.776 -655,2041.39,13.9606,407.235 -656,2059.35,16.3599,477.332 -657,2026.72,17.2127,513.413 -658,2038.81,15.9747,472.448 -659,2045.5,15.5645,481.289 -660,2039.96,16.2895,471.216 -661,2048.09,16.8147,496.326 -662,2056.6,16.3789,456.306 -663,2042.46,16.9003,477.607 -664,2040.55,16.7438,493.331 -665,2040.18,16.0033,472.72 -666,2043.32,16.4602,479.692 -667,2055.31,16.3848,496.581 -668,2050.03,16.5392,477.833 -669,2031.66,15.2771,461.979 -670,2045.48,16.9295,485.714 -671,2041.42,15.8967,467.644 -672,2044.78,15.2593,444.965 -673,2043.08,15.6318,449.969 -674,2045.45,15.7961,450.491 -675,2042.08,14.4717,423.611 -676,2044.43,15.8013,438.543 -677,2024.2,15.7154,435.661 -678,2038.15,15.8197,438.853 -679,2059.9,14.4515,407.878 -680,2061.59,16.1205,479.176 -681,2046.86,15.9356,467.906 -682,2051.34,15.3604,446.701 -683,2060.52,14.7858,437.507 -684,2061.72,14.9798,433.621 -685,2045.99,15.5868,446.677 -686,2030.11,15.2179,437.114 -687,2043.14,15.2794,449.126 -688,2047.19,14.8339,439.418 -689,2044.73,16.8194,481.462 -690,2043.2,14.4641,422.434 -691,2042.69,16.798,477.72 -692,2066.47,14.9221,430.048 -693,2052.59,17.0467,483.876 -694,2051.14,15.2087,429.536 -695,2052.51,16.466,469.421 -696,2036.36,15.4159,446.176 -697,2043.75,16.2774,481.136 -698,2052.11,15.5054,444.288 -699,2038.76,15.7707,468.147 -700,2051.26,15.831,456.724 -701,2040.61,17.0118,476.584 -702,2056.29,15.2728,431.597 -703,2046.8,16.099,476.667 -704,2055.66,14.5876,417.22 -705,2039.3,17.3252,496.555 -706,2045.41,14.1563,407.964 -707,2026.08,15.9067,467.167 -708,2046.49,14.3884,400.878 -709,2042.28,17.1767,487.837 -710,2047.44,13.844,398.014 -711,2049.07,16.191,471.486 -712,2053.22,14.353,413.66 -713,2034.78,17.2218,494.56 -714,2047.53,13.3568,393.187 -715,2040.05,15.5525,458.563 -716,2044.01,14.3752,409.9 -717,2060.96,16.6011,486.711 -718,2043.53,12.6652,372.939 -719,2061.6,17.1087,500.427 -720,2057.61,15.3686,447.856 -721,2054.56,16.1011,478.157 -722,2037.22,15.2724,439.752 -723,2042.66,17.3708,500.726 -724,2035.71,14.3885,409.764 -725,2046.4,16.8235,484.927 -726,2037.01,14.7484,413.711 -727,2041.92,16.6233,470.405 -728,2055.21,15.9216,467.849 -729,2055.36,17.217,497.424 -730,2037.3,15.5609,453.386 -731,2038.65,17.3535,495.664 -732,2037.26,14.9519,440.705 -733,2041.21,15.9461,463.865 -734,2039.7,15.9082,459.491 -735,2046.56,16.9869,485.166 -736,2032.37,12.4656,439.091 -737,2052.87,14.5894,428.623 -738,2051.72,13.1191,472.812 -739,2048.57,15.2014,443.071 -740,2055.65,12.247,362.566 -741,2043.86,14.1261,408.092 -742,2037.14,12.7336,364.883 -743,2047.69,14.3487,419.419 -744,2054.36,12.1907,370.111 -745,2063.32,14.7632,428.919 -746,2054.84,12.4448,360.522 -747,2040.45,14.6132,426.172 -748,2054.75,11.4404,333.943 -749,2050.3,14.2912,415.525 -750,2049,12.1525,349.932 -751,2069.92,14.2497,423.391 -752,2050.65,16.4557,481.186 -753,2046.55,13.6645,394.381 -754,2038.34,15.3026,448.949 -755,2046.38,13.3697,389.651 -756,2047.76,15.4852,442.263 -757,2044.67,12.939,375.953 -758,2044.61,15.6513,448.304 -759,2040.9,12.8085,365.729 -760,2031.88,15.8882,465.607 -761,2047.88,13.5927,390.7 -762,2050.11,15.9477,469.707 -763,2043.56,13.3833,389.087 -764,2044.27,15.2115,447.997 -765,2037.25,13.6264,392.667 -766,2038.59,15.3916,448.216 -767,2042.88,13.1364,386.211 -768,2047.9,14.5986,415.471 -769,2035.31,18.4007,526.663 -770,2029.84,14.2491,386.549 -771,2040.11,18.3429,511.148 -772,2028.02,14.6811,389.761 -773,2043.21,18.0963,507.489 -774,2039.96,13.3244,320.366 -775,2037.59,17.2999,434.401 -776,2039.92,14.7633,419.947 -777,2048.19,17.5157,506.066 -778,2046.16,15.0285,427.106 -779,2049.11,17.6262,508.767 -780,2043.61,13.475,368.049 -781,2045.28,18.6389,506.494 -782,2059.15,14.4277,374.539 -783,2045.75,17.6531,489.999 -784,2062.08,16.2186,450.242 -785,2026.37,15.8748,457.946 -786,2037.49,16.5243,467.779 -787,2032.44,16.4103,465.768 -788,2040.77,15.0912,425.629 -789,2036.31,15.8739,437.349 -790,2062.02,15.552,440.955 -791,2053.57,15.6544,414.128 -792,2058.14,14.9742,463.337 -793,2049.5,16.5193,466.779 -794,2033.71,15.6514,463.128 -795,2043.83,16.1158,463.556 -796,2048.47,15.6024,433.56 -797,2054.79,15.6641,453.976 -798,2043.82,15.8524,435.644 -799,2031.98,16.6735,465.244 -800,2052.13,17.5206,489.466 -801,2054.39,14.6217,430.481 -802,2031.19,17.4989,490.732 -803,2042.54,15.1578,435.865 -804,2045.77,17.1794,472.025 -805,2045.91,15.4256,442.138 -806,2044.67,17.0693,458.148 -807,2038.66,14.9821,419.007 -808,2049.04,17.7758,488.184 -809,2049.9,15.0083,438.626 -810,2053.41,16.7417,480.846 -811,2052.83,14.9399,442.066 -812,2063.75,17.4172,478.252 -813,2038.21,15.3573,438.145 -814,2052.63,16.3896,461.628 -815,2052.86,14.7239,417.094 -816,2050.97,17.3189,478.598 -817,2037.83,15.1842,434.49 -818,2034.77,17.3389,482.841 -819,2048.87,14.6582,426.492 -820,2049.97,17.5301,479.532 -821,2042.57,15.0734,428.689 -822,2035.22,17.3974,474.213 -823,2041.24,14.7931,421.642 -824,2042.09,17.7045,597.784 -825,2037.9,15.4254,444.855 -826,2057.63,18.218,489.513 -827,2042.82,14.739,428.945 -828,2048.77,17.838,486.934 -829,2043.35,15.4044,441.705 -830,2038.84,17.4456,481.983 -831,2036.51,15.1384,434.237 -832,2044.63,15.5082,434.603 -833,2028.03,16.4877,474.757 -834,2068.45,15.1201,430.056 -835,2038.09,16.4534,478.081 -836,2053.83,15.4244,440.077 -837,2044.01,16.6703,464.892 -838,2059.02,14.7908,418.341 -839,2039.85,16.105,472.228 -840,2053.65,14.9918,429.708 -841,2026.02,16.0183,466.208 -842,2061.72,15.4235,447.946 -843,2047.37,16.5332,474.707 -844,2043.58,15.2412,432.255 -845,2038.59,15.9247,459.686 -846,2052.08,14.8668,429.606 -847,2044.22,16.2803,469.046 -848,2037.94,16.9557,492.256 -849,2047.51,17.3198,490.76 -850,2048.22,16.7137,488.75 -851,2036.55,16.6866,484.595 -852,2045.21,15.2787,461.602 -853,2034.96,17.3716,488.39 -854,2028.96,17.1651,482.166 -855,2049.14,16.6991,466.657 -856,2040.8,16.0837,487.526 -857,2043.34,17.2417,494.4 -858,2051.05,17.2396,496.364 -859,2039.05,16.7178,488.077 -860,2049.07,16.406,481.742 -861,2053.55,17.1289,485.476 -862,2037.27,16.7693,477.018 -863,2051.71,19.2462,526.331 -864,2041.06,17.3474,497.78 -865,2040.54,14.6816,429.303 -866,2039.82,17.7766,507.089 -867,2042.88,14.1435,418.216 -868,2038.08,18.1377,507.44 -869,2045.89,13.4831,400.751 -870,2045.67,17.7275,505.317 -871,2037.17,14.5268,420.601 -872,2045.68,17.9926,508.815 -873,2046.12,13.7404,415.333 -874,2067.63,17.439,503.325 -875,2043.75,14.3588,421.969 -876,2028.47,17.0622,473.923 -877,2056.31,13.6098,405.881 -878,2047.38,18.3003,510.453 -879,2063.51,14.4428,421.273 -880,2052.06,15.0017,445.645 -881,2029.62,16.5877,502.614 -882,2048.39,16.3589,467.192 -883,2043.56,17.1629,507.114 -884,2056.73,15.2538,447.82 -885,2048.15,17.2931,499.509 -886,2050.19,16.2011,461.566 -887,2050.36,16.3675,493.879 -888,2043.49,15.5622,442.433 -889,2037.21,17.1538,498.683 -890,2047,15.7632,449.974 -891,2034.63,17.2153,506.547 -892,2034.82,14.8043,429.722 -893,2050.39,16.7651,490.903 -894,2031.03,15.1678,431.256 -895,2040.67,16.9647,504.814 -896,2040.26,18.3003,515.205 -897,2052.41,16.9716,486.109 -898,2032.88,17.3427,487.701 -899,2030.49,16.399,449.714 -900,2024.58,17.7079,463.521 -901,2042.94,17.6497,474.275 -902,2037.09,16.1153,428.643 -903,2052.52,16.1419,413.391 -904,2043.09,18.4254,536.305 -905,2055.7,16.4546,477.115 -906,2040.28,17.7428,566.651 -907,2042.52,16.5371,477.996 -908,2036.71,17.135,503.095 -909,2054.7,16.999,476.388 -910,2043.28,16.7924,497.145 -911,2038.43,16.5306,464.436 -912,2045.72,15.6542,456.588 -913,2037.44,15.4329,446.927 -914,2041.7,16.5212,464.664 -915,2042.49,14.7025,430.237 -916,2040.34,15.7258,434.19 -917,2048.36,14.8021,421.033 -918,2053.34,16.1834,449.326 -919,2038.86,14.8568,394.59 -920,2052.74,16.2141,464.372 -921,2039.54,14.8448,437.136 -922,2052.98,15.9144,445.907 -923,2031.46,14.571,424.484 -924,2070.18,15.8411,429.646 -925,2042.72,14.8303,415.568 -926,2061.42,17.0363,463.586 -927,2034.35,15.1193,428.468 -928,2053.11,19.4161,529.496 -929,2033.79,19.0186,536.479 -930,2047.17,19.2696,531.809 -931,2043.66,17.7377,514.856 -932,2042.19,19.3767,523.301 -933,2050.26,18.5729,518.239 -934,2041.75,18.5746,469.495 -935,2045.11,18.5694,506.823 -936,2047.72,18.9881,528.421 -937,2047.35,17.2871,497.907 -938,2051.27,17.9492,510.548 -939,2036.34,17.6065,511.551 -940,2036.22,17.9199,509.041 -941,2016.17,18.0038,513.612 -942,2042.96,18.993,522.103 -943,2039.24,18.2942,519.35 -944,2052.85,17.2441,502.292 -945,2048.16,16.275,484.052 -946,2049.87,17.6047,511.571 -947,2041.84,16.6146,483.523 -948,2031.59,17.9039,476.898 -949,2055.45,16.7637,486.182 -950,2045.8,18.2626,507.192 -951,2049.55,16.9707,475.558 -952,2062.61,17.6207,506.706 -953,2055,16.2621,483.419 -954,2044.03,17.1924,500.265 -955,2044.18,16.2384,474.589 -956,2052.56,17.6245,494.676 -957,2035.71,17.0279,470.073 -958,2029.38,18.0739,512.597 -959,2047.93,16.6635,468.906 -960,2059.45,13.2047,386.362 -961,2037.46,15.6165,452.173 -962,2046.89,13.8911,404.687 -963,2044.49,14.4252,429.935 -964,2036.58,14.1993,396.945 -965,2036.23,14.6426,431.648 -966,2050.68,13.4374,380.211 -967,2047.12,14.7807,433.823 -968,2024.24,13.7057,396.835 -969,2047.49,16.1484,498.979 -970,2041.69,13.6854,395.604 -971,2041.51,15.0819,454.42 -972,2032.63,13.6632,384.587 -973,2064.7,14.6663,432.293 -974,2061.71,13.8162,396.783 -975,2037.27,14.3332,425.907 -976,2047.56,13.2721,377.429 -977,2045.99,15.2257,440.923 -978,2027.92,13.1594,380.198 -979,2036.04,14.9552,442.425 -980,2036.19,13.5918,377.84 -981,2048.87,14.7298,428.577 -982,2054.97,13.3066,367.744 -983,2044.49,15.1357,438.743 -984,2045.81,13.9812,385.544 -985,2037.8,14.8079,450.769 -986,2043.42,12.7808,368.629 -987,2045.59,15.601,452.255 -988,2056.19,13.5975,382.068 -989,2043.86,14.8826,432.689 -990,2041.27,13.1794,370.209 -991,2038.88,15.4173,444.259 -992,2051.09,13.0811,381.154 -993,2032.1,15.4822,441.835 -994,2036.35,13.5414,382.63 -995,2046.42,15.7959,452.081 -996,2045.2,13.7111,384.524 -997,2035.28,14.9012,431.414 -998,2040.88,13.0734,370.85 -999,2055.18,15.3191,438.688 -1000,2060.06,13.9053,388.327 -1001,2032.58,15.2999,445.619 -1002,2054.51,13.2142,379.583 -1003,2049.4,15.7943,449.319 -1004,2061.26,13.4856,381.119 -1005,2036.29,15.7375,439.449 -1006,2045.19,13.1035,377.274 -1007,2051.26,15.8442,446.869 -1008,2055.6,16.7544,476.478 -1009,2045.4,18.3987,527.743 -1010,2043.48,16.2683,466.063 -1011,2046.71,18.1869,529.578 -1012,2039.76,16.6874,471.174 -1013,2036.13,17.7656,518.708 -1014,2056.32,16.8091,472.135 -1015,2045.98,17.8933,511.92 -1016,2044.47,16.8466,469.627 -1017,2058.14,17.1185,511.822 -1018,2045.89,16.4311,469.175 -1019,2050.78,18.2319,533.061 -1020,2034.1,16.6546,467.675 -1021,2045.9,17.4729,505.819 -1022,2043.2,16.7553,475.552 -1023,2048.19,18.4007,517.156 -1024,0,-1,-1 -1025,2046.59,16.0511,442.623 -1026,0,-1,-1 -1027,2042.4,16.5043,433.623 -1028,0,-1,-1 -1029,2049.74,15.8006,423.711 -1030,0,-1,-1 -1031,2044.33,15.8977,388.323 -1032,0,-1,-1 -1033,2050.4,16.2022,428.199 -1034,0,-1,-1 -1035,2051.79,16.1448,438.898 -1036,0,-1,-1 -1037,2033.69,16.5171,432.187 -1038,0,-1,-1 -1039,2049.81,16.2771,422.909 -1040,0,-1,-1 -1041,2033.05,18.4057,509.824 -1042,0,-1,-1 -1043,2045.56,19.4731,520.207 -1044,0,-1,-1 -1045,2047.64,18.198,480.097 -1046,0,-1,-1 -1047,2038.99,18.5401,486.716 -1048,0,-1,-1 -1049,2015.07,20.4722,552.042 -1050,0,-1,-1 -1051,2051.05,19.7362,545.905 -1052,0,-1,-1 -1053,2035.58,18.1275,498.173 -1054,0,-1,-1 -1055,2037.48,18.621,504.43 -1056,0,-1,-1 -1057,2032.96,15.2763,409.309 -1058,0,-1,-1 -1059,2036.21,15.5171,416.903 -1060,0,-1,-1 -1061,2044.26,15.7735,425.704 -1062,0,-1,-1 -1063,2032.73,15.1955,380.8 -1064,0,-1,-1 -1065,2028.09,17.4304,506.829 -1066,0,-1,-1 -1067,2044.69,18.2438,520.65 -1068,0,-1,-1 -1069,2036.07,16.7654,480.037 -1070,0,-1,-1 -1071,2043.78,16.2854,470.616 -1072,0,-1,-1 -1073,2042.29,15.2596,397.774 -1074,0,-1,-1 -1075,2035.18,16.1071,427.425 -1076,0,-1,-1 -1077,2040.88,16.5834,449.395 -1078,0,-1,-1 -1079,2035.09,15.7162,406.577 -1080,0,-1,-1 -1081,2033.6,14.6913,412.357 -1082,0,-1,-1 -1083,2049.56,16.0286,424.485 -1084,0,-1,-1 -1085,2033.88,16.6423,448.343 -1086,0,-1,-1 -1087,2045.27,16.1814,439.888 -1088,0,-1,-1 -1089,2020.09,18.4006,493.238 -1090,0,-1,-1 -1091,2038.23,19.4272,509.05 -1092,0,-1,-1 -1093,2048.9,18.3064,488.719 -1094,0,-1,-1 -1095,2036.18,17.2596,455.815 -1096,0,-1,-1 -1097,2033.86,18.7827,500.051 -1098,0,-1,-1 -1099,2048.68,18.1976,490.498 -1100,0,-1,-1 -1101,2049.02,17.3997,472.052 -1102,0,-1,-1 -1103,2061.45,19.51,508.424 -1104,0,-1,-1 -1105,2048.65,19.1068,539.861 -1106,0,-1,-1 -1107,2051.22,-1,-1 -1108,0,-1,-1 -1109,2026.27,17.0038,460.804 -1110,0,-1,-1 -1111,2026.7,16.8031,452.076 -1112,0,-1,-1 -1113,2036.32,17.398,526.223 -1114,0,-1,-1 -1115,2033.54,16.9447,479.4 -1116,0,-1,-1 -1117,2042.68,17.1478,470.2 -1118,0,-1,-1 -1119,2036.77,16.8943,470.262 -1120,0,-1,-1 -1121,2035.78,17.2024,461.729 -1122,0,-1,-1 -1123,2051.78,17.8501,479.729 -1124,0,-1,-1 -1125,2025.09,16.4958,433.811 -1126,0,-1,-1 -1127,2061.4,16.4855,456.118 -1128,0,-1,-1 -1129,2046.54,17.4736,485.488 -1130,0,-1,-1 -1131,2037.1,17.5495,459.755 -1132,0,-1,-1 -1133,2036.48,17.3078,455.798 -1134,0,-1,-1 -1135,2043.99,17.414,464.173 -1136,0,-1,-1 -1137,2041.43,21.0771,559.248 -1138,0,-1,-1 -1139,2043.07,19.4114,534.715 -1140,0,-1,-1 -1141,2044.16,20.8365,550.124 -1142,0,-1,-1 -1143,2035,20.3682,538.162 -1144,0,-1,-1 -1145,2044.79,19.4605,530.577 -1146,0,-1,-1 -1147,2038.63,19.8086,538.093 -1148,0,-1,-1 -1149,2032.88,20.0029,541.962 -1150,0,-1,-1 -1151,2039.22,19.5,533.598 -1152,0,-1,-1 -1153,2024.93,15.1553,418.15 -1154,0,-1,-1 -1155,2045.54,15.8813,393.451 -1156,0,-1,-1 -1157,2038.86,15.2498,383.893 -1158,0,-1,-1 -1159,2048.64,14.131,338.842 -1160,0,-1,-1 -1161,2050.94,14.9651,421.611 -1162,0,-1,-1 -1163,2048.84,15.2969,423.911 -1164,0,-1,-1 -1165,2059.59,15.391,418.853 -1166,0,-1,-1 -1167,2033.72,16.3156,424.11 -1168,0,-1,-1 -1169,2030.07,18.0328,524.571 -1170,0,-1,-1 -1171,2038.49,17.2367,493.844 -1172,0,-1,-1 -1173,2033.05,17.1442,482.248 -1174,0,-1,-1 -1175,2039.72,17.1329,467.755 -1176,0,-1,-1 -1177,2043.3,17.3418,486.031 -1178,0,-1,-1 -1179,2037.18,18.6199,489.212 -1180,0,-1,-1 -1181,2036.07,18.9188,536.471 -1182,0,-1,-1 -1183,2032.82,18.7768,504.611 -1184,0,-1,-1 -1185,2050.95,16.1567,456.328 -1186,0,-1,-1 -1187,2048.41,16.6559,457.099 -1188,0,-1,-1 -1189,2035.37,16.5232,448.992 -1190,0,-1,-1 -1191,2058.22,16.0269,413.139 -1192,0,-1,-1 -1193,2050.2,16.884,506.563 -1194,0,-1,-1 -1195,2044.25,16.4438,468.625 -1196,0,-1,-1 -1197,2041.35,18.1068,505.111 -1198,0,-1,-1 -1199,2040.2,18.0621,487.523 -1200,0,-1,-1 -1201,2034.64,20.4169,624.619 -1202,0,-1,-1 -1203,2044.99,18.0626,557.873 -1204,0,-1,-1 -1205,2040.87,17.4997,492.728 -1206,0,-1,-1 -1207,2036.29,17.7563,512.991 -1208,0,-1,-1 -1209,2047.73,18.9152,500.551 -1210,0,-1,-1 -1211,2054.23,17.2292,475.441 -1212,0,-1,-1 -1213,2038.73,18.7509,494.05 -1214,0,-1,-1 -1215,2030.07,16.9285,474.019 -1216,0,-1,-1 -1217,2052.37,17.8206,478.933 -1218,0,-1,-1 -1219,2035.97,18.291,505.789 -1220,0,-1,-1 -1221,2054.52,19.4936,517.332 -1222,0,-1,-1 -1223,2049.45,17.4016,466.989 -1224,0,-1,-1 -1225,2042.27,19.0535,513.355 -1226,0,-1,-1 -1227,2029.54,16.7674,474.805 -1228,0,-1,-1 -1229,2026.99,16.3897,449.247 -1230,0,-1,-1 -1231,2047.89,16.3024,429.026 -1232,0,-1,-1 -1233,2026.86,17.3664,558.649 -1234,0,-1,-1 -1235,2036.18,17.3412,546.12 -1236,0,-1,-1 -1237,2040.15,17.2874,550.163 -1238,0,-1,-1 -1239,2034.64,18.5907,530.437 -1240,0,-1,-1 -1241,2031.2,16.0667,446.184 -1242,0,-1,-1 -1243,2031.34,17.0377,460.946 -1244,0,-1,-1 -1245,2065.16,16.926,454.325 -1246,0,-1,-1 -1247,2040.49,16.6409,455.005 -1248,0,-1,-1 -1249,2039.23,19.2271,536.519 -1250,0,-1,-1 -1251,2056.07,18.7371,508.616 -1252,0,-1,-1 -1253,2055.72,18.4649,494.158 -1254,0,-1,-1 -1255,2038.16,18.9321,498.828 -1256,0,-1,-1 -1257,2054.48,19.5008,520.1 -1258,0,-1,-1 -1259,2028.31,19.4548,518.746 -1260,0,-1,-1 -1261,2050.14,19.5525,520.142 -1262,0,-1,-1 -1263,2051.04,19.6388,520.183 -1264,0,-1,-1 -1265,2054.1,18.5184,517.109 -1266,0,-1,-1 -1267,2043.19,19.6327,529.166 -1268,0,-1,-1 -1269,2052.18,19.4394,519.681 -1270,0,-1,-1 -1271,2052.52,19.035,513.587 -1272,0,-1,-1 -1273,2036.44,19.7631,545.236 -1274,0,-1,-1 -1275,2058.16,20.6871,547.021 -1276,0,-1,-1 -1277,2036.91,20.8867,583.469 -1278,0,-1,-1 -1279,2031.99,20.8916,585.611 -1280,0,-1,-1 -1281,2029.79,15.3278,428.041 -1282,0,-1,-1 -1283,2039.47,14.8794,419.255 -1284,0,-1,-1 -1285,2051.69,15.6054,423.198 -1286,0,-1,-1 -1287,2048.43,14.9411,418.951 -1288,0,-1,-1 -1289,2049.1,15.0532,421.239 -1290,0,-1,-1 -1291,2046.52,15.2875,425.938 -1292,0,-1,-1 -1293,2036.88,15.2867,416.279 -1294,0,-1,-1 -1295,2048.64,15.4497,423.173 -1296,0,-1,-1 -1297,2066.16,16.8692,468.804 -1298,0,-1,-1 -1299,2046.05,17.5859,479.857 -1300,0,-1,-1 -1301,2038.97,17.8062,483.368 -1302,0,-1,-1 -1303,2045.56,17.8368,480.587 -1304,0,-1,-1 -1305,2046.08,17.9433,480.476 -1306,0,-1,-1 -1307,2045.87,17.7345,481.666 -1308,0,-1,-1 -1309,2026.12,17.1098,470.533 -1310,0,-1,-1 -1311,2035.67,18.3917,492.863 -1312,0,-1,-1 -1313,2036.33,18.7423,499.794 -1314,0,-1,-1 -1315,2064.91,18.5311,498.548 -1316,0,-1,-1 -1317,2054.98,17.9517,491.544 -1318,0,-1,-1 -1319,2062.16,18.4717,494.161 -1320,0,-1,-1 -1321,2063.38,17.9431,484.233 -1322,0,-1,-1 -1323,2043.96,17.8141,480.268 -1324,0,-1,-1 -1325,2045.33,17.8513,482.332 -1326,0,-1,-1 -1327,2045.26,18.3712,494.646 -1328,0,-1,-1 -1329,2048.11,21.4729,589.408 -1330,0,-1,-1 -1331,2037.77,21.4484,585.489 -1332,0,-1,-1 -1333,2043.01,20.5451,567.256 -1334,0,-1,-1 -1335,2050.79,21.2442,578.64 -1336,0,-1,-1 -1337,2045.75,20.7065,539.118 -1338,0,-1,-1 -1339,2065.37,21.0127,575.605 -1340,0,-1,-1 -1341,2040.6,20.7083,535.203 -1342,0,-1,-1 -1343,2045.27,20.7832,561.721 -1344,0,-1,-1 -1345,2030.18,17.0157,471.857 -1346,0,-1,-1 -1347,2044.31,16.5076,458.865 -1348,0,-1,-1 -1349,2042.5,17.0294,461.426 -1350,0,-1,-1 -1351,2046.54,16.86,461.841 -1352,0,-1,-1 -1353,2044.87,15.9015,439.575 -1354,0,-1,-1 -1355,2049.82,16.1806,450.745 -1356,0,-1,-1 -1357,2055.8,16.0572,465.878 -1358,0,-1,-1 -1359,2043.17,16.2193,466.007 -1360,0,-1,-1 -1361,2037.92,17.731,466.377 -1362,0,-1,-1 -1363,2038.53,17.0063,463.038 -1364,0,-1,-1 -1365,2043.5,16.6676,461.3 -1366,0,-1,-1 -1367,2038.69,17.2602,485.994 -1368,0,-1,-1 -1369,2046.3,17.0149,463.011 -1370,0,-1,-1 -1371,2041.14,16.7985,523.587 -1372,0,-1,-1 -1373,2046.84,17.0475,473.661 -1374,0,-1,-1 -1375,2052.09,17.6991,487.147 -1376,0,-1,-1 -1377,2041.07,18.4697,543.851 -1378,0,-1,-1 -1379,2054.5,19.084,548.075 -1380,0,-1,-1 -1381,2049.89,19.2052,565.882 -1382,0,-1,-1 -1383,2037.6,18.8412,551.041 -1384,0,-1,-1 -1385,2053.85,18.4822,511.619 -1386,0,-1,-1 -1387,2048.87,19.4383,523.978 -1388,0,-1,-1 -1389,2053.71,19.033,529.177 -1390,0,-1,-1 -1391,2040.09,18.6743,535.403 -1392,0,-1,-1 -1393,2043.17,15.598,434.666 -1394,0,-1,-1 -1395,2048.07,15.3674,429.535 -1396,0,-1,-1 -1397,2060.01,16.5138,449.802 -1398,0,-1,-1 -1399,2047.08,15.3488,437.436 -1400,0,-1,-1 -1401,2060.44,15.5796,440.668 -1402,0,-1,-1 -1403,2051.51,15.3076,411.031 -1404,0,-1,-1 -1405,2046.61,15.502,446.005 -1406,0,-1,-1 -1407,2042.74,15.5965,467.681 -1408,0,-1,-1 -1409,2043.19,19.6227,527.636 -1410,0,-1,-1 -1411,2045.44,19.1495,505.231 -1412,0,-1,-1 -1413,2040.62,19.0671,515.06 -1414,0,-1,-1 -1415,2058.84,18.9942,513.164 -1416,0,-1,-1 -1417,2046.08,19.2129,504.609 -1418,0,-1,-1 -1419,2056.24,19.2586,505.872 -1420,0,-1,-1 -1421,2039.27,19.4278,516.139 -1422,0,-1,-1 -1423,2030.96,18.9545,515.225 -1424,0,-1,-1 -1425,2039.25,17.2466,458.577 -1426,0,-1,-1 -1427,2035.31,17.4415,477.651 -1428,0,-1,-1 -1429,2050.87,17.985,505.569 -1430,0,-1,-1 -1431,2055,17.7873,499.356 -1432,0,-1,-1 -1433,2023.77,17.1805,446.293 -1434,0,-1,-1 -1435,2051.79,17.3675,475.882 -1436,0,-1,-1 -1437,2056.3,17.9818,493.091 -1438,0,-1,-1 -1439,2045.15,17.5523,493.123 -1440,0,-1,-1 -1441,2044.73,16.7298,459.569 -1442,0,-1,-1 -1443,2030.87,17.0374,447.987 -1444,0,-1,-1 -1445,2038.21,17.2184,507.676 -1446,0,-1,-1 -1447,2052.05,17.7435,540.081 -1448,0,-1,-1 -1449,2044.63,17.3974,451.632 -1450,0,-1,-1 -1451,2044.13,16.9603,454.251 -1452,0,-1,-1 -1453,2040.53,17.3679,465.234 -1454,0,-1,-1 -1455,2053.37,17.3078,470.919 -1456,0,-1,-1 -1457,2057.53,18.867,483.318 -1458,0,-1,-1 -1459,2047.03,18.964,505.661 -1460,0,-1,-1 -1461,2037.46,20.6886,638.841 -1462,0,-1,-1 -1463,2038.81,20.0866,612.534 -1464,0,-1,-1 -1465,2041.82,19.0044,439.256 -1466,0,-1,-1 -1467,2057.79,18.9355,486.618 -1468,0,-1,-1 -1469,2044.28,19.027,474.762 -1470,0,-1,-1 -1471,2044.98,19.0868,511.21 -1472,0,-1,-1 -1473,2045.51,17.8663,470.666 -1474,0,-1,-1 -1475,2060.09,17.8346,464.581 -1476,0,-1,-1 -1477,2060.3,18.349,471.393 -1478,0,-1,-1 -1479,2033.71,17.937,472.082 -1480,0,-1,-1 -1481,2047.51,17.886,465.279 -1482,0,-1,-1 -1483,2050.1,17.8135,455.492 -1484,0,-1,-1 -1485,2057.01,18.5034,480.169 -1486,0,-1,-1 -1487,2035.59,17.8557,467.091 -1488,0,-1,-1 -1489,2055.68,19.3285,509.866 -1490,0,-1,-1 -1491,2044.03,19.5068,509.092 -1492,0,-1,-1 -1493,2046.76,19.7735,518.417 -1494,0,-1,-1 -1495,2046.41,19.124,506.35 -1496,0,-1,-1 -1497,2053.18,19.8611,515.561 -1498,0,-1,-1 -1499,2049.27,19.8528,518.159 -1500,0,-1,-1 -1501,2016.26,19.9843,520.615 -1502,0,-1,-1 -1503,2047.63,19.9389,526.29 -1504,0,-1,-1 -1505,2050.22,18.3207,480.352 -1506,0,-1,-1 -1507,2058.84,18.9246,492.3 -1508,0,-1,-1 -1509,2043.65,19.0238,494.127 -1510,0,-1,-1 -1511,2043.25,18.5236,488.323 -1512,0,-1,-1 -1513,2030.76,18.3352,480.046 -1514,0,-1,-1 -1515,2044.95,18.482,479.473 -1516,0,-1,-1 -1517,2034.97,19.0802,494.234 -1518,0,-1,-1 -1519,2037.42,18.9088,502.089 -1520,0,-1,-1 -1521,2048.78,19.109,511.661 -1522,0,-1,-1 -1523,2046.89,20.286,540.812 -1524,0,-1,-1 -1525,2056.63,20.8941,531.456 -1526,0,-1,-1 -1527,2047.6,20.0681,539.587 -1528,0,-1,-1 -1529,2048.96,20.8244,531.177 -1530,0,-1,-1 -1531,2041.74,19.477,512.915 -1532,0,-1,-1 -1533,2034.57,20.1228,525.323 -1534,0,-1,-1 -1535,2031.86,20.5251,533.489 -1536,2037.27,15.5475,455.695 -1537,2053.45,17.6076,556.762 -1538,2058.47,15.0985,432.146 -1539,2038.41,18.7437,592.646 -1540,2040.11,15.272,425.206 -1541,2050.03,18.8851,570.202 -1542,2033.25,14.7512,368.817 -1543,2035.78,17.4772,472.237 -1544,2046.8,16.3557,500.658 -1545,2050.81,19.173,651.154 -1546,2057.5,16.2513,525.95 -1547,2043.66,18.8235,659.956 -1548,2047.38,15.5142,465.047 -1549,2042.26,18.55,565.792 -1550,2045.02,16.0836,449.421 -1551,2040,18.7972,577.394 -1552,2055.79,17.9983,521.967 -1553,2027.12,17.9645,527.231 -1554,2061.03,17.667,521.315 -1555,2035.53,18.3799,542.651 -1556,2044.43,18.3986,520.065 -1557,2040.08,18.1313,522.544 -1558,2051.37,18.9421,527.866 -1559,2046.04,18.0216,498.079 -1560,2033.17,18.4325,520.628 -1561,2064.85,18.6646,576.578 -1562,2048.26,17.9361,518.617 -1563,2047.34,18.3142,519.804 -1564,2034.84,18.3301,505.015 -1565,2040.01,18.5988,528.37 -1566,2056.51,18.0849,505.159 -1567,2056.03,17.8633,497.891 -1568,2050.37,14.9691,440.265 -1569,2034.77,18.5436,533.277 -1570,2041.47,15.2641,458.27 -1571,2057.75,16.4127,481.219 -1572,2053.94,14.5086,417.528 -1573,2051.97,16.6479,477.675 -1574,2041.54,15.9975,454.19 -1575,2053.19,17.6796,461.587 -1576,2037.1,15.0044,453.318 -1577,2035.58,17.5489,495.255 -1578,2057.73,16.857,471.33 -1579,2048.01,17.2809,491.885 -1580,2046.49,14.9686,432.902 -1581,2047.72,17.0111,493.591 -1582,2052.41,14.4389,415.743 -1583,2059.87,16.7255,486.777 -1584,2032.5,16.456,491.814 -1585,2034.3,16.2471,473.298 -1586,2033.27,16.3553,488.107 -1587,2050.13,16.6149,478.263 -1588,2045.09,16.4371,480.703 -1589,2047.8,16.2121,460.902 -1590,2028.39,16.4633,481.639 -1591,2046.13,17.3015,483.898 -1592,2048.54,17.96,511.094 -1593,2048.06,18.1275,495.518 -1594,2053.27,16.3903,483.158 -1595,2041.32,16.6614,475.296 -1596,2045.87,18.1327,501.242 -1597,2066.74,18.3842,494.16 -1598,2058.82,16.9471,479.015 -1599,2053.88,16.0528,470.96 -1600,2049.33,15.6362,462.703 -1601,2033.49,16.6626,484.589 -1602,2041.86,15.4354,458.281 -1603,2064.01,17.0071,484.913 -1604,2051.26,15.1773,451.621 -1605,2043.32,16.8966,469.773 -1606,2041.16,15.479,435.546 -1607,2074.08,16.8365,484.703 -1608,2050.67,15.5335,460.234 -1609,2022.02,17.4504,493.195 -1610,2056.75,15.654,463.193 -1611,2042.53,16.8293,489.038 -1612,2046.64,14.6193,437.098 -1613,2057.69,16.829,489.158 -1614,2034.35,15.653,462.448 -1615,2043.7,16.7284,478.064 -1616,2056.13,15.7507,475.569 -1617,2040.12,19.2559,546.851 -1618,2036.82,16.1295,481.796 -1619,2035.72,17.8182,520.038 -1620,2038.76,15.7041,469.048 -1621,2052.54,17.1357,505.424 -1622,2049.62,18.2342,499.166 -1623,2029.33,17.3782,512.958 -1624,2053.55,16.8671,490.887 -1625,2047.34,17.9677,520.216 -1626,2043.48,18.0161,509.907 -1627,2041.82,18.6575,526.712 -1628,2057.33,15.8792,460.259 -1629,2058.03,19.2028,532.256 -1630,2039.66,16.1663,478.056 -1631,2034.77,18.4288,521.188 -1632,2042.13,19.7281,571.768 -1633,2058.3,17.489,484.518 -1634,2045.63,19.675,561.394 -1635,2046.65,17.8789,492.131 -1636,2059.83,19.4453,568.925 -1637,2050.34,17.4995,470.397 -1638,2042.44,20.4003,571.79 -1639,2036.99,15.6966,441.86 -1640,2047.68,20.02,566.207 -1641,2066.96,17.914,488.029 -1642,2042.9,18.5132,548.606 -1643,2045.41,17.7616,485.477 -1644,2053.52,18.4397,530.497 -1645,2049.19,18.3674,488.162 -1646,2057.46,19.2876,546.817 -1647,2056.29,17.9134,483.152 -1648,2043.87,18.7064,531.502 -1649,2042.43,19.1054,541.946 -1650,2058.51,17.3419,520.968 -1651,2031.35,19.1573,543.247 -1652,2027.02,19.5801,537.652 -1653,2043.14,19.1469,537.507 -1654,2043.24,17.0132,502.101 -1655,2053.44,18.4925,529.225 -1656,2050.45,19.1734,544.854 -1657,2051.92,18.4797,539.975 -1658,2047.19,18.9987,545.982 -1659,2069.35,17.7174,525.024 -1660,2053.78,18.1456,525.023 -1661,2056.32,18.5626,537.284 -1662,2047.48,18.7546,535.892 -1663,2036.96,17.5576,515.67 -1664,2060.36,18.5233,536.051 -1665,2058.54,19.1342,534.231 -1666,2042.99,18.2854,522.799 -1667,2046.68,17.7585,484.893 -1668,2037.42,19.0157,539.851 -1669,2043.97,19.4308,526.462 -1670,2053.78,18.3175,491.179 -1671,2050.28,17.1122,428.373 -1672,2041.41,18.3607,533.738 -1673,2057.42,19.1674,524.621 -1674,2050.82,19.0799,542.54 -1675,2051.54,17.5302,508.099 -1676,2051.81,18.2946,520.348 -1677,2040.64,17.9819,502.41 -1678,2051.16,18.5267,512.077 -1679,2047,17.3912,488.817 -1680,2045.45,17.6281,509.614 -1681,2040.07,19.8516,554.526 -1682,2044.25,18.2986,516.645 -1683,2042.02,19.8013,548.038 -1684,2054.46,17.9496,509.797 -1685,2051.37,19.2644,508.011 -1686,2070.9,18.1166,515.753 -1687,2047.28,19.0614,502.808 -1688,2043.55,18.4988,522.813 -1689,2038.15,19.737,549.337 -1690,2040.07,17.9929,509.4 -1691,2029.01,17.0223,499.587 -1692,2049.12,17.8083,504.14 -1693,2042.81,19.5834,530.824 -1694,2061.53,18.0793,503.392 -1695,2045.07,17.3114,505.243 -1696,2044.79,16.456,462.265 -1697,2043.08,18.6368,538.271 -1698,2030.79,16.6498,470.408 -1699,2046.7,18.3906,530.469 -1700,2043.31,16.2793,435.246 -1701,2054.07,18.327,522.856 -1702,2048.54,16.3383,421.385 -1703,2040.16,18.2561,523.619 -1704,2036.08,15.9298,452.698 -1705,2058.14,18.467,533.547 -1706,2061.86,16.3377,462.627 -1707,2049.11,18.8503,541.278 -1708,2050.41,16.4591,458.459 -1709,2057.52,18.3421,521.839 -1710,2043.92,15.4848,435.679 -1711,2060.11,18.2254,526.887 -1712,2038.87,18.2684,527.892 -1713,2038.8,16.2256,458.685 -1714,2048.03,18.8408,542.346 -1715,2028.66,15.9197,451.776 -1716,2060.58,18.1875,521.183 -1717,2033.22,16.0591,444.389 -1718,2043.7,18.0327,510.498 -1719,2046.68,17.2355,463.796 -1720,2063.97,19.0243,531.717 -1721,2039.21,19.2007,510.568 -1722,2037.31,18.9573,534.533 -1723,2034.43,18.0212,486.03 -1724,2053.47,19.5335,540.914 -1725,2051.43,19.5618,515.622 -1726,2068.05,19.2769,539.976 -1727,2051.98,18.3315,466.046 -1728,2043.68,16.98,488.372 -1729,2042.68,19.3296,545.531 -1730,2048.1,17.2424,489.349 -1731,2044.88,18.5488,541.813 -1732,2059.44,18.0657,498.562 -1733,2041.73,17.811,524.01 -1734,2052.63,17.7314,494.226 -1735,2046.67,18.6027,529.016 -1736,2047.4,17.8473,502.69 -1737,2054.97,20.0147,573.149 -1738,2051.01,17.1717,491.116 -1739,2040.71,20.7103,575.446 -1740,2037.65,17.6884,492.151 -1741,2058.84,20.4855,571.241 -1742,2043.7,17.304,485.057 -1743,2043.69,21.4346,591.332 -1744,2059.61,18.4501,580.393 -1745,2047.13,17.0101,488.842 -1746,2044.85,18.9967,638.283 -1747,2048.19,16.2776,480.183 -1748,2036.65,18.6719,560.218 -1749,2063,16.2661,473.45 -1750,2039.72,18.137,525.899 -1751,2061.7,18.805,504.696 -1752,2041.93,18.4511,535.409 -1753,2046.18,18.0384,499.007 -1754,2036.95,18.0591,514.865 -1755,2053.75,17.9304,507.011 -1756,2035.05,18.7909,526.37 -1757,2055.42,17.7264,498.033 -1758,2056.52,19.2528,533.462 -1759,2048.95,17.8764,492.076 -1760,2062.65,18.8953,525.499 -1761,2041.1,15.4557,454.415 -1762,2053.65,18.8349,528.817 -1763,2044.92,15.5263,455.677 -1764,2046.39,17.5052,486.345 -1765,2043.22,15.6312,444.606 -1766,2040.42,17.9791,511.372 -1767,2060.87,17.4556,475.962 -1768,2045.57,18.8502,530.421 -1769,2062.09,17.1507,486.939 -1770,2052.27,19.5733,552.218 -1771,2059.26,17.0383,488.516 -1772,2041.04,18.1955,509.011 -1773,2063.26,16.8579,468.307 -1774,2056.67,18.0785,513.985 -1775,2033.42,16.4167,464.747 -1776,2045.78,15.4995,440.165 -1777,2055.43,17.8238,499.321 -1778,2044.97,13.9539,415.661 -1779,2053.16,16.7438,494.211 -1780,2037.91,14.1499,411.681 -1781,2031.81,16.0005,467.641 -1782,2036.9,14.5831,420.852 -1783,2041.86,17.1096,480.899 -1784,2055.08,14.4205,447.577 -1785,2055.97,18.0518,505.767 -1786,2058.06,14.319,433.146 -1787,2035.82,18.3961,514.527 -1788,2040.11,14.4021,416.675 -1789,2041.54,18.3144,507.98 -1790,2045.12,14.6829,429.245 -1791,2067.24,17.2822,494.901 -1792,2049.01,19.1077,604.224 -1793,2049.12,15.9447,454.997 -1794,2048.9,18.8317,559.377 -1795,2052.48,15.8251,442.177 -1796,2030.2,19.0398,559.167 -1797,2069.75,15.9882,449.524 -1798,2046.89,18.4263,500.254 -1799,2041.94,15.8129,383.34 -1800,2044.3,18.5138,561.604 -1801,2054.61,15.9122,457.692 -1802,2060.59,19.0766,567.777 -1803,2042.97,16.5931,467.809 -1804,2060.56,18.6922,526.516 -1805,2055.09,15.8071,444.2 -1806,2046.23,18.0127,493.284 -1807,2050.67,15.7135,430.531 -1808,2054.47,17.6233,522.446 -1809,2044.04,18.3661,522.203 -1810,2039.01,17.5228,518.062 -1811,2047.94,17.9138,509.887 -1812,2043.24,17.8808,514.143 -1813,2038.27,17.7305,496.641 -1814,2041.58,18.8173,513.226 -1815,2060.26,17.8912,479.804 -1816,2045.17,18.9622,544.631 -1817,2055.41,18.8037,539.698 -1818,2051.61,18.7333,540.67 -1819,2054.57,18.8557,530.445 -1820,2046.43,19.4096,544.098 -1821,2071.69,18.9141,538.035 -1822,2053.52,18.1957,518.802 -1823,2036.99,17.9206,500.173 -1824,2038.16,18.0274,552.288 -1825,2048.8,18.3782,529.973 -1826,2044.73,18.1337,545.638 -1827,2054.71,17.5146,514.266 -1828,2035.22,17.8282,491.884 -1829,2056.7,18.1418,503.898 -1830,2049.58,17.0206,494.255 -1831,2048.42,17.607,497.403 -1832,2039.92,16.0077,494.569 -1833,2052.44,18.944,568.338 -1834,2053.09,18.0517,557.445 -1835,2040.66,18.9606,541.853 -1836,2042.87,17.009,485.885 -1837,2045.37,18.027,518.015 -1838,2043.98,16.5283,470.604 -1839,2049.97,17.2212,501.941 -1840,2052.69,17.195,523.003 -1841,2048.89,18.502,571.144 -1842,2051.32,16.414,470.862 -1843,2035.92,18.2961,543.791 -1844,2037.84,16.6491,464.196 -1845,2049.54,19.163,545.224 -1846,2032.05,16.7824,458.099 -1847,2049.7,18.7222,535.018 -1848,2059.42,16.4096,467.476 -1849,2047.45,17.5496,520.781 -1850,2061.17,16.2882,475.92 -1851,2033.99,18.7794,540.559 -1852,2046.32,17.1356,477.259 -1853,2055.27,17.4364,506.677 -1854,2053.88,16.687,460.207 -1855,2037.45,18.9114,527.954 -1856,2055,18.7475,554.868 -1857,2034.97,17.5544,510.101 -1858,2048.2,19.4276,582.595 -1859,2043.46,17.6586,525.509 -1860,2063.37,18.9642,548.503 -1861,2053.73,18.4093,517.595 -1862,2059.04,19.4502,555.304 -1863,2052.41,18.062,511.283 -1864,2042.72,19.4067,549.81 -1865,2052.45,17.9354,528.752 -1866,2043.47,18.3999,543.59 -1867,2035.72,18.3682,534.428 -1868,2059.89,18.2939,526.784 -1869,2038.12,17.9999,518.686 -1870,2041.83,19.1742,536.329 -1871,2057.23,18.047,512.115 -1872,2029.33,16.8481,504.549 -1873,2061.09,15.3754,445.999 -1874,2057.16,16.3677,488.472 -1875,2035.92,15.3999,445.161 -1876,2053.83,17.0256,493.028 -1877,2057.06,15.4611,443.979 -1878,2049.73,16.6759,488.666 -1879,2053.45,14.6072,427.72 -1880,2056.25,18.4546,530.806 -1881,2052.64,15.5347,456.562 -1882,2046.79,18.2798,528.213 -1883,2049.42,15.4557,452.831 -1884,2039.25,18.5641,529.391 -1885,2050.61,14.4472,424.69 -1886,2063.44,18.8581,534.658 -1887,2047.64,15.4919,442.828 -1888,2044.58,17.1212,496.031 -1889,2033.08,18.8391,542.02 -1890,2057.15,17.4191,511.933 -1891,2031.75,18.4932,533.024 -1892,2036.98,17.309,496.093 -1893,2032.65,17.8386,497.206 -1894,2038.97,18.4506,523.416 -1895,2050.83,18.8911,546.857 -1896,2043.98,19.3386,535.266 -1897,2055.11,18.2596,539.794 -1898,2062.58,20.0306,561.773 -1899,2053.89,18.6353,550.072 -1900,2054.47,17.9506,532.184 -1901,2060.07,18.7224,539.609 -1902,2048.71,19.3794,532.471 -1903,2050.89,18.2688,528.452 -1904,2038.57,19.2051,540.818 -1905,2045.03,17.6812,505.024 -1906,2052.5,20.0139,558.519 -1907,2037.24,17.2052,494.932 -1908,2030.19,19.0312,539.81 -1909,2047.78,17.3007,495.849 -1910,2048.07,19.1616,535.271 -1911,2036.85,16.5505,479.091 -1912,2031.46,19.0584,533.742 -1913,2038.46,16.5956,482.677 -1914,2028.49,19.1325,550.921 -1915,2052.64,16.7251,494.334 -1916,2039.76,19.9223,547.295 -1917,2053.97,16.8545,485.551 -1918,2047.67,19.4587,547.88 -1919,2053.1,16.8495,490.571 -1920,2035.14,17.953,520.68 -1921,2044.1,17.0948,500.069 -1922,2040.85,18.1929,519.693 -1923,2035.7,16.9938,467.791 -1924,2055.82,17.7806,513.833 -1925,2057.91,17.1361,475.608 -1926,2041.81,17.1375,435.026 -1927,2050.3,18.7674,457.905 -1928,2029.48,15.9972,487.481 -1929,2050.07,17.92,512.524 -1930,2075.92,17.6453,513.056 -1931,2050.33,17.3128,508.523 -1932,2045.41,17.7477,479.77 -1933,2047.91,18.9264,503.928 -1934,2052.9,17.6111,506.723 -1935,2049.05,17.3543,478.156 -1936,2048.27,14.5418,455.009 -1937,2049.85,15.3985,469.609 -1938,2043.49,16.4077,493.397 -1939,2047.68,15.6829,481.244 -1940,2051.53,16.6347,469.791 -1941,2040.5,17.1197,475.171 -1942,2038.94,16.3672,467.528 -1943,2059.19,15.4289,456.866 -1944,2039.2,18.0406,607.477 -1945,2046.8,15.5853,474.301 -1946,2028.59,17.3819,574.333 -1947,2060.54,17.2734,501.804 -1948,2036.91,16.9405,521.511 -1949,2054.27,16.0947,471.514 -1950,2039.71,16.541,474.505 -1951,2065.61,14.9479,426.055 -1952,2048.86,15.5621,470.249 -1953,2040.75,20.9868,599.578 -1954,2048.31,15.7698,480.545 -1955,2044.96,20.7361,590.686 -1956,2043.69,14.8307,408.151 -1957,2053.17,20.1469,559.65 -1958,2030.18,15.7856,441.889 -1959,2059.41,19.9183,565.456 -1960,2035.76,16.2802,487.324 -1961,2045.05,19.9111,610.155 -1962,2056.49,16.6761,500.602 -1963,2056.57,21.2527,617.619 -1964,2039.23,16.3092,464.668 -1965,2043.6,20.4441,583.566 -1966,2062.26,15.9535,448.702 -1967,2044.13,20.8501,598.439 -1968,2040.45,16.4449,514.792 -1969,2057.88,17.5118,505.22 -1970,2043.12,15.5062,473.737 -1971,2053.61,16.8592,486.926 -1972,2046.31,16.3602,487.95 -1973,2044.75,16.087,461.727 -1974,2053.81,16.5443,478.646 -1975,2031.12,16.9786,464.599 -1976,2032.44,17.133,526.971 -1977,2052.04,17.6436,521.129 -1978,2040.51,17.4679,510.28 -1979,2045.63,17.3094,478.321 -1980,2043.57,16.8363,487.365 -1981,2036.68,16.8811,464.842 -1982,2032.04,17.3884,492.85 -1983,2042.09,16.9554,461.119 -1984,2051.23,17.4001,513.065 -1985,2038.57,17.0335,499.367 -1986,2038.48,18.0108,519.554 -1987,2029.23,17.4182,502.802 -1988,2032.04,18.0705,512.254 -1989,2049.5,16.7335,483.46 -1990,2044.36,17.0029,494.584 -1991,2037.36,17.986,507.251 -1992,2034.2,18.0669,517.99 -1993,2034.06,17.2482,500.37 -1994,2047.32,17.1973,513.959 -1995,2030.49,17.4069,511.461 -1996,2025.88,17.2651,507.278 -1997,2055.38,17.678,500.225 -1998,2049.54,17.2502,500.633 -1999,2037.14,17.373,499.283 -2000,2052.32,15.2058,456.462 -2001,2056.54,19.4121,555.155 -2002,2052.5,15.4887,468.134 -2003,2031.81,19.2773,549.625 -2004,2041.63,14.9182,440.177 -2005,2054.99,18.7893,526.852 -2006,2043.82,15.1541,448.766 -2007,2046.98,19.4611,546.728 -2008,2046.05,15.2975,456.838 -2009,2063.17,17.6113,516.842 -2010,2043.04,16.1395,471.552 -2011,2065.59,17.8877,535.091 -2012,2047.4,15.5958,457.147 -2013,2048.2,18.9875,527.218 -2014,2052.19,16.4321,469.217 -2015,2054.57,17.7289,521.547 -2016,2047.56,17.4463,518.849 -2017,2054.71,18.1238,528.398 -2018,2036.96,16.9122,519.554 -2019,2046.13,17.3315,501.046 -2020,2052.79,16.3381,495.668 -2021,2060.05,18.6889,550.563 -2022,2037.74,16.5749,494.434 -2023,2044.72,17.1375,515.542 -2024,2041.29,16.5371,504.158 -2025,2066.2,17.4746,503.88 -2026,2039.19,16.7512,515.237 -2027,2042.9,17.1811,496.074 -2028,2044.41,16.686,493.843 -2029,2041.87,17.6843,498.184 -2030,2042.43,16.6899,498.223 -2031,2051.88,17.2653,492.635 -2032,2044.28,17.7274,506.051 -2033,2039.18,17.7931,530.741 -2034,2051.7,16.3038,485.204 -2035,2035.54,17.8556,525.396 -2036,2031.2,16.2605,484.038 -2037,2055.13,17.9519,505.572 -2038,2051.25,16.6791,492.666 -2039,2049.34,17.2399,492.183 -2040,2047.07,18.2007,513.968 -2041,2047.16,17.0336,503.513 -2042,2038.13,17.6111,508.201 -2043,2041.51,17.2915,507.58 -2044,2053.42,16.2001,482.936 -2045,2057.08,17.6835,499.846 -2046,2043.41,16.659,494.299 -2047,2048.97,17.3077,503.157 -TABLE CRVTime -#channel,timeOffset -0,0 -1,-25.7385 -2,0 -3,-25.7385 -4,0 -5,-25.7385 -6,0 -7,-25.7385 -8,0 -9,-25.7385 -10,0 -11,-25.7385 -12,0 -13,-25.7385 -14,0 -15,-25.7385 -16,0 -17,-25.7385 -18,0 -19,-25.7385 -20,0 -21,-25.7385 -22,0 -23,-25.7385 -24,0 -25,-25.7385 -26,0 -27,-25.7385 -28,0 -29,-25.7385 -30,0 -31,-25.7385 -32,-0.0736953 -33,-26.0914 -34,-0.0736953 -35,-26.0914 -36,-0.0736953 -37,-26.0914 -38,-0.0736953 -39,-26.0914 -40,-0.0736953 -41,-26.0914 -42,-0.0736953 -43,-26.0914 -44,-0.0736953 -45,-26.0914 -46,-0.0736953 -47,-26.0914 -48,-0.0736953 -49,-26.0914 -50,-0.0736953 -51,-26.0914 -52,-0.0736953 -53,-26.0914 -54,-0.0736953 -55,-26.0914 -56,-0.0736953 -57,-26.0914 -58,-0.0736953 -59,-26.0914 -60,-0.0736953 -61,-26.0914 -62,-0.0736953 -63,-26.0914 -64,-1.08007 -65,-26.4429 -66,-1.08007 -67,-26.4429 -68,-1.08007 -69,-26.4429 -70,-1.08007 -71,-26.4429 -72,-1.08007 -73,-26.4429 -74,-1.08007 -75,-26.4429 -76,-1.08007 -77,-26.4429 -78,-1.08007 -79,-26.4429 -80,-1.08007 -81,-26.4429 -82,-1.08007 -83,-26.4429 -84,-1.08007 -85,-26.4429 -86,-1.08007 -87,-26.4429 -88,-1.08007 -89,-26.4429 -90,-1.08007 -91,-26.4429 -92,-1.08007 -93,-26.4429 -94,-1.08007 -95,-26.4429 -96,-1.73141 -97,-27.9203 -98,-1.73141 -99,-27.9203 -100,-1.73141 -101,-27.9203 -102,-1.73141 -103,-27.9203 -104,-1.73141 -105,-27.9203 -106,-1.73141 -107,-27.9203 -108,-1.73141 -109,-27.9203 -110,-1.73141 -111,-27.9203 -112,-1.73141 -113,-27.9203 -114,-1.73141 -115,-27.9203 -116,-1.73141 -117,-27.9203 -118,-1.73141 -119,-27.9203 -120,-1.73141 -121,-27.9203 -122,-1.73141 -123,-27.9203 -124,-1.73141 -125,-27.9203 -126,-1.73141 -127,-27.9203 -128,-1.91942 -129,-25.0117 -130,-1.91942 -131,-25.0117 -132,-1.91942 -133,-25.0117 -134,-1.91942 -135,-25.0117 -136,-1.91942 -137,-25.0117 -138,-1.91942 -139,-25.0117 -140,-1.91942 -141,-25.0117 -142,-1.91942 -143,-25.0117 -144,-1.91942 -145,-25.0117 -146,-1.91942 -147,-25.0117 -148,-1.91942 -149,-25.0117 -150,-1.91942 -151,-25.0117 -152,-1.91942 -153,-25.0117 -154,-1.91942 -155,-25.0117 -156,-1.91942 -157,-25.0117 -158,-1.91942 -159,-25.0117 -160,-1.81682 -161,-25.7646 -162,-1.81682 -163,-25.7646 -164,-1.81682 -165,-25.7646 -166,-1.81682 -167,-25.7646 -168,-1.81682 -169,-25.7646 -170,-1.81682 -171,-25.7646 -172,-1.81682 -173,-25.7646 -174,-1.81682 -175,-25.7646 -176,-1.81682 -177,-25.7646 -178,-1.81682 -179,-25.7646 -180,-1.81682 -181,-25.7646 -182,-1.81682 -183,-25.7646 -184,-1.81682 -185,-25.7646 -186,-1.81682 -187,-25.7646 -188,-1.81682 -189,-25.7646 -190,-1.81682 -191,-25.7646 -192,-7.48413 -193,-25.9679 -194,-7.48413 -195,-25.9679 -196,-7.48413 -197,-25.9679 -198,-7.48413 -199,-25.9679 -200,-7.48413 -201,-25.9679 -202,-7.48413 -203,-25.9679 -204,-7.48413 -205,-25.9679 -206,-7.48413 -207,-25.9679 -208,-7.48413 -209,-25.9679 -210,-7.48413 -211,-25.9679 -212,-7.48413 -213,-25.9679 -214,-7.48413 -215,-25.9679 -216,-7.48413 -217,-25.9679 -218,-7.48413 -219,-25.9679 -220,-7.48413 -221,-25.9679 -222,-7.48413 -223,-25.9679 -224,-2.71664 -225,-26.8578 -226,-2.71664 -227,-26.8578 -228,-2.71664 -229,-26.8578 -230,-2.71664 -231,-26.8578 -232,-2.71664 -233,-26.8578 -234,-2.71664 -235,-26.8578 -236,-2.71664 -237,-26.8578 -238,-2.71664 -239,-26.8578 -240,-2.71664 -241,-26.8578 -242,-2.71664 -243,-26.8578 -244,-2.71664 -245,-26.8578 -246,-2.71664 -247,-26.8578 -248,-2.71664 -249,-26.8578 -250,-2.71664 -251,-26.8578 -252,-2.71664 -253,-26.8578 -254,-2.71664 -255,-26.8578 -256,-110.29 -257,-27.5495 -258,-110.29 -259,-27.5495 -260,-110.29 -261,-27.5495 -262,-110.29 -263,-27.5495 -264,-110.29 -265,-27.5495 -266,-110.29 -267,-27.5495 -268,-110.29 -269,-27.5495 -270,-110.29 -271,-27.5495 -272,-110.29 -273,-27.5495 -274,-110.29 -275,-27.5495 -276,-110.29 -277,-27.5495 -278,-110.29 -279,-27.5495 -280,-110.29 -281,-27.5495 -282,-110.29 -283,-27.5495 -284,-110.29 -285,-27.5495 -286,-110.29 -287,-27.5495 -288,-110.378 -289,-27.2442 -290,-110.378 -291,-27.2442 -292,-110.378 -293,-27.2442 -294,-110.378 -295,-27.2442 -296,-110.378 -297,-27.2442 -298,-110.378 -299,-27.2442 -300,-110.378 -301,-27.2442 -302,-110.378 -303,-27.2442 -304,-110.378 -305,-27.2442 -306,-110.378 -307,-27.2442 -308,-110.378 -309,-27.2442 -310,-110.378 -311,-27.2442 -312,-110.378 -313,-27.2442 -314,-110.378 -315,-27.2442 -316,-110.378 -317,-27.2442 -318,-110.378 -319,-27.2442 -320,-111.322 -321,-27.8841 -322,-111.322 -323,-27.8841 -324,-111.322 -325,-27.8841 -326,-111.322 -327,-27.8841 -328,-111.322 -329,-27.8841 -330,-111.322 -331,-27.8841 -332,-111.322 -333,-27.8841 -334,-111.322 -335,-27.8841 -336,-111.322 -337,-27.8841 -338,-111.322 -339,-27.8841 -340,-111.322 -341,-27.8841 -342,-111.322 -343,-27.8841 -344,-111.322 -345,-27.8841 -346,-111.322 -347,-27.8841 -348,-111.322 -349,-27.8841 -350,-111.322 -351,-27.8841 -352,-111.77 -353,-28.7986 -354,-111.77 -355,-28.7986 -356,-111.77 -357,-28.7986 -358,-111.77 -359,-28.7986 -360,-111.77 -361,-28.7986 -362,-111.77 -363,-28.7986 -364,-111.77 -365,-28.7986 -366,-111.77 -367,-28.7986 -368,-111.77 -369,-28.7986 -370,-111.77 -371,-28.7986 -372,-111.77 -373,-28.7986 -374,-111.77 -375,-28.7986 -376,-111.77 -377,-28.7986 -378,-111.77 -379,-28.7986 -380,-111.77 -381,-28.7986 -382,-111.77 -383,-28.7986 -384,0.859676 -385,-27.4195 -386,0.859676 -387,-27.4195 -388,0.859676 -389,-27.4195 -390,0.859676 -391,-27.4195 -392,0.859676 -393,-27.4195 -394,0.859676 -395,-27.4195 -396,0.859676 -397,-27.4195 -398,0.859676 -399,-27.4195 -400,0.859676 -401,-27.4195 -402,0.859676 -403,-27.4195 -404,0.859676 -405,-27.4195 -406,0.859676 -407,-27.4195 -408,0.859676 -409,-27.4195 -410,0.859676 -411,-27.4195 -412,0.859676 -413,-27.4195 -414,0.859676 -415,-27.4195 -416,0.307585 -417,-28.3016 -418,0.307585 -419,-28.3016 -420,0.307585 -421,-28.3016 -422,0.307585 -423,-28.3016 -424,0.307585 -425,-28.3016 -426,0.307585 -427,-28.3016 -428,0.307585 -429,-28.3016 -430,0.307585 -431,-28.3016 -432,0.307585 -433,-28.3016 -434,0.307585 -435,-28.3016 -436,0.307585 -437,-28.3016 -438,0.307585 -439,-28.3016 -440,0.307585 -441,-28.3016 -442,0.307585 -443,-28.3016 -444,0.307585 -445,-28.3016 -446,0.307585 -447,-28.3016 -448,-0.903498 -449,-28.254 -450,-0.903498 -451,-28.254 -452,-0.903498 -453,-28.254 -454,-0.903498 -455,-28.254 -456,-0.903498 -457,-28.254 -458,-0.903498 -459,-28.254 -460,-0.903498 -461,-28.254 -462,-0.903498 -463,-28.254 -464,-0.903498 -465,-28.254 -466,-0.903498 -467,-28.254 -468,-0.903498 -469,-28.254 -470,-0.903498 -471,-28.254 -472,-0.903498 -473,-28.254 -474,-0.903498 -475,-28.254 -476,-0.903498 -477,-28.254 -478,-0.903498 -479,-28.254 -480,-1.25415 -481,-29.2265 -482,-1.25415 -483,-29.2265 -484,-1.25415 -485,-29.2265 -486,-1.25415 -487,-29.2265 -488,-1.25415 -489,-29.2265 -490,-1.25415 -491,-29.2265 -492,-1.25415 -493,-29.2265 -494,-1.25415 -495,-29.2265 -496,-1.25415 -497,-29.2265 -498,-1.25415 -499,-29.2265 -500,-1.25415 -501,-29.2265 -502,-1.25415 -503,-29.2265 -504,-1.25415 -505,-29.2265 -506,-1.25415 -507,-29.2265 -508,-1.25415 -509,-29.2265 -510,-1.25415 -511,-29.2265 -512,-11.5618 -513,-35.9992 -514,-11.5618 -515,-35.9992 -516,-11.5618 -517,-35.9992 -518,-11.5618 -519,-35.9992 -520,-11.5618 -521,-35.9992 -522,-11.5618 -523,-35.9992 -524,-11.5618 -525,-35.9992 -526,-11.5618 -527,-35.9992 -528,-11.5618 -529,-35.9992 -530,-11.5618 -531,-35.9992 -532,-11.5618 -533,-35.9992 -534,-11.5618 -535,-35.9992 -536,-11.5618 -537,-35.9992 -538,-11.5618 -539,-35.9992 -540,-11.5618 -541,-35.9992 -542,-11.5618 -543,-35.9992 -544,-11.5959 -545,-36.1518 -546,-11.5959 -547,-36.1518 -548,-11.5959 -549,-36.1518 -550,-11.5959 -551,-36.1518 -552,-11.5959 -553,-36.1518 -554,-11.5959 -555,-36.1518 -556,-11.5959 -557,-36.1518 -558,-11.5959 -559,-36.1518 -560,-11.5959 -561,-36.1518 -562,-11.5959 -563,-36.1518 -564,-11.5959 -565,-36.1518 -566,-11.5959 -567,-36.1518 -568,-11.5959 -569,-36.1518 -570,-11.5959 -571,-36.1518 -572,-11.5959 -573,-36.1518 -574,-11.5959 -575,-36.1518 -576,-12.1331 -577,-36.8342 -578,-12.1331 -579,-36.8342 -580,-12.1331 -581,-36.8342 -582,-12.1331 -583,-36.8342 -584,-12.1331 -585,-36.8342 -586,-12.1331 -587,-36.8342 -588,-12.1331 -589,-36.8342 -590,-12.1331 -591,-36.8342 -592,-12.1331 -593,-36.8342 -594,-12.1331 -595,-36.8342 -596,-12.1331 -597,-36.8342 -598,-12.1331 -599,-36.8342 -600,-12.1331 -601,-36.8342 -602,-12.1331 -603,-36.8342 -604,-12.1331 -605,-36.8342 -606,-12.1331 -607,-36.8342 -608,-12.6312 -609,-37.2225 -610,-12.6312 -611,-37.2225 -612,-12.6312 -613,-37.2225 -614,-12.6312 -615,-37.2225 -616,-12.6312 -617,-37.2225 -618,-12.6312 -619,-37.2225 -620,-12.6312 -621,-37.2225 -622,-12.6312 -623,-37.2225 -624,-12.6312 -625,-37.2225 -626,-12.6312 -627,-37.2225 -628,-12.6312 -629,-37.2225 -630,-12.6312 -631,-37.2225 -632,-12.6312 -633,-37.2225 -634,-12.6312 -635,-37.2225 -636,-12.6312 -637,-37.2225 -638,-12.6312 -639,-37.2225 -640,-7.65627 -641,-34.8577 -642,-7.65627 -643,-34.8577 -644,-7.65627 -645,-34.8577 -646,-7.65627 -647,-34.8577 -648,-7.65627 -649,-34.8577 -650,-7.65627 -651,-34.8577 -652,-7.65627 -653,-34.8577 -654,-7.65627 -655,-34.8577 -656,-7.65627 -657,-34.8577 -658,-7.65627 -659,-34.8577 -660,-7.65627 -661,-34.8577 -662,-7.65627 -663,-34.8577 -664,-7.65627 -665,-34.8577 -666,-7.65627 -667,-34.8577 -668,-7.65627 -669,-34.8577 -670,-7.65627 -671,-34.8577 -672,-8.9539 -673,-35.6287 -674,-8.9539 -675,-35.6287 -676,-8.9539 -677,-35.6287 -678,-8.9539 -679,-35.6287 -680,-8.9539 -681,-35.6287 -682,-8.9539 -683,-35.6287 -684,-8.9539 -685,-35.6287 -686,-8.9539 -687,-35.6287 -688,-8.9539 -689,-35.6287 -690,-8.9539 -691,-35.6287 -692,-8.9539 -693,-35.6287 -694,-8.9539 -695,-35.6287 -696,-8.9539 -697,-35.6287 -698,-8.9539 -699,-35.6287 -700,-8.9539 -701,-35.6287 -702,-8.9539 -703,-35.6287 -704,-8.59396 -705,-36.5347 -706,-8.59396 -707,-36.5347 -708,-8.59396 -709,-36.5347 -710,-8.59396 -711,-36.5347 -712,-8.59396 -713,-36.5347 -714,-8.59396 -715,-36.5347 -716,-8.59396 -717,-36.5347 -718,-8.59396 -719,-36.5347 -720,-8.59396 -721,-36.5347 -722,-8.59396 -723,-36.5347 -724,-8.59396 -725,-36.5347 -726,-8.59396 -727,-36.5347 -728,-8.59396 -729,-36.5347 -730,-8.59396 -731,-36.5347 -732,-8.59396 -733,-36.5347 -734,-8.59396 -735,-36.5347 -736,-9.72252 -737,-36.5938 -738,-9.72252 -739,-36.5938 -740,-9.72252 -741,-36.5938 -742,-9.72252 -743,-36.5938 -744,-9.72252 -745,-36.5938 -746,-9.72252 -747,-36.5938 -748,-9.72252 -749,-36.5938 -750,-9.72252 -751,-36.5938 -752,-9.72252 -753,-36.5938 -754,-9.72252 -755,-36.5938 -756,-9.72252 -757,-36.5938 -758,-9.72252 -759,-36.5938 -760,-9.72252 -761,-36.5938 -762,-9.72252 -763,-36.5938 -764,-9.72252 -765,-36.5938 -766,-9.72252 -767,-36.5938 -768,-8.38115 -769,-34.9249 -770,-8.38115 -771,-34.9249 -772,-8.38115 -773,-34.9249 -774,-8.38115 -775,-34.9249 -776,-8.38115 -777,-34.9249 -778,-8.38115 -779,-34.9249 -780,-8.38115 -781,-34.9249 -782,-8.38115 -783,-34.9249 -784,-8.38115 -785,-34.9249 -786,-8.38115 -787,-34.9249 -788,-8.38115 -789,-34.9249 -790,-8.38115 -791,-34.9249 -792,-8.38115 -793,-34.9249 -794,-8.38115 -795,-34.9249 -796,-8.38115 -797,-34.9249 -798,-8.38115 -799,-34.9249 -800,-9.18488 -801,-35.367 -802,-9.18488 -803,-35.367 -804,-9.18488 -805,-35.367 -806,-9.18488 -807,-35.367 -808,-9.18488 -809,-35.367 -810,-9.18488 -811,-35.367 -812,-9.18488 -813,-35.367 -814,-9.18488 -815,-35.367 -816,-9.18488 -817,-35.367 -818,-9.18488 -819,-35.367 -820,-9.18488 -821,-35.367 -822,-9.18488 -823,-35.367 -824,-9.18488 -825,-35.367 -826,-9.18488 -827,-35.367 -828,-9.18488 -829,-35.367 -830,-9.18488 -831,-35.367 -832,-8.97302 -833,-36.1733 -834,-8.97302 -835,-36.1733 -836,-8.97302 -837,-36.1733 -838,-8.97302 -839,-36.1733 -840,-8.97302 -841,-36.1733 -842,-8.97302 -843,-36.1733 -844,-8.97302 -845,-36.1733 -846,-8.97302 -847,-36.1733 -848,-8.97302 -849,-36.1733 -850,-8.97302 -851,-36.1733 -852,-8.97302 -853,-36.1733 -854,-8.97302 -855,-36.1733 -856,-8.97302 -857,-36.1733 -858,-8.97302 -859,-36.1733 -860,-8.97302 -861,-36.1733 -862,-8.97302 -863,-36.1733 -864,-9.92541 -865,-36.1389 -866,-9.92541 -867,-36.1389 -868,-9.92541 -869,-36.1389 -870,-9.92541 -871,-36.1389 -872,-9.92541 -873,-36.1389 -874,-9.92541 -875,-36.1389 -876,-9.92541 -877,-36.1389 -878,-9.92541 -879,-36.1389 -880,-9.92541 -881,-36.1389 -882,-9.92541 -883,-36.1389 -884,-9.92541 -885,-36.1389 -886,-9.92541 -887,-36.1389 -888,-9.92541 -889,-36.1389 -890,-9.92541 -891,-36.1389 -892,-9.92541 -893,-36.1389 -894,-9.92541 -895,-36.1389 -896,-9.62013 -897,-35.3906 -898,-9.62013 -899,-35.3906 -900,-9.62013 -901,-35.3906 -902,-9.62013 -903,-35.3906 -904,-9.62013 -905,-35.3906 -906,-9.62013 -907,-35.3906 -908,-9.62013 -909,-35.3906 -910,-9.62013 -911,-35.3906 -912,-9.62013 -913,-35.3906 -914,-9.62013 -915,-35.3906 -916,-9.62013 -917,-35.3906 -918,-9.62013 -919,-35.3906 -920,-9.62013 -921,-35.3906 -922,-9.62013 -923,-35.3906 -924,-9.62013 -925,-35.3906 -926,-9.62013 -927,-35.3906 -928,-10.1141 -929,-35.4659 -930,-10.1141 -931,-35.4659 -932,-10.1141 -933,-35.4659 -934,-10.1141 -935,-35.4659 -936,-10.1141 -937,-35.4659 -938,-10.1141 -939,-35.4659 -940,-10.1141 -941,-35.4659 -942,-10.1141 -943,-35.4659 -944,-10.1141 -945,-35.4659 -946,-10.1141 -947,-35.4659 -948,-10.1141 -949,-35.4659 -950,-10.1141 -951,-35.4659 -952,-10.1141 -953,-35.4659 -954,-10.1141 -955,-35.4659 -956,-10.1141 -957,-35.4659 -958,-10.1141 -959,-35.4659 -960,-10.9769 -961,-36.791 -962,-10.9769 -963,-36.791 -964,-10.9769 -965,-36.791 -966,-10.9769 -967,-36.791 -968,-10.9769 -969,-36.791 -970,-10.9769 -971,-36.791 -972,-10.9769 -973,-36.791 -974,-10.9769 -975,-36.791 -976,-10.9769 -977,-36.791 -978,-10.9769 -979,-36.791 -980,-10.9769 -981,-36.791 -982,-10.9769 -983,-36.791 -984,-10.9769 -985,-36.791 -986,-10.9769 -987,-36.791 -988,-10.9769 -989,-36.791 -990,-10.9769 -991,-36.791 -992,-11.1985 -993,-36.682 -994,-11.1985 -995,-36.682 -996,-11.1985 -997,-36.682 -998,-11.1985 -999,-36.682 -1000,-11.1985 -1001,-36.682 -1002,-11.1985 -1003,-36.682 -1004,-11.1985 -1005,-36.682 -1006,-11.1985 -1007,-36.682 -1008,-11.1985 -1009,-36.682 -1010,-11.1985 -1011,-36.682 -1012,-11.1985 -1013,-36.682 -1014,-11.1985 -1015,-36.682 -1016,-11.1985 -1017,-36.682 -1018,-11.1985 -1019,-36.682 -1020,-11.1985 -1021,-36.682 -1022,-11.1985 -1023,-36.682 -1024,0 -1025,-7.8 -1026,0 -1027,-7.8 -1028,0 -1029,-7.8 -1030,0 -1031,-7.8 -1032,0 -1033,-7.8 -1034,0 -1035,-7.8 -1036,0 -1037,-7.8 -1038,0 -1039,-7.8 -1040,0 -1041,-7.8 -1042,0 -1043,-7.8 -1044,0 -1045,-7.8 -1046,0 -1047,-7.8 -1048,0 -1049,-7.8 -1050,0 -1051,-7.8 -1052,0 -1053,-7.8 -1054,0 -1055,-7.8 -1056,0 -1057,-1.38305 -1058,0 -1059,-1.38305 -1060,0 -1061,-1.38305 -1062,0 -1063,-1.38305 -1064,0 -1065,-1.38305 -1066,0 -1067,-1.38305 -1068,0 -1069,-1.38305 -1070,0 -1071,-1.38305 -1072,0 -1073,-1.38305 -1074,0 -1075,-1.38305 -1076,0 -1077,-1.38305 -1078,0 -1079,-1.38305 -1080,0 -1081,-1.38305 -1082,0 -1083,-1.38305 -1084,0 -1085,-1.38305 -1086,0 -1087,-1.38305 -1088,0 -1089,-6.87076 -1090,0 -1091,-6.87076 -1092,0 -1093,-6.87076 -1094,0 -1095,-6.87076 -1096,0 -1097,-6.87076 -1098,0 -1099,-6.87076 -1100,0 -1101,-6.87076 -1102,0 -1103,-6.87076 -1104,0 -1105,-6.87076 -1106,0 -1107,-6.87076 -1108,0 -1109,-6.87076 -1110,0 -1111,-6.87076 -1112,0 -1113,-6.87076 -1114,0 -1115,-6.87076 -1116,0 -1117,-6.87076 -1118,0 -1119,-6.87076 -1120,0 -1121,-7.51252 -1122,0 -1123,-7.51252 -1124,0 -1125,-7.51252 -1126,0 -1127,-7.51252 -1128,0 -1129,-7.51252 -1130,0 -1131,-7.51252 -1132,0 -1133,-7.51252 -1134,0 -1135,-7.51252 -1136,0 -1137,-7.51252 -1138,0 -1139,-7.51252 -1140,0 -1141,-7.51252 -1142,0 -1143,-7.51252 -1144,0 -1145,-7.51252 -1146,0 -1147,-7.51252 -1148,0 -1149,-7.51252 -1150,0 -1151,-7.51252 -1152,0 -1153,-8.39475 -1154,0 -1155,-8.39475 -1156,0 -1157,-8.39475 -1158,0 -1159,-8.39475 -1160,0 -1161,-8.39475 -1162,0 -1163,-8.39475 -1164,0 -1165,-8.39475 -1166,0 -1167,-8.39475 -1168,0 -1169,-8.39475 -1170,0 -1171,-8.39475 -1172,0 -1173,-8.39475 -1174,0 -1175,-8.39475 -1176,0 -1177,-8.39475 -1178,0 -1179,-8.39475 -1180,0 -1181,-8.39475 -1182,0 -1183,-8.39475 -1184,0 -1185,-7.46913 -1186,0 -1187,-7.46913 -1188,0 -1189,-7.46913 -1190,0 -1191,-7.46913 -1192,0 -1193,-7.46913 -1194,0 -1195,-7.46913 -1196,0 -1197,-7.46913 -1198,0 -1199,-7.46913 -1200,0 -1201,-7.46913 -1202,0 -1203,-7.46913 -1204,0 -1205,-7.46913 -1206,0 -1207,-7.46913 -1208,0 -1209,-7.46913 -1210,0 -1211,-7.46913 -1212,0 -1213,-7.46913 -1214,0 -1215,-7.46913 -1216,0 -1217,-7.48525 -1218,0 -1219,-7.48525 -1220,0 -1221,-7.48525 -1222,0 -1223,-7.48525 -1224,0 -1225,-7.48525 -1226,0 -1227,-7.48525 -1228,0 -1229,-7.48525 -1230,0 -1231,-7.48525 -1232,0 -1233,-7.48525 -1234,0 -1235,-7.48525 -1236,0 -1237,-7.48525 -1238,0 -1239,-7.48525 -1240,0 -1241,-7.48525 -1242,0 -1243,-7.48525 -1244,0 -1245,-7.48525 -1246,0 -1247,-7.48525 -1248,0 -1249,-7.3202 -1250,0 -1251,-7.3202 -1252,0 -1253,-7.3202 -1254,0 -1255,-7.3202 -1256,0 -1257,-7.3202 -1258,0 -1259,-7.3202 -1260,0 -1261,-7.3202 -1262,0 -1263,-7.3202 -1264,0 -1265,-7.3202 -1266,0 -1267,-7.3202 -1268,0 -1269,-7.3202 -1270,0 -1271,-7.3202 -1272,0 -1273,-7.3202 -1274,0 -1275,-7.3202 -1276,0 -1277,-7.3202 -1278,0 -1279,-7.3202 -1280,0 -1281,-3.41809 -1282,0 -1283,-3.41809 -1284,0 -1285,-3.41809 -1286,0 -1287,-3.41809 -1288,0 -1289,-3.41809 -1290,0 -1291,-3.41809 -1292,0 -1293,-3.41809 -1294,0 -1295,-3.41809 -1296,0 -1297,-3.41809 -1298,0 -1299,-3.41809 -1300,0 -1301,-3.41809 -1302,0 -1303,-3.41809 -1304,0 -1305,-3.41809 -1306,0 -1307,-3.41809 -1308,0 -1309,-3.41809 -1310,0 -1311,-3.41809 -1312,0 -1313,-10.3223 -1314,0 -1315,-10.3223 -1316,0 -1317,-10.3223 -1318,0 -1319,-10.3223 -1320,0 -1321,-10.3223 -1322,0 -1323,-10.3223 -1324,0 -1325,-10.3223 -1326,0 -1327,-10.3223 -1328,0 -1329,-10.3223 -1330,0 -1331,-10.3223 -1332,0 -1333,-10.3223 -1334,0 -1335,-10.3223 -1336,0 -1337,-10.3223 -1338,0 -1339,-10.3223 -1340,0 -1341,-10.3223 -1342,0 -1343,-10.3223 -1344,0 -1345,-9.80276 -1346,0 -1347,-9.80276 -1348,0 -1349,-9.80276 -1350,0 -1351,-9.80276 -1352,0 -1353,-9.80276 -1354,0 -1355,-9.80276 -1356,0 -1357,-9.80276 -1358,0 -1359,-9.80276 -1360,0 -1361,-9.80276 -1362,0 -1363,-9.80276 -1364,0 -1365,-9.80276 -1366,0 -1367,-9.80276 -1368,0 -1369,-9.80276 -1370,0 -1371,-9.80276 -1372,0 -1373,-9.80276 -1374,0 -1375,-9.80276 -1376,0 -1377,-9.00478 -1378,0 -1379,-9.00478 -1380,0 -1381,-9.00478 -1382,0 -1383,-9.00478 -1384,0 -1385,-9.00478 -1386,0 -1387,-9.00478 -1388,0 -1389,-9.00478 -1390,0 -1391,-9.00478 -1392,0 -1393,-9.00478 -1394,0 -1395,-9.00478 -1396,0 -1397,-9.00478 -1398,0 -1399,-9.00478 -1400,0 -1401,-9.00478 -1402,0 -1403,-9.00478 -1404,0 -1405,-9.00478 -1406,0 -1407,-9.00478 -1408,0 -1409,-3.28825 -1410,0 -1411,-3.28825 -1412,0 -1413,-3.28825 -1414,0 -1415,-3.28825 -1416,0 -1417,-3.28825 -1418,0 -1419,-3.28825 -1420,0 -1421,-3.28825 -1422,0 -1423,-3.28825 -1424,0 -1425,-3.28825 -1426,0 -1427,-3.28825 -1428,0 -1429,-3.28825 -1430,0 -1431,-3.28825 -1432,0 -1433,-3.28825 -1434,0 -1435,-3.28825 -1436,0 -1437,-3.28825 -1438,0 -1439,-3.28825 -1440,0 -1441,-4.11412 -1442,0 -1443,-4.11412 -1444,0 -1445,-4.11412 -1446,0 -1447,-4.11412 -1448,0 -1449,-4.11412 -1450,0 -1451,-4.11412 -1452,0 -1453,-4.11412 -1454,0 -1455,-4.11412 -1456,0 -1457,-4.11412 -1458,0 -1459,-4.11412 -1460,0 -1461,-4.11412 -1462,0 -1463,-4.11412 -1464,0 -1465,-4.11412 -1466,0 -1467,-4.11412 -1468,0 -1469,-4.11412 -1470,0 -1471,-4.11412 -1472,0 -1473,-7.54427 -1474,0 -1475,-7.54427 -1476,0 -1477,-7.54427 -1478,0 -1479,-7.54427 -1480,0 -1481,-7.54427 -1482,0 -1483,-7.54427 -1484,0 -1485,-7.54427 -1486,0 -1487,-7.54427 -1488,0 -1489,-7.54427 -1490,0 -1491,-7.54427 -1492,0 -1493,-7.54427 -1494,0 -1495,-7.54427 -1496,0 -1497,-7.54427 -1498,0 -1499,-7.54427 -1500,0 -1501,-7.54427 -1502,0 -1503,-7.54427 -1504,0 -1505,-7.00764 -1506,0 -1507,-7.00764 -1508,0 -1509,-7.00764 -1510,0 -1511,-7.00764 -1512,0 -1513,-7.00764 -1514,0 -1515,-7.00764 -1516,0 -1517,-7.00764 -1518,0 -1519,-7.00764 -1520,0 -1521,-7.00764 -1522,0 -1523,-7.00764 -1524,0 -1525,-7.00764 -1526,0 -1527,-7.00764 -1528,0 -1529,-7.00764 -1530,0 -1531,-7.00764 -1532,0 -1533,-7.00764 -1534,0 -1535,-7.00764 -1536,-112 -1537,-24.8543 -1538,-112 -1539,-24.8543 -1540,-112 -1541,-24.8543 -1542,-112 -1543,-24.8543 -1544,-112 -1545,-24.8543 -1546,-112 -1547,-24.8543 -1548,-112 -1549,-24.8543 -1550,-112 -1551,-24.8543 -1552,-112 -1553,-24.8543 -1554,-112 -1555,-24.8543 -1556,-112 -1557,-24.8543 -1558,-112 -1559,-24.8543 -1560,-112 -1561,-24.8543 -1562,-112 -1563,-24.8543 -1564,-112 -1565,-24.8543 -1566,-112 -1567,-24.8543 -1568,-112.164 -1569,-26.3348 -1570,-112.164 -1571,-26.3348 -1572,-112.164 -1573,-26.3348 -1574,-112.164 -1575,-26.3348 -1576,-112.164 -1577,-26.3348 -1578,-112.164 -1579,-26.3348 -1580,-112.164 -1581,-26.3348 -1582,-112.164 -1583,-26.3348 -1584,-112.164 -1585,-26.3348 -1586,-112.164 -1587,-26.3348 -1588,-112.164 -1589,-26.3348 -1590,-112.164 -1591,-26.3348 -1592,-112.164 -1593,-26.3348 -1594,-112.164 -1595,-26.3348 -1596,-112.164 -1597,-26.3348 -1598,-112.164 -1599,-26.3348 -1600,-113.283 -1601,-26.3046 -1602,-113.283 -1603,-26.3046 -1604,-113.283 -1605,-26.3046 -1606,-113.283 -1607,-26.3046 -1608,-113.283 -1609,-26.3046 -1610,-113.283 -1611,-26.3046 -1612,-113.283 -1613,-26.3046 -1614,-113.283 -1615,-26.3046 -1616,-113.283 -1617,-26.3046 -1618,-113.283 -1619,-26.3046 -1620,-113.283 -1621,-26.3046 -1622,-113.283 -1623,-26.3046 -1624,-113.283 -1625,-26.3046 -1626,-113.283 -1627,-26.3046 -1628,-113.283 -1629,-26.3046 -1630,-113.283 -1631,-26.3046 -1632,-112.659 -1633,-26.9387 -1634,-112.659 -1635,-26.9387 -1636,-112.659 -1637,-26.9387 -1638,-112.659 -1639,-26.9387 -1640,-112.659 -1641,-26.9387 -1642,-112.659 -1643,-26.9387 -1644,-112.659 -1645,-26.9387 -1646,-112.659 -1647,-26.9387 -1648,-112.659 -1649,-26.9387 -1650,-112.659 -1651,-26.9387 -1652,-112.659 -1653,-26.9387 -1654,-112.659 -1655,-26.9387 -1656,-112.659 -1657,-26.9387 -1658,-112.659 -1659,-26.9387 -1660,-112.659 -1661,-26.9387 -1662,-112.659 -1663,-26.9387 -1664,-110.912 -1665,-25.81 -1666,-110.912 -1667,-25.81 -1668,-110.912 -1669,-25.81 -1670,-110.912 -1671,-25.81 -1672,-110.912 -1673,-25.81 -1674,-110.912 -1675,-25.81 -1676,-110.912 -1677,-25.81 -1678,-110.912 -1679,-25.81 -1680,-110.912 -1681,-25.81 -1682,-110.912 -1683,-25.81 -1684,-110.912 -1685,-25.81 -1686,-110.912 -1687,-25.81 -1688,-110.912 -1689,-25.81 -1690,-110.912 -1691,-25.81 -1692,-110.912 -1693,-25.81 -1694,-110.912 -1695,-25.81 -1696,-112.207 -1697,-26.4228 -1698,-112.207 -1699,-26.4228 -1700,-112.207 -1701,-26.4228 -1702,-112.207 -1703,-26.4228 -1704,-112.207 -1705,-26.4228 -1706,-112.207 -1707,-26.4228 -1708,-112.207 -1709,-26.4228 -1710,-112.207 -1711,-26.4228 -1712,-112.207 -1713,-26.4228 -1714,-112.207 -1715,-26.4228 -1716,-112.207 -1717,-26.4228 -1718,-112.207 -1719,-26.4228 -1720,-112.207 -1721,-26.4228 -1722,-112.207 -1723,-26.4228 -1724,-112.207 -1725,-26.4228 -1726,-112.207 -1727,-26.4228 -1728,-112.745 -1729,-27.4024 -1730,-112.745 -1731,-27.4024 -1732,-112.745 -1733,-27.4024 -1734,-112.745 -1735,-27.4024 -1736,-112.745 -1737,-27.4024 -1738,-112.745 -1739,-27.4024 -1740,-112.745 -1741,-27.4024 -1742,-112.745 -1743,-27.4024 -1744,-112.745 -1745,-27.4024 -1746,-112.745 -1747,-27.4024 -1748,-112.745 -1749,-27.4024 -1750,-112.745 -1751,-27.4024 -1752,-112.745 -1753,-27.4024 -1754,-112.745 -1755,-27.4024 -1756,-112.745 -1757,-27.4024 -1758,-112.745 -1759,-27.4024 -1760,-113.287 -1761,-27.6975 -1762,-113.287 -1763,-27.6975 -1764,-113.287 -1765,-27.6975 -1766,-113.287 -1767,-27.6975 -1768,-113.287 -1769,-27.6975 -1770,-113.287 -1771,-27.6975 -1772,-113.287 -1773,-27.6975 -1774,-113.287 -1775,-27.6975 -1776,-113.287 -1777,-27.6975 -1778,-113.287 -1779,-27.6975 -1780,-113.287 -1781,-27.6975 -1782,-113.287 -1783,-27.6975 -1784,-113.287 -1785,-27.6975 -1786,-113.287 -1787,-27.6975 -1788,-113.287 -1789,-27.6975 -1790,-113.287 -1791,-27.6975 -1792,-9.39071 -1793,-33.7366 -1794,-9.39071 -1795,-33.7366 -1796,-9.39071 -1797,-33.7366 -1798,-9.39071 -1799,-33.7366 -1800,-9.39071 -1801,-33.7366 -1802,-9.39071 -1803,-33.7366 -1804,-9.39071 -1805,-33.7366 -1806,-9.39071 -1807,-33.7366 -1808,-9.39071 -1809,-33.7366 -1810,-9.39071 -1811,-33.7366 -1812,-9.39071 -1813,-33.7366 -1814,-9.39071 -1815,-33.7366 -1816,-9.39071 -1817,-33.7366 -1818,-9.39071 -1819,-33.7366 -1820,-9.39071 -1821,-33.7366 -1822,-9.39071 -1823,-33.7366 -1824,-9.68167 -1825,-34.3477 -1826,-9.68167 -1827,-34.3477 -1828,-9.68167 -1829,-34.3477 -1830,-9.68167 -1831,-34.3477 -1832,-9.68167 -1833,-34.3477 -1834,-9.68167 -1835,-34.3477 -1836,-9.68167 -1837,-34.3477 -1838,-9.68167 -1839,-34.3477 -1840,-9.68167 -1841,-34.3477 -1842,-9.68167 -1843,-34.3477 -1844,-9.68167 -1845,-34.3477 -1846,-9.68167 -1847,-34.3477 -1848,-9.68167 -1849,-34.3477 -1850,-9.68167 -1851,-34.3477 -1852,-9.68167 -1853,-34.3477 -1854,-9.68167 -1855,-34.3477 -1856,-10.2832 -1857,-34.198 -1858,-10.2832 -1859,-34.198 -1860,-10.2832 -1861,-34.198 -1862,-10.2832 -1863,-34.198 -1864,-10.2832 -1865,-34.198 -1866,-10.2832 -1867,-34.198 -1868,-10.2832 -1869,-34.198 -1870,-10.2832 -1871,-34.198 -1872,-10.2832 -1873,-34.198 -1874,-10.2832 -1875,-34.198 -1876,-10.2832 -1877,-34.198 -1878,-10.2832 -1879,-34.198 -1880,-10.2832 -1881,-34.198 -1882,-10.2832 -1883,-34.198 -1884,-10.2832 -1885,-34.198 -1886,-10.2832 -1887,-34.198 -1888,-11.0998 -1889,-34.9693 -1890,-11.0998 -1891,-34.9693 -1892,-11.0998 -1893,-34.9693 -1894,-11.0998 -1895,-34.9693 -1896,-11.0998 -1897,-34.9693 -1898,-11.0998 -1899,-34.9693 -1900,-11.0998 -1901,-34.9693 -1902,-11.0998 -1903,-34.9693 -1904,-11.0998 -1905,-34.9693 -1906,-11.0998 -1907,-34.9693 -1908,-11.0998 -1909,-34.9693 -1910,-11.0998 -1911,-34.9693 -1912,-11.0998 -1913,-34.9693 -1914,-11.0998 -1915,-34.9693 -1916,-11.0998 -1917,-34.9693 -1918,-11.0998 -1919,-34.9693 -1920,-9.51745 -1921,-33.1018 -1922,-9.51745 -1923,-33.1018 -1924,-9.51745 -1925,-33.1018 -1926,-9.51745 -1927,-33.1018 -1928,-9.51745 -1929,-33.1018 -1930,-9.51745 -1931,-33.1018 -1932,-9.51745 -1933,-33.1018 -1934,-9.51745 -1935,-33.1018 -1936,-9.51745 -1937,-33.1018 -1938,-9.51745 -1939,-33.1018 -1940,-9.51745 -1941,-33.1018 -1942,-9.51745 -1943,-33.1018 -1944,-9.51745 -1945,-33.1018 -1946,-9.51745 -1947,-33.1018 -1948,-9.51745 -1949,-33.1018 -1950,-9.51745 -1951,-33.1018 -1952,-8.80054 -1953,-35.6314 -1954,-8.80054 -1955,-35.6314 -1956,-8.80054 -1957,-35.6314 -1958,-8.80054 -1959,-35.6314 -1960,-8.80054 -1961,-35.6314 -1962,-8.80054 -1963,-35.6314 -1964,-8.80054 -1965,-35.6314 -1966,-8.80054 -1967,-35.6314 -1968,-8.80054 -1969,-35.6314 -1970,-8.80054 -1971,-35.6314 -1972,-8.80054 -1973,-35.6314 -1974,-8.80054 -1975,-35.6314 -1976,-8.80054 -1977,-35.6314 -1978,-8.80054 -1979,-35.6314 -1980,-8.80054 -1981,-35.6314 -1982,-8.80054 -1983,-35.6314 -1984,-10.2604 -1985,-33.9637 -1986,-10.2604 -1987,-33.9637 -1988,-10.2604 -1989,-33.9637 -1990,-10.2604 -1991,-33.9637 -1992,-10.2604 -1993,-33.9637 -1994,-10.2604 -1995,-33.9637 -1996,-10.2604 -1997,-33.9637 -1998,-10.2604 -1999,-33.9637 -2000,-10.2604 -2001,-33.9637 -2002,-10.2604 -2003,-33.9637 -2004,-10.2604 -2005,-33.9637 -2006,-10.2604 -2007,-33.9637 -2008,-10.2604 -2009,-33.9637 -2010,-10.2604 -2011,-33.9637 -2012,-10.2604 -2013,-33.9637 -2014,-10.2604 -2015,-33.9637 -2016,-10.3946 -2017,-35.6793 -2018,-10.3946 -2019,-35.6793 -2020,-10.3946 -2021,-35.6793 -2022,-10.3946 -2023,-35.6793 -2024,-10.3946 -2025,-35.6793 -2026,-10.3946 -2027,-35.6793 -2028,-10.3946 -2029,-35.6793 -2030,-10.3946 -2031,-35.6793 -2032,-10.3946 -2033,-35.6793 -2034,-10.3946 -2035,-35.6793 -2036,-10.3946 -2037,-35.6793 -2038,-10.3946 -2039,-35.6793 -2040,-10.3946 -2041,-35.6793 -2042,-10.3946 -2043,-35.6793 -2044,-10.3946 -2045,-35.6793 -2046,-10.3946 -2047,-35.6793 diff --git a/CRVConditions/data/calib_extracted_20260221.txt b/CRVConditions/data/calib_extracted_20260221.txt index 86aa5a440d..2985625e06 100644 --- a/CRVConditions/data/calib_extracted_20260221.txt +++ b/CRVConditions/data/calib_extracted_20260221.txt @@ -2051,2050 +2051,2050 @@ TABLE CRVSiPM TABLE CRVTime #channel,timeOffset 0,0 -1,-25.3202 +1,25.3202 2,0 -3,-25.3202 +3,25.3202 4,0 -5,-25.3202 +5,25.3202 6,0 -7,-25.3202 +7,25.3202 8,0 -9,-25.3202 +9,25.3202 10,0 -11,-25.3202 +11,25.3202 12,0 -13,-25.3202 +13,25.3202 14,0 -15,-25.3202 +15,25.3202 16,0 -17,-25.3202 +17,25.3202 18,0 -19,-25.3202 +19,25.3202 20,0 -21,-25.3202 +21,25.3202 22,0 -23,-25.3202 +23,25.3202 24,0 -25,-25.3202 +25,25.3202 26,0 -27,-25.3202 +27,25.3202 28,0 -29,-25.3202 +29,25.3202 30,0 -31,-25.3202 -32,0.578138 -33,-26.009 -34,0.578138 -35,-26.009 -36,0.578138 -37,-26.009 -38,0.578138 -39,-26.009 -40,0.578138 -41,-26.009 -42,0.578138 -43,-26.009 -44,0.578138 -45,-26.009 -46,0.578138 -47,-26.009 -48,0.578138 -49,-26.009 -50,0.578138 -51,-26.009 -52,0.578138 -53,-26.009 -54,0.578138 -55,-26.009 -56,0.578138 -57,-26.009 -58,0.578138 -59,-26.009 -60,0.578138 -61,-26.009 -62,0.578138 -63,-26.009 -64,-0.545545 -65,-26.4481 -66,-0.545545 -67,-26.4481 -68,-0.545545 -69,-26.4481 -70,-0.545545 -71,-26.4481 -72,-0.545545 -73,-26.4481 -74,-0.545545 -75,-26.4481 -76,-0.545545 -77,-26.4481 -78,-0.545545 -79,-26.4481 -80,-0.545545 -81,-26.4481 -82,-0.545545 -83,-26.4481 -84,-0.545545 -85,-26.4481 -86,-0.545545 -87,-26.4481 -88,-0.545545 -89,-26.4481 -90,-0.545545 -91,-26.4481 -92,-0.545545 -93,-26.4481 -94,-0.545545 -95,-26.4481 -96,-1.51252 -97,-27.5498 -98,-1.51252 -99,-27.5498 -100,-1.51252 -101,-27.5498 -102,-1.51252 -103,-27.5498 -104,-1.51252 -105,-27.5498 -106,-1.51252 -107,-27.5498 -108,-1.51252 -109,-27.5498 -110,-1.51252 -111,-27.5498 -112,-1.51252 -113,-27.5498 -114,-1.51252 -115,-27.5498 -116,-1.51252 -117,-27.5498 -118,-1.51252 -119,-27.5498 -120,-1.51252 -121,-27.5498 -122,-1.51252 -123,-27.5498 -124,-1.51252 -125,-27.5498 -126,-1.51252 -127,-27.5498 -128,-1.37198 -129,-25.2844 -130,-1.37198 -131,-25.2844 -132,-1.37198 -133,-25.2844 -134,-1.37198 -135,-25.2844 -136,-1.37198 -137,-25.2844 -138,-1.37198 -139,-25.2844 -140,-1.37198 -141,-25.2844 -142,-1.37198 -143,-25.2844 -144,-1.37198 -145,-25.2844 -146,-1.37198 -147,-25.2844 -148,-1.37198 -149,-25.2844 -150,-1.37198 -151,-25.2844 -152,-1.37198 -153,-25.2844 -154,-1.37198 -155,-25.2844 -156,-1.37198 -157,-25.2844 -158,-1.37198 -159,-25.2844 -160,-7.4944 -161,-25.6114 -162,-7.4944 -163,-25.6114 -164,-7.4944 -165,-25.6114 -166,-7.4944 -167,-25.6114 -168,-7.4944 -169,-25.6114 -170,-7.4944 -171,-25.6114 -172,-7.4944 -173,-25.6114 -174,-7.4944 -175,-25.6114 -176,-7.4944 -177,-25.6114 -178,-7.4944 -179,-25.6114 -180,-7.4944 -181,-25.6114 -182,-7.4944 -183,-25.6114 -184,-7.4944 -185,-25.6114 -186,-7.4944 -187,-25.6114 -188,-7.4944 -189,-25.6114 -190,-7.4944 -191,-25.6114 -192,-6.92331 -193,-25.6896 -194,-6.92331 -195,-25.6896 -196,-6.92331 -197,-25.6896 -198,-6.92331 -199,-25.6896 -200,-6.92331 -201,-25.6896 -202,-6.92331 -203,-25.6896 -204,-6.92331 -205,-25.6896 -206,-6.92331 -207,-25.6896 -208,-6.92331 -209,-25.6896 -210,-6.92331 -211,-25.6896 -212,-6.92331 -213,-25.6896 -214,-6.92331 -215,-25.6896 -216,-6.92331 -217,-25.6896 -218,-6.92331 -219,-25.6896 -220,-6.92331 -221,-25.6896 -222,-6.92331 -223,-25.6896 -224,-8.38702 -225,-26.5647 -226,-8.38702 -227,-26.5647 -228,-8.38702 -229,-26.5647 -230,-8.38702 -231,-26.5647 -232,-8.38702 -233,-26.5647 -234,-8.38702 -235,-26.5647 -236,-8.38702 -237,-26.5647 -238,-8.38702 -239,-26.5647 -240,-8.38702 -241,-26.5647 -242,-8.38702 -243,-26.5647 -244,-8.38702 -245,-26.5647 -246,-8.38702 -247,-26.5647 -248,-8.38702 -249,-26.5647 -250,-8.38702 -251,-26.5647 -252,-8.38702 -253,-26.5647 -254,-8.38702 -255,-26.5647 -256,-109.716 -257,-27.5925 -258,-109.716 -259,-27.5925 -260,-109.716 -261,-27.5925 -262,-109.716 -263,-27.5925 -264,-109.716 -265,-27.5925 -266,-109.716 -267,-27.5925 -268,-109.716 -269,-27.5925 -270,-109.716 -271,-27.5925 -272,-109.716 -273,-27.5925 -274,-109.716 -275,-27.5925 -276,-109.716 -277,-27.5925 -278,-109.716 -279,-27.5925 -280,-109.716 -281,-27.5925 -282,-109.716 -283,-27.5925 -284,-109.716 -285,-27.5925 -286,-109.716 -287,-27.5925 -288,-110.186 -289,-27.274 -290,-110.186 -291,-27.274 -292,-110.186 -293,-27.274 -294,-110.186 -295,-27.274 -296,-110.186 -297,-27.274 -298,-110.186 -299,-27.274 -300,-110.186 -301,-27.274 -302,-110.186 -303,-27.274 -304,-110.186 -305,-27.274 -306,-110.186 -307,-27.274 -308,-110.186 -309,-27.274 -310,-110.186 -311,-27.274 -312,-110.186 -313,-27.274 -314,-110.186 -315,-27.274 -316,-110.186 -317,-27.274 -318,-110.186 -319,-27.274 -320,-110.624 -321,-27.632 -322,-110.624 -323,-27.632 -324,-110.624 -325,-27.632 -326,-110.624 -327,-27.632 -328,-110.624 -329,-27.632 -330,-110.624 -331,-27.632 -332,-110.624 -333,-27.632 -334,-110.624 -335,-27.632 -336,-110.624 -337,-27.632 -338,-110.624 -339,-27.632 -340,-110.624 -341,-27.632 -342,-110.624 -343,-27.632 -344,-110.624 -345,-27.632 -346,-110.624 -347,-27.632 -348,-110.624 -349,-27.632 -350,-110.624 -351,-27.632 -352,-111.522 -353,-29.1769 -354,-111.522 -355,-29.1769 -356,-111.522 -357,-29.1769 -358,-111.522 -359,-29.1769 -360,-111.522 -361,-29.1769 -362,-111.522 -363,-29.1769 -364,-111.522 -365,-29.1769 -366,-111.522 -367,-29.1769 -368,-111.522 -369,-29.1769 -370,-111.522 -371,-29.1769 -372,-111.522 -373,-29.1769 -374,-111.522 -375,-29.1769 -376,-111.522 -377,-29.1769 -378,-111.522 -379,-29.1769 -380,-111.522 -381,-29.1769 -382,-111.522 -383,-29.1769 -384,1.06952 -385,-27.839 -386,1.06952 -387,-27.839 -388,1.06952 -389,-27.839 -390,1.06952 -391,-27.839 -392,1.06952 -393,-27.839 -394,1.06952 -395,-27.839 -396,1.06952 -397,-27.839 -398,1.06952 -399,-27.839 -400,1.06952 -401,-27.839 -402,1.06952 -403,-27.839 -404,1.06952 -405,-27.839 -406,1.06952 -407,-27.839 -408,1.06952 -409,-27.839 -410,1.06952 -411,-27.839 -412,1.06952 -413,-27.839 -414,1.06952 -415,-27.839 -416,0.916677 -417,-28.5529 -418,0.916677 -419,-28.5529 -420,0.916677 -421,-28.5529 -422,0.916677 -423,-28.5529 -424,0.916677 -425,-28.5529 -426,0.916677 -427,-28.5529 -428,0.916677 -429,-28.5529 -430,0.916677 -431,-28.5529 -432,0.916677 -433,-28.5529 -434,0.916677 -435,-28.5529 -436,0.916677 -437,-28.5529 -438,0.916677 -439,-28.5529 -440,0.916677 -441,-28.5529 -442,0.916677 -443,-28.5529 -444,0.916677 -445,-28.5529 -446,0.916677 -447,-28.5529 -448,0.00523895 -449,-28.0203 -450,0.00523895 -451,-28.0203 -452,0.00523895 -453,-28.0203 -454,0.00523895 -455,-28.0203 -456,0.00523895 -457,-28.0203 -458,0.00523895 -459,-28.0203 -460,0.00523895 -461,-28.0203 -462,0.00523895 -463,-28.0203 -464,0.00523895 -465,-28.0203 -466,0.00523895 -467,-28.0203 -468,0.00523895 -469,-28.0203 -470,0.00523895 -471,-28.0203 -472,0.00523895 -473,-28.0203 -474,0.00523895 -475,-28.0203 -476,0.00523895 -477,-28.0203 -478,0.00523895 -479,-28.0203 -480,-0.700077 -481,-29.2939 -482,-0.700077 -483,-29.2939 -484,-0.700077 -485,-29.2939 -486,-0.700077 -487,-29.2939 -488,-0.700077 -489,-29.2939 -490,-0.700077 -491,-29.2939 -492,-0.700077 -493,-29.2939 -494,-0.700077 -495,-29.2939 -496,-0.700077 -497,-29.2939 -498,-0.700077 -499,-29.2939 -500,-0.700077 -501,-29.2939 -502,-0.700077 -503,-29.2939 -504,-0.700077 -505,-29.2939 -506,-0.700077 -507,-29.2939 -508,-0.700077 -509,-29.2939 -510,-0.700077 -511,-29.2939 -512,-11.4532 -513,-36.1776 -514,-11.4532 -515,-36.1776 -516,-11.4532 -517,-36.1776 -518,-11.4532 -519,-36.1776 -520,-11.4532 -521,-36.1776 -522,-11.4532 -523,-36.1776 -524,-11.4532 -525,-36.1776 -526,-11.4532 -527,-36.1776 -528,-11.4532 -529,-36.1776 -530,-11.4532 -531,-36.1776 -532,-11.4532 -533,-36.1776 -534,-11.4532 -535,-36.1776 -536,-11.4532 -537,-36.1776 -538,-11.4532 -539,-36.1776 -540,-11.4532 -541,-36.1776 -542,-11.4532 -543,-36.1776 -544,-10.5125 -545,-36.1453 -546,-10.5125 -547,-36.1453 -548,-10.5125 -549,-36.1453 -550,-10.5125 -551,-36.1453 -552,-10.5125 -553,-36.1453 -554,-10.5125 -555,-36.1453 -556,-10.5125 -557,-36.1453 -558,-10.5125 -559,-36.1453 -560,-10.5125 -561,-36.1453 -562,-10.5125 -563,-36.1453 -564,-10.5125 -565,-36.1453 -566,-10.5125 -567,-36.1453 -568,-10.5125 -569,-36.1453 -570,-10.5125 -571,-36.1453 -572,-10.5125 -573,-36.1453 -574,-10.5125 -575,-36.1453 -576,-11.9359 -577,-36.7237 -578,-11.9359 -579,-36.7237 -580,-11.9359 -581,-36.7237 -582,-11.9359 -583,-36.7237 -584,-11.9359 -585,-36.7237 -586,-11.9359 -587,-36.7237 -588,-11.9359 -589,-36.7237 -590,-11.9359 -591,-36.7237 -592,-11.9359 -593,-36.7237 -594,-11.9359 -595,-36.7237 -596,-11.9359 -597,-36.7237 -598,-11.9359 -599,-36.7237 -600,-11.9359 -601,-36.7237 -602,-11.9359 -603,-36.7237 -604,-11.9359 -605,-36.7237 -606,-11.9359 -607,-36.7237 -608,-12.4648 -609,-37.281 -610,-12.4648 -611,-37.281 -612,-12.4648 -613,-37.281 -614,-12.4648 -615,-37.281 -616,-12.4648 -617,-37.281 -618,-12.4648 -619,-37.281 -620,-12.4648 -621,-37.281 -622,-12.4648 -623,-37.281 -624,-12.4648 -625,-37.281 -626,-12.4648 -627,-37.281 -628,-12.4648 -629,-37.281 -630,-12.4648 -631,-37.281 -632,-12.4648 -633,-37.281 -634,-12.4648 -635,-37.281 -636,-12.4648 -637,-37.281 -638,-12.4648 -639,-37.281 -640,-6.68486 -641,-34.539 -642,-6.68486 -643,-34.539 -644,-6.68486 -645,-34.539 -646,-6.68486 -647,-34.539 -648,-6.68486 -649,-34.539 -650,-6.68486 -651,-34.539 -652,-6.68486 -653,-34.539 -654,-6.68486 -655,-34.539 -656,-6.68486 -657,-34.539 -658,-6.68486 -659,-34.539 -660,-6.68486 -661,-34.539 -662,-6.68486 -663,-34.539 -664,-6.68486 -665,-34.539 -666,-6.68486 -667,-34.539 -668,-6.68486 -669,-34.539 -670,-6.68486 -671,-34.539 -672,-8.79856 -673,-36.1952 -674,-8.79856 -675,-36.1952 -676,-8.79856 -677,-36.1952 -678,-8.79856 -679,-36.1952 -680,-8.79856 -681,-36.1952 -682,-8.79856 -683,-36.1952 -684,-8.79856 -685,-36.1952 -686,-8.79856 -687,-36.1952 -688,-8.79856 -689,-36.1952 -690,-8.79856 -691,-36.1952 -692,-8.79856 -693,-36.1952 -694,-8.79856 -695,-36.1952 -696,-8.79856 -697,-36.1952 -698,-8.79856 -699,-36.1952 -700,-8.79856 -701,-36.1952 -702,-8.79856 -703,-36.1952 -704,-8.00774 -705,-36.3394 -706,-8.00774 -707,-36.3394 -708,-8.00774 -709,-36.3394 -710,-8.00774 -711,-36.3394 -712,-8.00774 -713,-36.3394 -714,-8.00774 -715,-36.3394 -716,-8.00774 -717,-36.3394 -718,-8.00774 -719,-36.3394 -720,-8.00774 -721,-36.3394 -722,-8.00774 -723,-36.3394 -724,-8.00774 -725,-36.3394 -726,-8.00774 -727,-36.3394 -728,-8.00774 -729,-36.3394 -730,-8.00774 -731,-36.3394 -732,-8.00774 -733,-36.3394 -734,-8.00774 -735,-36.3394 -736,-9.42012 -737,-36.9919 -738,-9.42012 -739,-36.9919 -740,-9.42012 -741,-36.9919 -742,-9.42012 -743,-36.9919 -744,-9.42012 -745,-36.9919 -746,-9.42012 -747,-36.9919 -748,-9.42012 -749,-36.9919 -750,-9.42012 -751,-36.9919 -752,-9.42012 -753,-36.9919 -754,-9.42012 -755,-36.9919 -756,-9.42012 -757,-36.9919 -758,-9.42012 -759,-36.9919 -760,-9.42012 -761,-36.9919 -762,-9.42012 -763,-36.9919 -764,-9.42012 -765,-36.9919 -766,-9.42012 -767,-36.9919 -768,-8.21244 -769,-34.7867 -770,-8.21244 -771,-34.7867 -772,-8.21244 -773,-34.7867 -774,-8.21244 -775,-34.7867 -776,-8.21244 -777,-34.7867 -778,-8.21244 -779,-34.7867 -780,-8.21244 -781,-34.7867 -782,-8.21244 -783,-34.7867 -784,-8.21244 -785,-34.7867 -786,-8.21244 -787,-34.7867 -788,-8.21244 -789,-34.7867 -790,-8.21244 -791,-34.7867 -792,-8.21244 -793,-34.7867 -794,-8.21244 -795,-34.7867 -796,-8.21244 -797,-34.7867 -798,-8.21244 -799,-34.7867 -800,-8.78974 -801,-35.0804 -802,-8.78974 -803,-35.0804 -804,-8.78974 -805,-35.0804 -806,-8.78974 -807,-35.0804 -808,-8.78974 -809,-35.0804 -810,-8.78974 -811,-35.0804 -812,-8.78974 -813,-35.0804 -814,-8.78974 -815,-35.0804 -816,-8.78974 -817,-35.0804 -818,-8.78974 -819,-35.0804 -820,-8.78974 -821,-35.0804 -822,-8.78974 -823,-35.0804 -824,-8.78974 -825,-35.0804 -826,-8.78974 -827,-35.0804 -828,-8.78974 -829,-35.0804 -830,-8.78974 -831,-35.0804 -832,-8.86492 -833,-35.832 -834,-8.86492 -835,-35.832 -836,-8.86492 -837,-35.832 -838,-8.86492 -839,-35.832 -840,-8.86492 -841,-35.832 -842,-8.86492 -843,-35.832 -844,-8.86492 -845,-35.832 -846,-8.86492 -847,-35.832 -848,-8.86492 -849,-35.832 -850,-8.86492 -851,-35.832 -852,-8.86492 -853,-35.832 -854,-8.86492 -855,-35.832 -856,-8.86492 -857,-35.832 -858,-8.86492 -859,-35.832 -860,-8.86492 -861,-35.832 -862,-8.86492 -863,-35.832 -864,-9.46984 -865,-36.2304 -866,-9.46984 -867,-36.2304 -868,-9.46984 -869,-36.2304 -870,-9.46984 -871,-36.2304 -872,-9.46984 -873,-36.2304 -874,-9.46984 -875,-36.2304 -876,-9.46984 -877,-36.2304 -878,-9.46984 -879,-36.2304 -880,-9.46984 -881,-36.2304 -882,-9.46984 -883,-36.2304 -884,-9.46984 -885,-36.2304 -886,-9.46984 -887,-36.2304 -888,-9.46984 -889,-36.2304 -890,-9.46984 -891,-36.2304 -892,-9.46984 -893,-36.2304 -894,-9.46984 -895,-36.2304 -896,-7.74688 -897,-35.1967 -898,-7.74688 -899,-35.1967 -900,-7.74688 -901,-35.1967 -902,-7.74688 -903,-35.1967 -904,-7.74688 -905,-35.1967 -906,-7.74688 -907,-35.1967 -908,-7.74688 -909,-35.1967 -910,-7.74688 -911,-35.1967 -912,-7.74688 -913,-35.1967 -914,-7.74688 -915,-35.1967 -916,-7.74688 -917,-35.1967 -918,-7.74688 -919,-35.1967 -920,-7.74688 -921,-35.1967 -922,-7.74688 -923,-35.1967 -924,-7.74688 -925,-35.1967 -926,-7.74688 -927,-35.1967 -928,-8.77951 -929,-35.6291 -930,-8.77951 -931,-35.6291 -932,-8.77951 -933,-35.6291 -934,-8.77951 -935,-35.6291 -936,-8.77951 -937,-35.6291 -938,-8.77951 -939,-35.6291 -940,-8.77951 -941,-35.6291 -942,-8.77951 -943,-35.6291 -944,-8.77951 -945,-35.6291 -946,-8.77951 -947,-35.6291 -948,-8.77951 -949,-35.6291 -950,-8.77951 -951,-35.6291 -952,-8.77951 -953,-35.6291 -954,-8.77951 -955,-35.6291 -956,-8.77951 -957,-35.6291 -958,-8.77951 -959,-35.6291 -960,-9.44359 -961,-36.4005 -962,-9.44359 -963,-36.4005 -964,-9.44359 -965,-36.4005 -966,-9.44359 -967,-36.4005 -968,-9.44359 -969,-36.4005 -970,-9.44359 -971,-36.4005 -972,-9.44359 -973,-36.4005 -974,-9.44359 -975,-36.4005 -976,-9.44359 -977,-36.4005 -978,-9.44359 -979,-36.4005 -980,-9.44359 -981,-36.4005 -982,-9.44359 -983,-36.4005 -984,-9.44359 -985,-36.4005 -986,-9.44359 -987,-36.4005 -988,-9.44359 -989,-36.4005 -990,-9.44359 -991,-36.4005 -992,-9.71026 -993,-36.8504 -994,-9.71026 -995,-36.8504 -996,-9.71026 -997,-36.8504 -998,-9.71026 -999,-36.8504 -1000,-9.71026 -1001,-36.8504 -1002,-9.71026 -1003,-36.8504 -1004,-9.71026 -1005,-36.8504 -1006,-9.71026 -1007,-36.8504 -1008,-9.71026 -1009,-36.8504 -1010,-9.71026 -1011,-36.8504 -1012,-9.71026 -1013,-36.8504 -1014,-9.71026 -1015,-36.8504 -1016,-9.71026 -1017,-36.8504 -1018,-9.71026 -1019,-36.8504 -1020,-9.71026 -1021,-36.8504 -1022,-9.71026 -1023,-36.8504 +31,25.3202 +32,-0.578138 +33,26.009 +34,-0.578138 +35,26.009 +36,-0.578138 +37,26.009 +38,-0.578138 +39,26.009 +40,-0.578138 +41,26.009 +42,-0.578138 +43,26.009 +44,-0.578138 +45,26.009 +46,-0.578138 +47,26.009 +48,-0.578138 +49,26.009 +50,-0.578138 +51,26.009 +52,-0.578138 +53,26.009 +54,-0.578138 +55,26.009 +56,-0.578138 +57,26.009 +58,-0.578138 +59,26.009 +60,-0.578138 +61,26.009 +62,-0.578138 +63,26.009 +64,0.545545 +65,26.4481 +66,0.545545 +67,26.4481 +68,0.545545 +69,26.4481 +70,0.545545 +71,26.4481 +72,0.545545 +73,26.4481 +74,0.545545 +75,26.4481 +76,0.545545 +77,26.4481 +78,0.545545 +79,26.4481 +80,0.545545 +81,26.4481 +82,0.545545 +83,26.4481 +84,0.545545 +85,26.4481 +86,0.545545 +87,26.4481 +88,0.545545 +89,26.4481 +90,0.545545 +91,26.4481 +92,0.545545 +93,26.4481 +94,0.545545 +95,26.4481 +96,1.51252 +97,27.5498 +98,1.51252 +99,27.5498 +100,1.51252 +101,27.5498 +102,1.51252 +103,27.5498 +104,1.51252 +105,27.5498 +106,1.51252 +107,27.5498 +108,1.51252 +109,27.5498 +110,1.51252 +111,27.5498 +112,1.51252 +113,27.5498 +114,1.51252 +115,27.5498 +116,1.51252 +117,27.5498 +118,1.51252 +119,27.5498 +120,1.51252 +121,27.5498 +122,1.51252 +123,27.5498 +124,1.51252 +125,27.5498 +126,1.51252 +127,27.5498 +128,1.37198 +129,25.2844 +130,1.37198 +131,25.2844 +132,1.37198 +133,25.2844 +134,1.37198 +135,25.2844 +136,1.37198 +137,25.2844 +138,1.37198 +139,25.2844 +140,1.37198 +141,25.2844 +142,1.37198 +143,25.2844 +144,1.37198 +145,25.2844 +146,1.37198 +147,25.2844 +148,1.37198 +149,25.2844 +150,1.37198 +151,25.2844 +152,1.37198 +153,25.2844 +154,1.37198 +155,25.2844 +156,1.37198 +157,25.2844 +158,1.37198 +159,25.2844 +160,7.4944 +161,25.6114 +162,7.4944 +163,25.6114 +164,7.4944 +165,25.6114 +166,7.4944 +167,25.6114 +168,7.4944 +169,25.6114 +170,7.4944 +171,25.6114 +172,7.4944 +173,25.6114 +174,7.4944 +175,25.6114 +176,7.4944 +177,25.6114 +178,7.4944 +179,25.6114 +180,7.4944 +181,25.6114 +182,7.4944 +183,25.6114 +184,7.4944 +185,25.6114 +186,7.4944 +187,25.6114 +188,7.4944 +189,25.6114 +190,7.4944 +191,25.6114 +192,6.92331 +193,25.6896 +194,6.92331 +195,25.6896 +196,6.92331 +197,25.6896 +198,6.92331 +199,25.6896 +200,6.92331 +201,25.6896 +202,6.92331 +203,25.6896 +204,6.92331 +205,25.6896 +206,6.92331 +207,25.6896 +208,6.92331 +209,25.6896 +210,6.92331 +211,25.6896 +212,6.92331 +213,25.6896 +214,6.92331 +215,25.6896 +216,6.92331 +217,25.6896 +218,6.92331 +219,25.6896 +220,6.92331 +221,25.6896 +222,6.92331 +223,25.6896 +224,8.38702 +225,26.5647 +226,8.38702 +227,26.5647 +228,8.38702 +229,26.5647 +230,8.38702 +231,26.5647 +232,8.38702 +233,26.5647 +234,8.38702 +235,26.5647 +236,8.38702 +237,26.5647 +238,8.38702 +239,26.5647 +240,8.38702 +241,26.5647 +242,8.38702 +243,26.5647 +244,8.38702 +245,26.5647 +246,8.38702 +247,26.5647 +248,8.38702 +249,26.5647 +250,8.38702 +251,26.5647 +252,8.38702 +253,26.5647 +254,8.38702 +255,26.5647 +256,109.716 +257,27.5925 +258,109.716 +259,27.5925 +260,109.716 +261,27.5925 +262,109.716 +263,27.5925 +264,109.716 +265,27.5925 +266,109.716 +267,27.5925 +268,109.716 +269,27.5925 +270,109.716 +271,27.5925 +272,109.716 +273,27.5925 +274,109.716 +275,27.5925 +276,109.716 +277,27.5925 +278,109.716 +279,27.5925 +280,109.716 +281,27.5925 +282,109.716 +283,27.5925 +284,109.716 +285,27.5925 +286,109.716 +287,27.5925 +288,110.186 +289,27.274 +290,110.186 +291,27.274 +292,110.186 +293,27.274 +294,110.186 +295,27.274 +296,110.186 +297,27.274 +298,110.186 +299,27.274 +300,110.186 +301,27.274 +302,110.186 +303,27.274 +304,110.186 +305,27.274 +306,110.186 +307,27.274 +308,110.186 +309,27.274 +310,110.186 +311,27.274 +312,110.186 +313,27.274 +314,110.186 +315,27.274 +316,110.186 +317,27.274 +318,110.186 +319,27.274 +320,110.624 +321,27.632 +322,110.624 +323,27.632 +324,110.624 +325,27.632 +326,110.624 +327,27.632 +328,110.624 +329,27.632 +330,110.624 +331,27.632 +332,110.624 +333,27.632 +334,110.624 +335,27.632 +336,110.624 +337,27.632 +338,110.624 +339,27.632 +340,110.624 +341,27.632 +342,110.624 +343,27.632 +344,110.624 +345,27.632 +346,110.624 +347,27.632 +348,110.624 +349,27.632 +350,110.624 +351,27.632 +352,111.522 +353,29.1769 +354,111.522 +355,29.1769 +356,111.522 +357,29.1769 +358,111.522 +359,29.1769 +360,111.522 +361,29.1769 +362,111.522 +363,29.1769 +364,111.522 +365,29.1769 +366,111.522 +367,29.1769 +368,111.522 +369,29.1769 +370,111.522 +371,29.1769 +372,111.522 +373,29.1769 +374,111.522 +375,29.1769 +376,111.522 +377,29.1769 +378,111.522 +379,29.1769 +380,111.522 +381,29.1769 +382,111.522 +383,29.1769 +384,-1.06952 +385,27.839 +386,-1.06952 +387,27.839 +388,-1.06952 +389,27.839 +390,-1.06952 +391,27.839 +392,-1.06952 +393,27.839 +394,-1.06952 +395,27.839 +396,-1.06952 +397,27.839 +398,-1.06952 +399,27.839 +400,-1.06952 +401,27.839 +402,-1.06952 +403,27.839 +404,-1.06952 +405,27.839 +406,-1.06952 +407,27.839 +408,-1.06952 +409,27.839 +410,-1.06952 +411,27.839 +412,-1.06952 +413,27.839 +414,-1.06952 +415,27.839 +416,-0.916677 +417,28.5529 +418,-0.916677 +419,28.5529 +420,-0.916677 +421,28.5529 +422,-0.916677 +423,28.5529 +424,-0.916677 +425,28.5529 +426,-0.916677 +427,28.5529 +428,-0.916677 +429,28.5529 +430,-0.916677 +431,28.5529 +432,-0.916677 +433,28.5529 +434,-0.916677 +435,28.5529 +436,-0.916677 +437,28.5529 +438,-0.916677 +439,28.5529 +440,-0.916677 +441,28.5529 +442,-0.916677 +443,28.5529 +444,-0.916677 +445,28.5529 +446,-0.916677 +447,28.5529 +448,-0.00523895 +449,28.0203 +450,-0.00523895 +451,28.0203 +452,-0.00523895 +453,28.0203 +454,-0.00523895 +455,28.0203 +456,-0.00523895 +457,28.0203 +458,-0.00523895 +459,28.0203 +460,-0.00523895 +461,28.0203 +462,-0.00523895 +463,28.0203 +464,-0.00523895 +465,28.0203 +466,-0.00523895 +467,28.0203 +468,-0.00523895 +469,28.0203 +470,-0.00523895 +471,28.0203 +472,-0.00523895 +473,28.0203 +474,-0.00523895 +475,28.0203 +476,-0.00523895 +477,28.0203 +478,-0.00523895 +479,28.0203 +480,0.700077 +481,29.2939 +482,0.700077 +483,29.2939 +484,0.700077 +485,29.2939 +486,0.700077 +487,29.2939 +488,0.700077 +489,29.2939 +490,0.700077 +491,29.2939 +492,0.700077 +493,29.2939 +494,0.700077 +495,29.2939 +496,0.700077 +497,29.2939 +498,0.700077 +499,29.2939 +500,0.700077 +501,29.2939 +502,0.700077 +503,29.2939 +504,0.700077 +505,29.2939 +506,0.700077 +507,29.2939 +508,0.700077 +509,29.2939 +510,0.700077 +511,29.2939 +512,11.4532 +513,36.1776 +514,11.4532 +515,36.1776 +516,11.4532 +517,36.1776 +518,11.4532 +519,36.1776 +520,11.4532 +521,36.1776 +522,11.4532 +523,36.1776 +524,11.4532 +525,36.1776 +526,11.4532 +527,36.1776 +528,11.4532 +529,36.1776 +530,11.4532 +531,36.1776 +532,11.4532 +533,36.1776 +534,11.4532 +535,36.1776 +536,11.4532 +537,36.1776 +538,11.4532 +539,36.1776 +540,11.4532 +541,36.1776 +542,11.4532 +543,36.1776 +544,10.5125 +545,36.1453 +546,10.5125 +547,36.1453 +548,10.5125 +549,36.1453 +550,10.5125 +551,36.1453 +552,10.5125 +553,36.1453 +554,10.5125 +555,36.1453 +556,10.5125 +557,36.1453 +558,10.5125 +559,36.1453 +560,10.5125 +561,36.1453 +562,10.5125 +563,36.1453 +564,10.5125 +565,36.1453 +566,10.5125 +567,36.1453 +568,10.5125 +569,36.1453 +570,10.5125 +571,36.1453 +572,10.5125 +573,36.1453 +574,10.5125 +575,36.1453 +576,11.9359 +577,36.7237 +578,11.9359 +579,36.7237 +580,11.9359 +581,36.7237 +582,11.9359 +583,36.7237 +584,11.9359 +585,36.7237 +586,11.9359 +587,36.7237 +588,11.9359 +589,36.7237 +590,11.9359 +591,36.7237 +592,11.9359 +593,36.7237 +594,11.9359 +595,36.7237 +596,11.9359 +597,36.7237 +598,11.9359 +599,36.7237 +600,11.9359 +601,36.7237 +602,11.9359 +603,36.7237 +604,11.9359 +605,36.7237 +606,11.9359 +607,36.7237 +608,12.4648 +609,37.281 +610,12.4648 +611,37.281 +612,12.4648 +613,37.281 +614,12.4648 +615,37.281 +616,12.4648 +617,37.281 +618,12.4648 +619,37.281 +620,12.4648 +621,37.281 +622,12.4648 +623,37.281 +624,12.4648 +625,37.281 +626,12.4648 +627,37.281 +628,12.4648 +629,37.281 +630,12.4648 +631,37.281 +632,12.4648 +633,37.281 +634,12.4648 +635,37.281 +636,12.4648 +637,37.281 +638,12.4648 +639,37.281 +640,6.68486 +641,34.539 +642,6.68486 +643,34.539 +644,6.68486 +645,34.539 +646,6.68486 +647,34.539 +648,6.68486 +649,34.539 +650,6.68486 +651,34.539 +652,6.68486 +653,34.539 +654,6.68486 +655,34.539 +656,6.68486 +657,34.539 +658,6.68486 +659,34.539 +660,6.68486 +661,34.539 +662,6.68486 +663,34.539 +664,6.68486 +665,34.539 +666,6.68486 +667,34.539 +668,6.68486 +669,34.539 +670,6.68486 +671,34.539 +672,8.79856 +673,36.1952 +674,8.79856 +675,36.1952 +676,8.79856 +677,36.1952 +678,8.79856 +679,36.1952 +680,8.79856 +681,36.1952 +682,8.79856 +683,36.1952 +684,8.79856 +685,36.1952 +686,8.79856 +687,36.1952 +688,8.79856 +689,36.1952 +690,8.79856 +691,36.1952 +692,8.79856 +693,36.1952 +694,8.79856 +695,36.1952 +696,8.79856 +697,36.1952 +698,8.79856 +699,36.1952 +700,8.79856 +701,36.1952 +702,8.79856 +703,36.1952 +704,8.00774 +705,36.3394 +706,8.00774 +707,36.3394 +708,8.00774 +709,36.3394 +710,8.00774 +711,36.3394 +712,8.00774 +713,36.3394 +714,8.00774 +715,36.3394 +716,8.00774 +717,36.3394 +718,8.00774 +719,36.3394 +720,8.00774 +721,36.3394 +722,8.00774 +723,36.3394 +724,8.00774 +725,36.3394 +726,8.00774 +727,36.3394 +728,8.00774 +729,36.3394 +730,8.00774 +731,36.3394 +732,8.00774 +733,36.3394 +734,8.00774 +735,36.3394 +736,9.42012 +737,36.9919 +738,9.42012 +739,36.9919 +740,9.42012 +741,36.9919 +742,9.42012 +743,36.9919 +744,9.42012 +745,36.9919 +746,9.42012 +747,36.9919 +748,9.42012 +749,36.9919 +750,9.42012 +751,36.9919 +752,9.42012 +753,36.9919 +754,9.42012 +755,36.9919 +756,9.42012 +757,36.9919 +758,9.42012 +759,36.9919 +760,9.42012 +761,36.9919 +762,9.42012 +763,36.9919 +764,9.42012 +765,36.9919 +766,9.42012 +767,36.9919 +768,8.21244 +769,34.7867 +770,8.21244 +771,34.7867 +772,8.21244 +773,34.7867 +774,8.21244 +775,34.7867 +776,8.21244 +777,34.7867 +778,8.21244 +779,34.7867 +780,8.21244 +781,34.7867 +782,8.21244 +783,34.7867 +784,8.21244 +785,34.7867 +786,8.21244 +787,34.7867 +788,8.21244 +789,34.7867 +790,8.21244 +791,34.7867 +792,8.21244 +793,34.7867 +794,8.21244 +795,34.7867 +796,8.21244 +797,34.7867 +798,8.21244 +799,34.7867 +800,8.78974 +801,35.0804 +802,8.78974 +803,35.0804 +804,8.78974 +805,35.0804 +806,8.78974 +807,35.0804 +808,8.78974 +809,35.0804 +810,8.78974 +811,35.0804 +812,8.78974 +813,35.0804 +814,8.78974 +815,35.0804 +816,8.78974 +817,35.0804 +818,8.78974 +819,35.0804 +820,8.78974 +821,35.0804 +822,8.78974 +823,35.0804 +824,8.78974 +825,35.0804 +826,8.78974 +827,35.0804 +828,8.78974 +829,35.0804 +830,8.78974 +831,35.0804 +832,8.86492 +833,35.832 +834,8.86492 +835,35.832 +836,8.86492 +837,35.832 +838,8.86492 +839,35.832 +840,8.86492 +841,35.832 +842,8.86492 +843,35.832 +844,8.86492 +845,35.832 +846,8.86492 +847,35.832 +848,8.86492 +849,35.832 +850,8.86492 +851,35.832 +852,8.86492 +853,35.832 +854,8.86492 +855,35.832 +856,8.86492 +857,35.832 +858,8.86492 +859,35.832 +860,8.86492 +861,35.832 +862,8.86492 +863,35.832 +864,9.46984 +865,36.2304 +866,9.46984 +867,36.2304 +868,9.46984 +869,36.2304 +870,9.46984 +871,36.2304 +872,9.46984 +873,36.2304 +874,9.46984 +875,36.2304 +876,9.46984 +877,36.2304 +878,9.46984 +879,36.2304 +880,9.46984 +881,36.2304 +882,9.46984 +883,36.2304 +884,9.46984 +885,36.2304 +886,9.46984 +887,36.2304 +888,9.46984 +889,36.2304 +890,9.46984 +891,36.2304 +892,9.46984 +893,36.2304 +894,9.46984 +895,36.2304 +896,7.74688 +897,35.1967 +898,7.74688 +899,35.1967 +900,7.74688 +901,35.1967 +902,7.74688 +903,35.1967 +904,7.74688 +905,35.1967 +906,7.74688 +907,35.1967 +908,7.74688 +909,35.1967 +910,7.74688 +911,35.1967 +912,7.74688 +913,35.1967 +914,7.74688 +915,35.1967 +916,7.74688 +917,35.1967 +918,7.74688 +919,35.1967 +920,7.74688 +921,35.1967 +922,7.74688 +923,35.1967 +924,7.74688 +925,35.1967 +926,7.74688 +927,35.1967 +928,8.77951 +929,35.6291 +930,8.77951 +931,35.6291 +932,8.77951 +933,35.6291 +934,8.77951 +935,35.6291 +936,8.77951 +937,35.6291 +938,8.77951 +939,35.6291 +940,8.77951 +941,35.6291 +942,8.77951 +943,35.6291 +944,8.77951 +945,35.6291 +946,8.77951 +947,35.6291 +948,8.77951 +949,35.6291 +950,8.77951 +951,35.6291 +952,8.77951 +953,35.6291 +954,8.77951 +955,35.6291 +956,8.77951 +957,35.6291 +958,8.77951 +959,35.6291 +960,9.44359 +961,36.4005 +962,9.44359 +963,36.4005 +964,9.44359 +965,36.4005 +966,9.44359 +967,36.4005 +968,9.44359 +969,36.4005 +970,9.44359 +971,36.4005 +972,9.44359 +973,36.4005 +974,9.44359 +975,36.4005 +976,9.44359 +977,36.4005 +978,9.44359 +979,36.4005 +980,9.44359 +981,36.4005 +982,9.44359 +983,36.4005 +984,9.44359 +985,36.4005 +986,9.44359 +987,36.4005 +988,9.44359 +989,36.4005 +990,9.44359 +991,36.4005 +992,9.71026 +993,36.8504 +994,9.71026 +995,36.8504 +996,9.71026 +997,36.8504 +998,9.71026 +999,36.8504 +1000,9.71026 +1001,36.8504 +1002,9.71026 +1003,36.8504 +1004,9.71026 +1005,36.8504 +1006,9.71026 +1007,36.8504 +1008,9.71026 +1009,36.8504 +1010,9.71026 +1011,36.8504 +1012,9.71026 +1013,36.8504 +1014,9.71026 +1015,36.8504 +1016,9.71026 +1017,36.8504 +1018,9.71026 +1019,36.8504 +1020,9.71026 +1021,36.8504 +1022,9.71026 +1023,36.8504 1024,0 -1025,-7.8 +1025,7.8 1026,0 -1027,-7.8 +1027,7.8 1028,0 -1029,-7.8 +1029,7.8 1030,0 -1031,-7.8 +1031,7.8 1032,0 -1033,-7.8 +1033,7.8 1034,0 -1035,-7.8 +1035,7.8 1036,0 -1037,-7.8 +1037,7.8 1038,0 -1039,-7.8 +1039,7.8 1040,0 -1041,-7.8 +1041,7.8 1042,0 -1043,-7.8 +1043,7.8 1044,0 -1045,-7.8 +1045,7.8 1046,0 -1047,-7.8 +1047,7.8 1048,0 -1049,-7.8 +1049,7.8 1050,0 -1051,-7.8 +1051,7.8 1052,0 -1053,-7.8 +1053,7.8 1054,0 -1055,-7.8 +1055,7.8 1056,0 -1057,-7.42759 +1057,7.42759 1058,0 -1059,-7.42759 +1059,7.42759 1060,0 -1061,-7.42759 +1061,7.42759 1062,0 -1063,-7.42759 +1063,7.42759 1064,0 -1065,-7.42759 +1065,7.42759 1066,0 -1067,-7.42759 +1067,7.42759 1068,0 -1069,-7.42759 +1069,7.42759 1070,0 -1071,-7.42759 +1071,7.42759 1072,0 -1073,-7.42759 +1073,7.42759 1074,0 -1075,-7.42759 +1075,7.42759 1076,0 -1077,-7.42759 +1077,7.42759 1078,0 -1079,-7.42759 +1079,7.42759 1080,0 -1081,-7.42759 +1081,7.42759 1082,0 -1083,-7.42759 +1083,7.42759 1084,0 -1085,-7.42759 +1085,7.42759 1086,0 -1087,-7.42759 +1087,7.42759 1088,0 -1089,-13.1395 +1089,13.1395 1090,0 -1091,-13.1395 +1091,13.1395 1092,0 -1093,-13.1395 +1093,13.1395 1094,0 -1095,-13.1395 +1095,13.1395 1096,0 -1097,-13.1395 +1097,13.1395 1098,0 -1099,-13.1395 +1099,13.1395 1100,0 -1101,-13.1395 +1101,13.1395 1102,0 -1103,-13.1395 +1103,13.1395 1104,0 -1105,-13.1395 +1105,13.1395 1106,0 -1107,-13.1395 +1107,13.1395 1108,0 -1109,-13.1395 +1109,13.1395 1110,0 -1111,-13.1395 +1111,13.1395 1112,0 -1113,-13.1395 +1113,13.1395 1114,0 -1115,-13.1395 +1115,13.1395 1116,0 -1117,-13.1395 +1117,13.1395 1118,0 -1119,-13.1395 +1119,13.1395 1120,0 -1121,-13.5592 +1121,13.5592 1122,0 -1123,-13.5592 +1123,13.5592 1124,0 -1125,-13.5592 +1125,13.5592 1126,0 -1127,-13.5592 +1127,13.5592 1128,0 -1129,-13.5592 +1129,13.5592 1130,0 -1131,-13.5592 +1131,13.5592 1132,0 -1133,-13.5592 +1133,13.5592 1134,0 -1135,-13.5592 +1135,13.5592 1136,0 -1137,-13.5592 +1137,13.5592 1138,0 -1139,-13.5592 +1139,13.5592 1140,0 -1141,-13.5592 +1141,13.5592 1142,0 -1143,-13.5592 +1143,13.5592 1144,0 -1145,-13.5592 +1145,13.5592 1146,0 -1147,-13.5592 +1147,13.5592 1148,0 -1149,-13.5592 +1149,13.5592 1150,0 -1151,-13.5592 +1151,13.5592 1152,0 -1153,-8.52569 +1153,8.52569 1154,0 -1155,-8.52569 +1155,8.52569 1156,0 -1157,-8.52569 +1157,8.52569 1158,0 -1159,-8.52569 +1159,8.52569 1160,0 -1161,-8.52569 +1161,8.52569 1162,0 -1163,-8.52569 +1163,8.52569 1164,0 -1165,-8.52569 +1165,8.52569 1166,0 -1167,-8.52569 +1167,8.52569 1168,0 -1169,-8.52569 +1169,8.52569 1170,0 -1171,-8.52569 +1171,8.52569 1172,0 -1173,-8.52569 +1173,8.52569 1174,0 -1175,-8.52569 +1175,8.52569 1176,0 -1177,-8.52569 +1177,8.52569 1178,0 -1179,-8.52569 +1179,8.52569 1180,0 -1181,-8.52569 +1181,8.52569 1182,0 -1183,-8.52569 +1183,8.52569 1184,0 -1185,-7.38951 +1185,7.38951 1186,0 -1187,-7.38951 +1187,7.38951 1188,0 -1189,-7.38951 +1189,7.38951 1190,0 -1191,-7.38951 +1191,7.38951 1192,0 -1193,-7.38951 +1193,7.38951 1194,0 -1195,-7.38951 +1195,7.38951 1196,0 -1197,-7.38951 +1197,7.38951 1198,0 -1199,-7.38951 +1199,7.38951 1200,0 -1201,-7.38951 +1201,7.38951 1202,0 -1203,-7.38951 +1203,7.38951 1204,0 -1205,-7.38951 +1205,7.38951 1206,0 -1207,-7.38951 +1207,7.38951 1208,0 -1209,-7.38951 +1209,7.38951 1210,0 -1211,-7.38951 +1211,7.38951 1212,0 -1213,-7.38951 +1213,7.38951 1214,0 -1215,-7.38951 +1215,7.38951 1216,0 -1217,-13.8636 +1217,13.8636 1218,0 -1219,-13.8636 +1219,13.8636 1220,0 -1221,-13.8636 +1221,13.8636 1222,0 -1223,-13.8636 +1223,13.8636 1224,0 -1225,-13.8636 +1225,13.8636 1226,0 -1227,-13.8636 +1227,13.8636 1228,0 -1229,-13.8636 +1229,13.8636 1230,0 -1231,-13.8636 +1231,13.8636 1232,0 -1233,-13.8636 +1233,13.8636 1234,0 -1235,-13.8636 +1235,13.8636 1236,0 -1237,-13.8636 +1237,13.8636 1238,0 -1239,-13.8636 +1239,13.8636 1240,0 -1241,-13.8636 +1241,13.8636 1242,0 -1243,-13.8636 +1243,13.8636 1244,0 -1245,-13.8636 +1245,13.8636 1246,0 -1247,-13.8636 +1247,13.8636 1248,0 -1249,-13.5132 +1249,13.5132 1250,0 -1251,-13.5132 +1251,13.5132 1252,0 -1253,-13.5132 +1253,13.5132 1254,0 -1255,-13.5132 +1255,13.5132 1256,0 -1257,-13.5132 +1257,13.5132 1258,0 -1259,-13.5132 +1259,13.5132 1260,0 -1261,-13.5132 +1261,13.5132 1262,0 -1263,-13.5132 +1263,13.5132 1264,0 -1265,-13.5132 +1265,13.5132 1266,0 -1267,-13.5132 +1267,13.5132 1268,0 -1269,-13.5132 +1269,13.5132 1270,0 -1271,-13.5132 +1271,13.5132 1272,0 -1273,-13.5132 +1273,13.5132 1274,0 -1275,-13.5132 +1275,13.5132 1276,0 -1277,-13.5132 +1277,13.5132 1278,0 -1279,-13.5132 +1279,13.5132 1280,0 -1281,-8.70193 +1281,8.70193 1282,0 -1283,-8.70193 +1283,8.70193 1284,0 -1285,-8.70193 +1285,8.70193 1286,0 -1287,-8.70193 +1287,8.70193 1288,0 -1289,-8.70193 +1289,8.70193 1290,0 -1291,-8.70193 +1291,8.70193 1292,0 -1293,-8.70193 +1293,8.70193 1294,0 -1295,-8.70193 +1295,8.70193 1296,0 -1297,-8.70193 +1297,8.70193 1298,0 -1299,-8.70193 +1299,8.70193 1300,0 -1301,-8.70193 +1301,8.70193 1302,0 -1303,-8.70193 +1303,8.70193 1304,0 -1305,-8.70193 +1305,8.70193 1306,0 -1307,-8.70193 +1307,8.70193 1308,0 -1309,-8.70193 +1309,8.70193 1310,0 -1311,-8.70193 +1311,8.70193 1312,0 -1313,-9.45429 +1313,9.45429 1314,0 -1315,-9.45429 +1315,9.45429 1316,0 -1317,-9.45429 +1317,9.45429 1318,0 -1319,-9.45429 +1319,9.45429 1320,0 -1321,-9.45429 +1321,9.45429 1322,0 -1323,-9.45429 +1323,9.45429 1324,0 -1325,-9.45429 +1325,9.45429 1326,0 -1327,-9.45429 +1327,9.45429 1328,0 -1329,-9.45429 +1329,9.45429 1330,0 -1331,-9.45429 +1331,9.45429 1332,0 -1333,-9.45429 +1333,9.45429 1334,0 -1335,-9.45429 +1335,9.45429 1336,0 -1337,-9.45429 +1337,9.45429 1338,0 -1339,-9.45429 +1339,9.45429 1340,0 -1341,-9.45429 +1341,9.45429 1342,0 -1343,-9.45429 +1343,9.45429 1344,0 -1345,-15.1315 +1345,15.1315 1346,0 -1347,-15.1315 +1347,15.1315 1348,0 -1349,-15.1315 +1349,15.1315 1350,0 -1351,-15.1315 +1351,15.1315 1352,0 -1353,-15.1315 +1353,15.1315 1354,0 -1355,-15.1315 +1355,15.1315 1356,0 -1357,-15.1315 +1357,15.1315 1358,0 -1359,-15.1315 +1359,15.1315 1360,0 -1361,-15.1315 +1361,15.1315 1362,0 -1363,-15.1315 +1363,15.1315 1364,0 -1365,-15.1315 +1365,15.1315 1366,0 -1367,-15.1315 +1367,15.1315 1368,0 -1369,-15.1315 +1369,15.1315 1370,0 -1371,-15.1315 +1371,15.1315 1372,0 -1373,-15.1315 +1373,15.1315 1374,0 -1375,-15.1315 +1375,15.1315 1376,0 -1377,-14.3197 +1377,14.3197 1378,0 -1379,-14.3197 +1379,14.3197 1380,0 -1381,-14.3197 +1381,14.3197 1382,0 -1383,-14.3197 +1383,14.3197 1384,0 -1385,-14.3197 +1385,14.3197 1386,0 -1387,-14.3197 +1387,14.3197 1388,0 -1389,-14.3197 +1389,14.3197 1390,0 -1391,-14.3197 +1391,14.3197 1392,0 -1393,-14.3197 +1393,14.3197 1394,0 -1395,-14.3197 +1395,14.3197 1396,0 -1397,-14.3197 +1397,14.3197 1398,0 -1399,-14.3197 +1399,14.3197 1400,0 -1401,-14.3197 +1401,14.3197 1402,0 -1403,-14.3197 +1403,14.3197 1404,0 -1405,-14.3197 +1405,14.3197 1406,0 -1407,-14.3197 +1407,14.3197 1408,0 -1409,-8.59418 +1409,8.59418 1410,0 -1411,-8.59418 +1411,8.59418 1412,0 -1413,-8.59418 +1413,8.59418 1414,0 -1415,-8.59418 +1415,8.59418 1416,0 -1417,-8.59418 +1417,8.59418 1418,0 -1419,-8.59418 +1419,8.59418 1420,0 -1421,-8.59418 +1421,8.59418 1422,0 -1423,-8.59418 +1423,8.59418 1424,0 -1425,-8.59418 +1425,8.59418 1426,0 -1427,-8.59418 +1427,8.59418 1428,0 -1429,-8.59418 +1429,8.59418 1430,0 -1431,-8.59418 +1431,8.59418 1432,0 -1433,-8.59418 +1433,8.59418 1434,0 -1435,-8.59418 +1435,8.59418 1436,0 -1437,-8.59418 +1437,8.59418 1438,0 -1439,-8.59418 +1439,8.59418 1440,0 -1441,-9.60307 +1441,9.60307 1442,0 -1443,-9.60307 +1443,9.60307 1444,0 -1445,-9.60307 +1445,9.60307 1446,0 -1447,-9.60307 +1447,9.60307 1448,0 -1449,-9.60307 +1449,9.60307 1450,0 -1451,-9.60307 +1451,9.60307 1452,0 -1453,-9.60307 +1453,9.60307 1454,0 -1455,-9.60307 +1455,9.60307 1456,0 -1457,-9.60307 +1457,9.60307 1458,0 -1459,-9.60307 +1459,9.60307 1460,0 -1461,-9.60307 +1461,9.60307 1462,0 -1463,-9.60307 +1463,9.60307 1464,0 -1465,-9.60307 +1465,9.60307 1466,0 -1467,-9.60307 +1467,9.60307 1468,0 -1469,-9.60307 +1469,9.60307 1470,0 -1471,-9.60307 +1471,9.60307 1472,0 -1473,-6.60789 +1473,6.60789 1474,0 -1475,-6.60789 +1475,6.60789 1476,0 -1477,-6.60789 +1477,6.60789 1478,0 -1479,-6.60789 +1479,6.60789 1480,0 -1481,-6.60789 +1481,6.60789 1482,0 -1483,-6.60789 +1483,6.60789 1484,0 -1485,-6.60789 +1485,6.60789 1486,0 -1487,-6.60789 +1487,6.60789 1488,0 -1489,-6.60789 +1489,6.60789 1490,0 -1491,-6.60789 +1491,6.60789 1492,0 -1493,-6.60789 +1493,6.60789 1494,0 -1495,-6.60789 +1495,6.60789 1496,0 -1497,-6.60789 +1497,6.60789 1498,0 -1499,-6.60789 +1499,6.60789 1500,0 -1501,-6.60789 +1501,6.60789 1502,0 -1503,-6.60789 +1503,6.60789 1504,0 -1505,-12.5184 +1505,12.5184 1506,0 -1507,-12.5184 +1507,12.5184 1508,0 -1509,-12.5184 +1509,12.5184 1510,0 -1511,-12.5184 +1511,12.5184 1512,0 -1513,-12.5184 +1513,12.5184 1514,0 -1515,-12.5184 +1515,12.5184 1516,0 -1517,-12.5184 +1517,12.5184 1518,0 -1519,-12.5184 +1519,12.5184 1520,0 -1521,-12.5184 +1521,12.5184 1522,0 -1523,-12.5184 +1523,12.5184 1524,0 -1525,-12.5184 +1525,12.5184 1526,0 -1527,-12.5184 +1527,12.5184 1528,0 -1529,-12.5184 +1529,12.5184 1530,0 -1531,-12.5184 +1531,12.5184 1532,0 -1533,-12.5184 +1533,12.5184 1534,0 -1535,-12.5184 -1536,-112 -1537,-25.18 -1538,-112 -1539,-25.18 -1540,-112 -1541,-25.18 -1542,-112 -1543,-25.18 -1544,-112 -1545,-25.18 -1546,-112 -1547,-25.18 -1548,-112 -1549,-25.18 -1550,-112 -1551,-25.18 -1552,-112 -1553,-25.18 -1554,-112 -1555,-25.18 -1556,-112 -1557,-25.18 -1558,-112 -1559,-25.18 -1560,-112 -1561,-25.18 -1562,-112 -1563,-25.18 -1564,-112 -1565,-25.18 -1566,-112 -1567,-25.18 -1568,-112.089 -1569,-26.8822 -1570,-112.089 -1571,-26.8822 -1572,-112.089 -1573,-26.8822 -1574,-112.089 -1575,-26.8822 -1576,-112.089 -1577,-26.8822 -1578,-112.089 -1579,-26.8822 -1580,-112.089 -1581,-26.8822 -1582,-112.089 -1583,-26.8822 -1584,-112.089 -1585,-26.8822 -1586,-112.089 -1587,-26.8822 -1588,-112.089 -1589,-26.8822 -1590,-112.089 -1591,-26.8822 -1592,-112.089 -1593,-26.8822 -1594,-112.089 -1595,-26.8822 -1596,-112.089 -1597,-26.8822 -1598,-112.089 -1599,-26.8822 -1600,-112.993 -1601,-26.3162 -1602,-112.993 -1603,-26.3162 -1604,-112.993 -1605,-26.3162 -1606,-112.993 -1607,-26.3162 -1608,-112.993 -1609,-26.3162 -1610,-112.993 -1611,-26.3162 -1612,-112.993 -1613,-26.3162 -1614,-112.993 -1615,-26.3162 -1616,-112.993 -1617,-26.3162 -1618,-112.993 -1619,-26.3162 -1620,-112.993 -1621,-26.3162 -1622,-112.993 -1623,-26.3162 -1624,-112.993 -1625,-26.3162 -1626,-112.993 -1627,-26.3162 -1628,-112.993 -1629,-26.3162 -1630,-112.993 -1631,-26.3162 -1632,-113.005 -1633,-27.5795 -1634,-113.005 -1635,-27.5795 -1636,-113.005 -1637,-27.5795 -1638,-113.005 -1639,-27.5795 -1640,-113.005 -1641,-27.5795 -1642,-113.005 -1643,-27.5795 -1644,-113.005 -1645,-27.5795 -1646,-113.005 -1647,-27.5795 -1648,-113.005 -1649,-27.5795 -1650,-113.005 -1651,-27.5795 -1652,-113.005 -1653,-27.5795 -1654,-113.005 -1655,-27.5795 -1656,-113.005 -1657,-27.5795 -1658,-113.005 -1659,-27.5795 -1660,-113.005 -1661,-27.5795 -1662,-113.005 -1663,-27.5795 -1664,-111.758 -1665,-26.1125 -1666,-111.758 -1667,-26.1125 -1668,-111.758 -1669,-26.1125 -1670,-111.758 -1671,-26.1125 -1672,-111.758 -1673,-26.1125 -1674,-111.758 -1675,-26.1125 -1676,-111.758 -1677,-26.1125 -1678,-111.758 -1679,-26.1125 -1680,-111.758 -1681,-26.1125 -1682,-111.758 -1683,-26.1125 -1684,-111.758 -1685,-26.1125 -1686,-111.758 -1687,-26.1125 -1688,-111.758 -1689,-26.1125 -1690,-111.758 -1691,-26.1125 -1692,-111.758 -1693,-26.1125 -1694,-111.758 -1695,-26.1125 -1696,-111.971 -1697,-26.4388 -1698,-111.971 -1699,-26.4388 -1700,-111.971 -1701,-26.4388 -1702,-111.971 -1703,-26.4388 -1704,-111.971 -1705,-26.4388 -1706,-111.971 -1707,-26.4388 -1708,-111.971 -1709,-26.4388 -1710,-111.971 -1711,-26.4388 -1712,-111.971 -1713,-26.4388 -1714,-111.971 -1715,-26.4388 -1716,-111.971 -1717,-26.4388 -1718,-111.971 -1719,-26.4388 -1720,-111.971 -1721,-26.4388 -1722,-111.971 -1723,-26.4388 -1724,-111.971 -1725,-26.4388 -1726,-111.971 -1727,-26.4388 -1728,-112.772 -1729,-27.6161 -1730,-112.772 -1731,-27.6161 -1732,-112.772 -1733,-27.6161 -1734,-112.772 -1735,-27.6161 -1736,-112.772 -1737,-27.6161 -1738,-112.772 -1739,-27.6161 -1740,-112.772 -1741,-27.6161 -1742,-112.772 -1743,-27.6161 -1744,-112.772 -1745,-27.6161 -1746,-112.772 -1747,-27.6161 -1748,-112.772 -1749,-27.6161 -1750,-112.772 -1751,-27.6161 -1752,-112.772 -1753,-27.6161 -1754,-112.772 -1755,-27.6161 -1756,-112.772 -1757,-27.6161 -1758,-112.772 -1759,-27.6161 -1760,-112.944 -1761,-27.7397 -1762,-112.944 -1763,-27.7397 -1764,-112.944 -1765,-27.7397 -1766,-112.944 -1767,-27.7397 -1768,-112.944 -1769,-27.7397 -1770,-112.944 -1771,-27.7397 -1772,-112.944 -1773,-27.7397 -1774,-112.944 -1775,-27.7397 -1776,-112.944 -1777,-27.7397 -1778,-112.944 -1779,-27.7397 -1780,-112.944 -1781,-27.7397 -1782,-112.944 -1783,-27.7397 -1784,-112.944 -1785,-27.7397 -1786,-112.944 -1787,-27.7397 -1788,-112.944 -1789,-27.7397 -1790,-112.944 -1791,-27.7397 -1792,-9.711 -1793,-34.0805 -1794,-9.711 -1795,-34.0805 -1796,-9.711 -1797,-34.0805 -1798,-9.711 -1799,-34.0805 -1800,-9.711 -1801,-34.0805 -1802,-9.711 -1803,-34.0805 -1804,-9.711 -1805,-34.0805 -1806,-9.711 -1807,-34.0805 -1808,-9.711 -1809,-34.0805 -1810,-9.711 -1811,-34.0805 -1812,-9.711 -1813,-34.0805 -1814,-9.711 -1815,-34.0805 -1816,-9.711 -1817,-34.0805 -1818,-9.711 -1819,-34.0805 -1820,-9.711 -1821,-34.0805 -1822,-9.711 -1823,-34.0805 -1824,-10.633 -1825,-35.2304 -1826,-10.633 -1827,-35.2304 -1828,-10.633 -1829,-35.2304 -1830,-10.633 -1831,-35.2304 -1832,-10.633 -1833,-35.2304 -1834,-10.633 -1835,-35.2304 -1836,-10.633 -1837,-35.2304 -1838,-10.633 -1839,-35.2304 -1840,-10.633 -1841,-35.2304 -1842,-10.633 -1843,-35.2304 -1844,-10.633 -1845,-35.2304 -1846,-10.633 -1847,-35.2304 -1848,-10.633 -1849,-35.2304 -1850,-10.633 -1851,-35.2304 -1852,-10.633 -1853,-35.2304 -1854,-10.633 -1855,-35.2304 -1856,-10.6 -1857,-35.2817 -1858,-10.6 -1859,-35.2817 -1860,-10.6 -1861,-35.2817 -1862,-10.6 -1863,-35.2817 -1864,-10.6 -1865,-35.2817 -1866,-10.6 -1867,-35.2817 -1868,-10.6 -1869,-35.2817 -1870,-10.6 -1871,-35.2817 -1872,-10.6 -1873,-35.2817 -1874,-10.6 -1875,-35.2817 -1876,-10.6 -1877,-35.2817 -1878,-10.6 -1879,-35.2817 -1880,-10.6 -1881,-35.2817 -1882,-10.6 -1883,-35.2817 -1884,-10.6 -1885,-35.2817 -1886,-10.6 -1887,-35.2817 -1888,-11.6641 -1889,-35.6611 -1890,-11.6641 -1891,-35.6611 -1892,-11.6641 -1893,-35.6611 -1894,-11.6641 -1895,-35.6611 -1896,-11.6641 -1897,-35.6611 -1898,-11.6641 -1899,-35.6611 -1900,-11.6641 -1901,-35.6611 -1902,-11.6641 -1903,-35.6611 -1904,-11.6641 -1905,-35.6611 -1906,-11.6641 -1907,-35.6611 -1908,-11.6641 -1909,-35.6611 -1910,-11.6641 -1911,-35.6611 -1912,-11.6641 -1913,-35.6611 -1914,-11.6641 -1915,-35.6611 -1916,-11.6641 -1917,-35.6611 -1918,-11.6641 -1919,-35.6611 -1920,-9.6382 -1921,-33.5254 -1922,-9.6382 -1923,-33.5254 -1924,-9.6382 -1925,-33.5254 -1926,-9.6382 -1927,-33.5254 -1928,-9.6382 -1929,-33.5254 -1930,-9.6382 -1931,-33.5254 -1932,-9.6382 -1933,-33.5254 -1934,-9.6382 -1935,-33.5254 -1936,-9.6382 -1937,-33.5254 -1938,-9.6382 -1939,-33.5254 -1940,-9.6382 -1941,-33.5254 -1942,-9.6382 -1943,-33.5254 -1944,-9.6382 -1945,-33.5254 -1946,-9.6382 -1947,-33.5254 -1948,-9.6382 -1949,-33.5254 -1950,-9.6382 -1951,-33.5254 -1952,-9.29078 -1953,-35.6892 -1954,-9.29078 -1955,-35.6892 -1956,-9.29078 -1957,-35.6892 -1958,-9.29078 -1959,-35.6892 -1960,-9.29078 -1961,-35.6892 -1962,-9.29078 -1963,-35.6892 -1964,-9.29078 -1965,-35.6892 -1966,-9.29078 -1967,-35.6892 -1968,-9.29078 -1969,-35.6892 -1970,-9.29078 -1971,-35.6892 -1972,-9.29078 -1973,-35.6892 -1974,-9.29078 -1975,-35.6892 -1976,-9.29078 -1977,-35.6892 -1978,-9.29078 -1979,-35.6892 -1980,-9.29078 -1981,-35.6892 -1982,-9.29078 -1983,-35.6892 -1984,-10.2681 -1985,-34.8443 -1986,-10.2681 -1987,-34.8443 -1988,-10.2681 -1989,-34.8443 -1990,-10.2681 -1991,-34.8443 -1992,-10.2681 -1993,-34.8443 -1994,-10.2681 -1995,-34.8443 -1996,-10.2681 -1997,-34.8443 -1998,-10.2681 -1999,-34.8443 -2000,-10.2681 -2001,-34.8443 -2002,-10.2681 -2003,-34.8443 -2004,-10.2681 -2005,-34.8443 -2006,-10.2681 -2007,-34.8443 -2008,-10.2681 -2009,-34.8443 -2010,-10.2681 -2011,-34.8443 -2012,-10.2681 -2013,-34.8443 -2014,-10.2681 -2015,-34.8443 -2016,-10.8294 -2017,-36.0505 -2018,-10.8294 -2019,-36.0505 -2020,-10.8294 -2021,-36.0505 -2022,-10.8294 -2023,-36.0505 -2024,-10.8294 -2025,-36.0505 -2026,-10.8294 -2027,-36.0505 -2028,-10.8294 -2029,-36.0505 -2030,-10.8294 -2031,-36.0505 -2032,-10.8294 -2033,-36.0505 -2034,-10.8294 -2035,-36.0505 -2036,-10.8294 -2037,-36.0505 -2038,-10.8294 -2039,-36.0505 -2040,-10.8294 -2041,-36.0505 -2042,-10.8294 -2043,-36.0505 -2044,-10.8294 -2045,-36.0505 -2046,-10.8294 -2047,-36.0505 +1535,12.5184 +1536,112 +1537,25.18 +1538,112 +1539,25.18 +1540,112 +1541,25.18 +1542,112 +1543,25.18 +1544,112 +1545,25.18 +1546,112 +1547,25.18 +1548,112 +1549,25.18 +1550,112 +1551,25.18 +1552,112 +1553,25.18 +1554,112 +1555,25.18 +1556,112 +1557,25.18 +1558,112 +1559,25.18 +1560,112 +1561,25.18 +1562,112 +1563,25.18 +1564,112 +1565,25.18 +1566,112 +1567,25.18 +1568,112.089 +1569,26.8822 +1570,112.089 +1571,26.8822 +1572,112.089 +1573,26.8822 +1574,112.089 +1575,26.8822 +1576,112.089 +1577,26.8822 +1578,112.089 +1579,26.8822 +1580,112.089 +1581,26.8822 +1582,112.089 +1583,26.8822 +1584,112.089 +1585,26.8822 +1586,112.089 +1587,26.8822 +1588,112.089 +1589,26.8822 +1590,112.089 +1591,26.8822 +1592,112.089 +1593,26.8822 +1594,112.089 +1595,26.8822 +1596,112.089 +1597,26.8822 +1598,112.089 +1599,26.8822 +1600,112.993 +1601,26.3162 +1602,112.993 +1603,26.3162 +1604,112.993 +1605,26.3162 +1606,112.993 +1607,26.3162 +1608,112.993 +1609,26.3162 +1610,112.993 +1611,26.3162 +1612,112.993 +1613,26.3162 +1614,112.993 +1615,26.3162 +1616,112.993 +1617,26.3162 +1618,112.993 +1619,26.3162 +1620,112.993 +1621,26.3162 +1622,112.993 +1623,26.3162 +1624,112.993 +1625,26.3162 +1626,112.993 +1627,26.3162 +1628,112.993 +1629,26.3162 +1630,112.993 +1631,26.3162 +1632,113.005 +1633,27.5795 +1634,113.005 +1635,27.5795 +1636,113.005 +1637,27.5795 +1638,113.005 +1639,27.5795 +1640,113.005 +1641,27.5795 +1642,113.005 +1643,27.5795 +1644,113.005 +1645,27.5795 +1646,113.005 +1647,27.5795 +1648,113.005 +1649,27.5795 +1650,113.005 +1651,27.5795 +1652,113.005 +1653,27.5795 +1654,113.005 +1655,27.5795 +1656,113.005 +1657,27.5795 +1658,113.005 +1659,27.5795 +1660,113.005 +1661,27.5795 +1662,113.005 +1663,27.5795 +1664,111.758 +1665,26.1125 +1666,111.758 +1667,26.1125 +1668,111.758 +1669,26.1125 +1670,111.758 +1671,26.1125 +1672,111.758 +1673,26.1125 +1674,111.758 +1675,26.1125 +1676,111.758 +1677,26.1125 +1678,111.758 +1679,26.1125 +1680,111.758 +1681,26.1125 +1682,111.758 +1683,26.1125 +1684,111.758 +1685,26.1125 +1686,111.758 +1687,26.1125 +1688,111.758 +1689,26.1125 +1690,111.758 +1691,26.1125 +1692,111.758 +1693,26.1125 +1694,111.758 +1695,26.1125 +1696,111.971 +1697,26.4388 +1698,111.971 +1699,26.4388 +1700,111.971 +1701,26.4388 +1702,111.971 +1703,26.4388 +1704,111.971 +1705,26.4388 +1706,111.971 +1707,26.4388 +1708,111.971 +1709,26.4388 +1710,111.971 +1711,26.4388 +1712,111.971 +1713,26.4388 +1714,111.971 +1715,26.4388 +1716,111.971 +1717,26.4388 +1718,111.971 +1719,26.4388 +1720,111.971 +1721,26.4388 +1722,111.971 +1723,26.4388 +1724,111.971 +1725,26.4388 +1726,111.971 +1727,26.4388 +1728,112.772 +1729,27.6161 +1730,112.772 +1731,27.6161 +1732,112.772 +1733,27.6161 +1734,112.772 +1735,27.6161 +1736,112.772 +1737,27.6161 +1738,112.772 +1739,27.6161 +1740,112.772 +1741,27.6161 +1742,112.772 +1743,27.6161 +1744,112.772 +1745,27.6161 +1746,112.772 +1747,27.6161 +1748,112.772 +1749,27.6161 +1750,112.772 +1751,27.6161 +1752,112.772 +1753,27.6161 +1754,112.772 +1755,27.6161 +1756,112.772 +1757,27.6161 +1758,112.772 +1759,27.6161 +1760,112.944 +1761,27.7397 +1762,112.944 +1763,27.7397 +1764,112.944 +1765,27.7397 +1766,112.944 +1767,27.7397 +1768,112.944 +1769,27.7397 +1770,112.944 +1771,27.7397 +1772,112.944 +1773,27.7397 +1774,112.944 +1775,27.7397 +1776,112.944 +1777,27.7397 +1778,112.944 +1779,27.7397 +1780,112.944 +1781,27.7397 +1782,112.944 +1783,27.7397 +1784,112.944 +1785,27.7397 +1786,112.944 +1787,27.7397 +1788,112.944 +1789,27.7397 +1790,112.944 +1791,27.7397 +1792,9.711 +1793,34.0805 +1794,9.711 +1795,34.0805 +1796,9.711 +1797,34.0805 +1798,9.711 +1799,34.0805 +1800,9.711 +1801,34.0805 +1802,9.711 +1803,34.0805 +1804,9.711 +1805,34.0805 +1806,9.711 +1807,34.0805 +1808,9.711 +1809,34.0805 +1810,9.711 +1811,34.0805 +1812,9.711 +1813,34.0805 +1814,9.711 +1815,34.0805 +1816,9.711 +1817,34.0805 +1818,9.711 +1819,34.0805 +1820,9.711 +1821,34.0805 +1822,9.711 +1823,34.0805 +1824,10.633 +1825,35.2304 +1826,10.633 +1827,35.2304 +1828,10.633 +1829,35.2304 +1830,10.633 +1831,35.2304 +1832,10.633 +1833,35.2304 +1834,10.633 +1835,35.2304 +1836,10.633 +1837,35.2304 +1838,10.633 +1839,35.2304 +1840,10.633 +1841,35.2304 +1842,10.633 +1843,35.2304 +1844,10.633 +1845,35.2304 +1846,10.633 +1847,35.2304 +1848,10.633 +1849,35.2304 +1850,10.633 +1851,35.2304 +1852,10.633 +1853,35.2304 +1854,10.633 +1855,35.2304 +1856,10.6 +1857,35.2817 +1858,10.6 +1859,35.2817 +1860,10.6 +1861,35.2817 +1862,10.6 +1863,35.2817 +1864,10.6 +1865,35.2817 +1866,10.6 +1867,35.2817 +1868,10.6 +1869,35.2817 +1870,10.6 +1871,35.2817 +1872,10.6 +1873,35.2817 +1874,10.6 +1875,35.2817 +1876,10.6 +1877,35.2817 +1878,10.6 +1879,35.2817 +1880,10.6 +1881,35.2817 +1882,10.6 +1883,35.2817 +1884,10.6 +1885,35.2817 +1886,10.6 +1887,35.2817 +1888,11.6641 +1889,35.6611 +1890,11.6641 +1891,35.6611 +1892,11.6641 +1893,35.6611 +1894,11.6641 +1895,35.6611 +1896,11.6641 +1897,35.6611 +1898,11.6641 +1899,35.6611 +1900,11.6641 +1901,35.6611 +1902,11.6641 +1903,35.6611 +1904,11.6641 +1905,35.6611 +1906,11.6641 +1907,35.6611 +1908,11.6641 +1909,35.6611 +1910,11.6641 +1911,35.6611 +1912,11.6641 +1913,35.6611 +1914,11.6641 +1915,35.6611 +1916,11.6641 +1917,35.6611 +1918,11.6641 +1919,35.6611 +1920,9.6382 +1921,33.5254 +1922,9.6382 +1923,33.5254 +1924,9.6382 +1925,33.5254 +1926,9.6382 +1927,33.5254 +1928,9.6382 +1929,33.5254 +1930,9.6382 +1931,33.5254 +1932,9.6382 +1933,33.5254 +1934,9.6382 +1935,33.5254 +1936,9.6382 +1937,33.5254 +1938,9.6382 +1939,33.5254 +1940,9.6382 +1941,33.5254 +1942,9.6382 +1943,33.5254 +1944,9.6382 +1945,33.5254 +1946,9.6382 +1947,33.5254 +1948,9.6382 +1949,33.5254 +1950,9.6382 +1951,33.5254 +1952,9.29078 +1953,35.6892 +1954,9.29078 +1955,35.6892 +1956,9.29078 +1957,35.6892 +1958,9.29078 +1959,35.6892 +1960,9.29078 +1961,35.6892 +1962,9.29078 +1963,35.6892 +1964,9.29078 +1965,35.6892 +1966,9.29078 +1967,35.6892 +1968,9.29078 +1969,35.6892 +1970,9.29078 +1971,35.6892 +1972,9.29078 +1973,35.6892 +1974,9.29078 +1975,35.6892 +1976,9.29078 +1977,35.6892 +1978,9.29078 +1979,35.6892 +1980,9.29078 +1981,35.6892 +1982,9.29078 +1983,35.6892 +1984,10.2681 +1985,34.8443 +1986,10.2681 +1987,34.8443 +1988,10.2681 +1989,34.8443 +1990,10.2681 +1991,34.8443 +1992,10.2681 +1993,34.8443 +1994,10.2681 +1995,34.8443 +1996,10.2681 +1997,34.8443 +1998,10.2681 +1999,34.8443 +2000,10.2681 +2001,34.8443 +2002,10.2681 +2003,34.8443 +2004,10.2681 +2005,34.8443 +2006,10.2681 +2007,34.8443 +2008,10.2681 +2009,34.8443 +2010,10.2681 +2011,34.8443 +2012,10.2681 +2013,34.8443 +2014,10.2681 +2015,34.8443 +2016,10.8294 +2017,36.0505 +2018,10.8294 +2019,36.0505 +2020,10.8294 +2021,36.0505 +2022,10.8294 +2023,36.0505 +2024,10.8294 +2025,36.0505 +2026,10.8294 +2027,36.0505 +2028,10.8294 +2029,36.0505 +2030,10.8294 +2031,36.0505 +2032,10.8294 +2033,36.0505 +2034,10.8294 +2035,36.0505 +2036,10.8294 +2037,36.0505 +2038,10.8294 +2039,36.0505 +2040,10.8294 +2041,36.0505 +2042,10.8294 +2043,36.0505 +2044,10.8294 +2045,36.0505 +2046,10.8294 +2047,36.0505 diff --git a/CRVConditions/data/status_extracted_20260214.txt b/CRVConditions/data/status_extracted_20260214.txt deleted file mode 100644 index 06380bb48a..0000000000 --- a/CRVConditions/data/status_extracted_20260214.txt +++ /dev/null @@ -1,10 +0,0 @@ -TABLE CRVBadChan -#A channel can have more than one status bit. Add all status bits for the complete status. -#status 1 (bit 0): not connected -#status 2 (bit 1): ignore channel in reconstruction -#status 4 (bit 2): no data -#status 8 (bit 3): no pedestal -#status 16 (bit 4): no calibration constant -#status 32 (bit 5): noisy -#channel,status -1107,3 From 574ea7d265257592f659755dd14bfdbfe54e9a1b Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Wed, 25 Feb 2026 13:36:17 -0600 Subject: [PATCH 171/174] in EventDisplay: printing out volume index, if volume name is missing --- EventDisplay/src/DataInterface.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index 4dbe9687f5..c56a642010 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -1141,8 +1141,8 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS int trackclassindex=trackInfos[i].index; std::string particlecollection=trackInfos[i].entryText; std::string particlename=ptable->particle(particle.pdgId()).name(); - std::string startVolumeName="unknown volume"; - std::string endVolumeName="unknown volume"; + std::string startVolumeName="volume index "+std::to_string(particle.startVolumeIndex()); + std::string endVolumeName="volume index "+std::to_string(particle.endVolumeIndex()); if(physicalVolumesMulti!=nullptr) { mu2e::PhysicalVolumeMultiHelper volumeMultiHelper(physicalVolumesMulti); From 6db6b8d25e9979712b0be55bf71a60a8a664a42e Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Wed, 25 Feb 2026 18:20:45 -0600 Subject: [PATCH 172/174] changed some ints to size_ts in EventDisplay. changed some print outs in CRV DAQ decoder --- CRVReco/fcl/prolog_v12.fcl | 1 - CRVReco/src/CrvRecoPulsesFinder_module.cc | 2 +- ...CrvDigisFromArtdaqFragmentsFEBII_module.cc | 28 ++++++++-- EventDisplay/fcl/EventDisplayExtracted.fcl | 2 +- EventDisplay/src/DataInterface.cc | 51 ++++++++++--------- EventDisplay/src/DataInterface.h | 8 +-- EventDisplay/src/EventDisplay_module.cc | 2 +- 7 files changed, 57 insertions(+), 37 deletions(-) diff --git a/CRVReco/fcl/prolog_v12.fcl b/CRVReco/fcl/prolog_v12.fcl index af583332c9..fd83b2f093 100644 --- a/CRVReco/fcl/prolog_v12.fcl +++ b/CRVReco/fcl/prolog_v12.fcl @@ -64,7 +64,6 @@ BEGIN_PROLOG //-if a database table of a random gaussian distribution of time offsets // with a sigma equal to 1ns is used and one wants to run a simulation with a sigma of 0.5ns, // then the scale factor should be set to 0.5 (i.e. scaled to a sigma of 50%) - //note: if measured time offsets are used, the cutoffs should be set to the maximum values ignoreChannels : true //ignore channels that have status bit 1 ("ignore channels") in CRVstatus DB } diff --git a/CRVReco/src/CrvRecoPulsesFinder_module.cc b/CRVReco/src/CrvRecoPulsesFinder_module.cc index 391704fdf3..3ab2e942ca 100644 --- a/CRVReco/src/CrvRecoPulsesFinder_module.cc +++ b/CRVReco/src/CrvRecoPulsesFinder_module.cc @@ -202,7 +202,7 @@ namespace mu2e } double pedestal = calib.pedestal(channel); - double pedestalFromDB = true; + bool pedestalFromDB = true; if(pedestal-((float)ADCs.at(0))>_pedestalUndershootThreshold) //pulse seems to be in an undershoot. get pedestal from 1st ADC sample instead of DB. { pedestal=ADCs.at(0); diff --git a/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc b/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc index aa546dc244..89b3a5adf8 100644 --- a/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc +++ b/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc @@ -103,6 +103,11 @@ namespace mu2e mu2e::DTCEventFragment dtcEventFragment(artFragment); ++iFragment; + if(_diagLevel>3) + { + std::cout << std::dec << "Fragment index: " << iFragment << std::endl; + } + //collect sub events auto dtcSubEvents = dtcEventFragment.getSubsystemData(DTCLib::DTC_Subsystem::DTC_Subsystem_CRV); if(_useSubsystem0) @@ -111,18 +116,28 @@ namespace mu2e dtcSubEvents.insert(dtcSubEvents.end(),dtcSubEventsTmp.begin(),dtcSubEventsTmp.end()); //temporarily add fragments with wrongly encoded headers } + if(dtcSubEvents.empty()) + { + if(_diagLevel>3) + { + std::cout << "This fragment has no CRV subEvents. Size: " << dtcEventFragment.getData().GetEventByteCount() << std::endl; + } + continue; + } + //check for errors const DTCLib::DTC_Event &dtcEvent = dtcEventFragment.getData(); size_t expectedSize = dtcEvent.GetEventByteCount(); size_t actualSize = sizeof(DTCLib::DTC_EventHeader); for(size_t iSubEvent=0; iSubEvent1) + if(_diagLevel>3) { - std::cout << "Fragment index: " << iFragment << " expected event size: " << expectedSize << ", actual event size: " << actualSize << " "; - std::cout << "Number of subEvents: " << dtcSubEvents.size() << std::endl; + std::cout << "Number of subEvents: " << dtcSubEvents.size() << " Size: " << expectedSize << std::endl; } if(expectedSize!=actualSize) { + std::cout << std::dec << "Run/Subrun/Event: " << event.run() << "/" << event.subRun() << "/" << eventNumber << std::endl; + std::cout << "Fragment index: " << iFragment << " expected event size: " << expectedSize << ", actual event size: " << actualSize << " "; std::cerr << "mismatch between expected event size and actual event size!" << std::endl; crvDaqErrors->emplace_back(mu2e::CrvDAQerrorCode::byteCountMismatch,iFragment,0,0,0); } @@ -138,6 +153,7 @@ namespace mu2e auto block = decoder.dataAtBlockIndex(iDataBlock); if(block == nullptr) { + std::cout << std::dec << "Run/Subrun/Event: " << event.run() << "/" << event.subRun() << "/" << eventNumber << std::endl; std::cerr << "iSubEvent/iDataBlock: " << iSubEvent << "/" << iDataBlock << std::endl; std::cerr << "Unable to retrieve data block." << std::endl; crvDaqErrors->emplace_back(mu2e::CrvDAQerrorCode::unableToGetDataBlock,iFragment,iSubEvent,iDataBlock,0); @@ -147,6 +163,7 @@ namespace mu2e auto header = block->GetHeader(); if(!header->isValid()) { + std::cout << std::dec << "Run/Subrun/Event: " << event.run() << "/" << event.subRun() << "/" << eventNumber << std::endl; std::cerr << "iSubEvent/iDataBlock: " << iSubEvent << "/" << iDataBlock << std::endl; std::cerr << "CRV packet is not valid." << std::endl; std::cerr << "sub system ID: "<<(uint16_t)header->GetSubsystemID()<<" packet count: "<GetPacketCount() << std::endl; @@ -156,7 +173,7 @@ namespace mu2e if(header->GetSubsystemID() != DTCLib::DTC_Subsystem::DTC_Subsystem_CRV) { - if(_diagLevel>0) + if(_diagLevel>2) { std::cout << "iSubEvent/iDataBlock: " << iSubEvent << "/" << iDataBlock << std::endl; std::cout << "CRV packet does not have subsystem ID 2." << std::endl; @@ -178,6 +195,7 @@ namespace mu2e auto crvRocHeader = decoder.GetCRVROCStatusPacketFEBII(iDataBlock); if(crvRocHeader == nullptr) { + std::cout << std::dec << "Run/Subrun/Event: " << event.run() << "/" << event.subRun() << "/" << eventNumber << std::endl; std::cerr << "iSubEvent/iDataBlock: " << iSubEvent << "/" << iDataBlock << std::endl; std::cerr << "Error retrieving CRV ROC Status Packet" << std::endl; crvDaqErrors->emplace_back(mu2e::CrvDAQerrorCode::errorUnpackingStatusPacket,iFragment,iSubEvent,iDataBlock,header->GetPacketCount()); @@ -188,6 +206,7 @@ namespace mu2e auto crvHits = decoder.GetCRVHitRangeFEBII(iDataBlock); if(crvHits.error()) { + std::cout << std::dec << "Run/Subrun/Event: " << event.run() << "/" << event.subRun() << "/" << eventNumber << std::endl; std::cerr << "iSubEvent/iDataBlock: " << iSubEvent << "/" << iDataBlock << std::endl; std::cerr << "Error unpacking of CRV Hits" << std::endl; decoder.PrintBlockFEBII(iDataBlock); @@ -207,6 +226,7 @@ namespace mu2e //don't decode them, since there is no match to any offline channel. if(rocPort==0) //corrupted data { + std::cout << std::dec << "Run/Subrun/Event: " << event.run() << "/" << event.subRun() << "/" << eventNumber << std::endl; std::cerr << "iSubEvent/iDataBlock: " << iSubEvent << "/" << iDataBlock << std::endl; std::cerr << "ROC-port-0 error!" << std::endl; decoder.PrintBlockFEBII(iDataBlock); diff --git a/EventDisplay/fcl/EventDisplayExtracted.fcl b/EventDisplay/fcl/EventDisplayExtracted.fcl index 64ad5935b0..b977407d76 100644 --- a/EventDisplay/fcl/EventDisplayExtracted.fcl +++ b/EventDisplay/fcl/EventDisplayExtracted.fcl @@ -4,5 +4,5 @@ physics.analyzers.eventdisplay.extracted : true services.GeometryService.inputFile : "Offline/Mu2eG4/geom/geom_common_extracted.txt" services.ProditionsService.crvCalib.useDb : true services.ProditionsService.crvStatus.useDb : true -#comment out this line, if displaying simulated events +#enable this line, if displaying simulated events #services.DbService.textFile : ["Offline/CRVConditions/data/status_extracted_20260221.txt","Offline/CRVConditions/data/calib_extracted_20260221.txt"] diff --git a/EventDisplay/src/DataInterface.cc b/EventDisplay/src/DataInterface.cc index c56a642010..581c33e157 100644 --- a/EventDisplay/src/DataInterface.cc +++ b/EventDisplay/src/DataInterface.cc @@ -8,6 +8,7 @@ using namespace std; #include "Offline/CalorimeterGeom/inc/Calorimeter.hh" #include "Offline/CosmicRayShieldGeom/inc/CosmicRayShield.hh" #include "Offline/CRVConditions/inc/CRVDigitizationPeriod.hh" +#include "Offline/DataProducts/inc/CRVId.hh" #include "Offline/DetectorSolenoidGeom/inc/DetectorSolenoid.hh" #include "Offline/EventDisplay/src/Cube.h" #include "Offline/EventDisplay/src/Cylinder.h" @@ -247,7 +248,7 @@ void DataInterface::fillGeometry() int idLayer = s.id().getLayer(); int idPanel = s.id().getPanel(); int idPlane = s.id().getPlane(); - int id = s.id().asUint16(); + size_t id = s.id().asUint16(); boost::shared_ptr info(new ComponentInfo()); std::string c=Form("Straw %i Layer %i Panel %i Plane %i",idStraw,idLayer,idPanel,idPlane); @@ -385,7 +386,7 @@ void DataInterface::fillGeometry() double crystalDiskLogOffset = frontPanelHalfThick - zHalfBP; - int icrystal=0; + size_t icrystal=0; for(unsigned int idisk=0; idisknDisks(); idisk++) { CLHEP::Hep3Vector diskPos = calo->disk(idisk).geomInfo().origin() - _detSysOrigin; @@ -531,7 +532,7 @@ void DataInterface::fillGeometry() for (int ib = 0; ib < nBars; ++ib) { mu2e::CRSScintillatorBar const & bar = layer.getBar(ib); - int index = bar.index().asInt(); + size_t index = bar.index().asUint(); CLHEP::Hep3Vector barOffset = bar.getPosition() - _detSysOrigin; double x=barOffset.x(); double y=barOffset.y(); @@ -541,7 +542,7 @@ void DataInterface::fillGeometry() findBoundaryP(_crvMinmax, x-dx, y-dy, z-dz); boost::shared_ptr info(new ComponentInfo()); - std::string c=Form("CRV Scintillator %s module %i layer %i bar %i (index %i)",shieldName.c_str(),im,il,ib, index); + std::string c=Form("CRV Scintillator %s module %i layer %i bar %i (index %lu)",shieldName.c_str(),im,il,ib, index); info->setName(c.c_str()); info->setText(0,c.c_str()); info->setText(1,Form("Dimension x: %.f mm, y: %.f mm, z: %.f mm",2.0*dx/CLHEP::mm,2.0*dy/CLHEP::mm,2.0*dz/CLHEP::mm)); @@ -608,7 +609,7 @@ void DataInterface::makeOtherStructuresVisible(bool visible) void DataInterface::makeCrvScintillatorBarsVisible(bool visible) { - std::map >::const_iterator crvbars; + std::map >::const_iterator crvbars; for(crvbars=_crvscintillatorbars.begin(); crvbars!=_crvscintillatorbars.end(); crvbars++) { crvbars->second->makeGeometryVisible(visible); @@ -620,19 +621,19 @@ void DataInterface::makeCrvScintillatorBarsVisible(bool visible) void DataInterface::toForeground() { - std::map >::const_iterator straw; + std::map >::const_iterator straw; for(straw=_straws.begin(); straw!=_straws.end(); straw++) { straw->second->toForeground(); } - std::map >::const_iterator crystal; + std::map >::const_iterator crystal; for(crystal=_crystals.begin(); crystal!=_crystals.end(); crystal++) { crystal->second->toForeground(); } - std::map >::const_iterator crvbar; + std::map >::const_iterator crvbar; for(crvbar=_crvscintillatorbars.begin(); crvbar!=_crvscintillatorbars.end(); crvbar++) { crvbar->second->toForeground(); @@ -842,11 +843,11 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(iter=steppointMChits->begin(); iter!=steppointMChits->end(); iter++) { const mu2e::StepPointMC& hit = *iter; - int sid = hit.strawId().asUint16(); + size_t sid = hit.strawId().asUint16(); int trackid = hit.trackId().asInt(); double time = hit.time(); double energy = hit.eDep(); - std::map >::iterator straw=_straws.find(sid); + std::map >::iterator straw=_straws.find(sid); if(straw!=_straws.end() && !std::isnan(time)) { double previousStartTime=straw->second->getStartTime(); @@ -878,11 +879,11 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(iter=strawhits->begin(); iter!=strawhits->end(); iter++, hitnumber++) { const mu2e::StrawHit& hit = *iter; - int sid = hit.strawId().asUint16(); + size_t sid = hit.strawId().asUint16(); double time = hit.time(); double dt = hit.dt(); double energy = hit.energyDep(); - std::map >::iterator straw=_straws.find(sid); + std::map >::iterator straw=_straws.find(sid); if(straw!=_straws.end() && !std::isnan(time)) { double previousStartTime=straw->second->getStartTime(); @@ -916,10 +917,10 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(size_t j=0; j >::iterator straw=_straws.find(sid); + std::map >::iterator straw=_straws.find(sid); if(straw!=_straws.end() && !std::isnan(time)) { double previousStartTime=straw->second->getStartTime(); @@ -948,11 +949,11 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(iter=calosteppoints->begin(); iter!=calosteppoints->end(); iter++) { const mu2e::StepPointMC& calohit = *iter; - int crystalid = calohit.volumeId(); + size_t crystalid = calohit.volumeId(); int trackid = calohit.trackId().asInt(); double time = calohit.time(); double energy = calohit.eDep(); - std::map >::iterator crystal=_crystals.find(crystalid); + std::map >::iterator crystal=_crystals.find(crystalid); if(crystal!=_crystals.end() && !std::isnan(time)) { double previousStartTime=crystal->second->getStartTime(); @@ -983,11 +984,11 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(iter=calohits->begin(); iter!=calohits->end(); iter++) { const mu2e::CaloHit& calohit = *iter; - int crystalid = calohit.crystalID(); + size_t crystalid = static_cast(calohit.crystalID()); double time = calohit.time(); double energy = calohit.energyDep(); - std::map >::iterator crystal=_crystals.find(crystalid); + std::map >::iterator crystal=_crystals.find(crystalid); if(crystal!=_crystals.end() && !std::isnan(time)) { double previousStartTime=crystal->second->getStartTime(); @@ -1009,7 +1010,7 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS } //CRV waveforms - for(std::map >::iterator crvbar=_crvscintillatorbars.begin(); crvbar!=_crvscintillatorbars.end(); crvbar++) + for(std::map >::iterator crvbar=_crvscintillatorbars.begin(); crvbar!=_crvscintillatorbars.end(); crvbar++) { crvbar->second->getComponentInfo()->getHistVector().clear(); } @@ -1023,12 +1024,12 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(size_t j=0; jsize(); j++) { mu2e::CrvDigi const& digi(crvDigis->at(j)); - int index = digi.GetScintillatorBarIndex().asInt(); + size_t index = digi.GetScintillatorBarIndex().asUint(); int sipm = digi.GetSiPMNumber(); - size_t channel = index*4 + sipm; + size_t channel = index*mu2e::CRVId::nChanPerBar + sipm; double timeOffset = _calib->timeOffset(channel); std::string multigraphName = Form("Waveform (%s) SiPM %i",moduleLabel.c_str(),sipm); - std::map >::iterator crvbar=_crvscintillatorbars.find(index); + std::map >::iterator crvbar=_crvscintillatorbars.find(index); if(crvbar!=_crvscintillatorbars.end()) { //each digi collection and each SiPM gets its own multigraph @@ -1066,15 +1067,15 @@ void DataInterface::fillEvent(boost::shared_ptr const &contentS for(size_t i=0; isize(); i++) { const mu2e::CrvRecoPulse &recoPulse = crvRecoPulses->at(i); - int index = recoPulse.GetScintillatorBarIndex().asInt(); + size_t index = recoPulse.GetScintillatorBarIndex().asUint(); int sipm = recoPulse.GetSiPMNumber(); double time = recoPulse.GetPulseTime(); int PEs = recoPulse.GetPEs(); - size_t channel = index*4 + sipm; + size_t channel = index*mu2e::CRVId::nChanPerBar + sipm; double recoPulsePedestal = _calib->pedestal(channel); - std::map >::iterator crvbar=_crvscintillatorbars.find(index); + std::map >::iterator crvbar=_crvscintillatorbars.find(index); if(crvbar!=_crvscintillatorbars.end() && !std::isnan(time)) { double previousStartTime=crvbar->second->getStartTime(); diff --git a/EventDisplay/src/DataInterface.h b/EventDisplay/src/DataInterface.h index 7fab399b6a..5fa07fba8a 100644 --- a/EventDisplay/src/DataInterface.h +++ b/EventDisplay/src/DataInterface.h @@ -61,10 +61,10 @@ class DataInterface //ROOT needs a bare pointer to this object when dealing //with context menus (the function which gets called //from the context menu belongs to this object) - std::list > _components; - std::map > _straws; - std::map > _crystals; - std::map > _crvscintillatorbars; + std::list > _components; + std::map > _straws; + std::map > _crystals; + std::map > _crvscintillatorbars; std::vector > _hits; std::vector > _crystalhits; std::vector > _driftradii; diff --git a/EventDisplay/src/EventDisplay_module.cc b/EventDisplay/src/EventDisplay_module.cc index 7a636a383e..e1b4ef3e53 100644 --- a/EventDisplay/src/EventDisplay_module.cc +++ b/EventDisplay/src/EventDisplay_module.cc @@ -95,7 +95,7 @@ namespace mu2e { int eventNumber=event.id().event(); if(eventNumber==eventToFind) _frame->setEvent(event,_firstLoop,calib); - else std::cout<<"event skipped, since this is not the event we are looking for"< Date: Wed, 25 Feb 2026 20:08:30 -0600 Subject: [PATCH 173/174] changed print out for CRV DAQ decoder --- DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc b/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc index 89b3a5adf8..520cd05557 100644 --- a/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc +++ b/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc @@ -35,7 +35,6 @@ namespace mu2e { fhicl::Atom diagLevel{fhicl::Name("diagLevel"), fhicl::Comment("diagnostic Level")}; //for currently wrongly encoded subevent headers - fhicl::Atom useSubsystem0{fhicl::Name("useSubsystem0"), fhicl::Comment("consider subevents encoded with subsystem 0")}; fhicl::Atom produceZS{fhicl::Name("produceZS"), fhicl::Comment("produce NZS digi collection"), true}; fhicl::Atom produceNZS{fhicl::Name("produceNZS"), fhicl::Comment("produce NZS digi collection"), true}; }; @@ -46,7 +45,6 @@ namespace mu2e private: int _diagLevel; - bool _useSubsystem0; bool _produceZS; bool _produceNZS; mu2e::ProditionsHandle _channelMap_h; @@ -55,7 +53,6 @@ namespace mu2e CrvDigisFromArtdaqFragmentsFEBII::CrvDigisFromArtdaqFragmentsFEBII(const art::EDProducer::Table& config) : art::EDProducer{config}, _diagLevel(config().diagLevel()), - _useSubsystem0(config().useSubsystem0()), _produceZS(config().produceZS()), _produceNZS(config().produceNZS()) { @@ -110,17 +107,16 @@ namespace mu2e //collect sub events auto dtcSubEvents = dtcEventFragment.getSubsystemData(DTCLib::DTC_Subsystem::DTC_Subsystem_CRV); - if(_useSubsystem0) - { - auto dtcSubEventsTmp = dtcEventFragment.getSubsystemData(DTCLib::DTC_Subsystem::DTC_Subsystem_Tracker); //currently wrongly encoded in the DTC Subevent header - dtcSubEvents.insert(dtcSubEvents.end(),dtcSubEventsTmp.begin(),dtcSubEventsTmp.end()); //temporarily add fragments with wrongly encoded headers - } - if(dtcSubEvents.empty()) { if(_diagLevel>3) { std::cout << "This fragment has no CRV subEvents. Size: " << dtcEventFragment.getData().GetEventByteCount() << std::endl; + size_t nSubEvents = dtcEventFragment.getData().GetSubEvents().size(); + if(nSubEvents>0) + { + std::cout << "It has " << nSubEvents << " subEvents of subsystem ID " << (int)dtcEventFragment.getData().GetSubEvents().at(0).GetSubsystem() << std::endl; + } } continue; } From e845b1fca16c0f0795dbf31c683431cca12b0b91 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Thu, 26 Feb 2026 16:11:08 -0600 Subject: [PATCH 174/174] Add cos(theta) restriction to RPC gun --- EventGenerator/src/RPCGun_module.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/EventGenerator/src/RPCGun_module.cc b/EventGenerator/src/RPCGun_module.cc index c957c34cc2..a6a869a788 100644 --- a/EventGenerator/src/RPCGun_module.cc +++ b/EventGenerator/src/RPCGun_module.cc @@ -59,6 +59,8 @@ namespace mu2e { fhicl::Atom verbosity{Name("verbosity"),Comment("Add additional printout"), 0}; fhicl::Atom RPCType{Name("RPCType"),Comment("a process code, should be either RPCInternal or RPCExternal") }; fhicl::DelegatedParameter spectrum{Name("spectrum"), Comment("Parameters for BinnedSpectrum")}; + fhicl::Atom czmin{Name("czmin"), Comment("Restrict cos(theta_z) minimum"), -1.}; + fhicl::Atom czmax{Name("czmax"), Comment("Restrict cos(theta_z) maximum"), 1.}; fhicl::Atom pionDecayOff{Name("pionDecayOff"),Comment("Assume pion decay was turned off, produce event weights"), true}; fhicl::Atom doHistograms{Name("doHistograms"),Comment("Produce debug histograms"), false}; }; @@ -79,6 +81,8 @@ namespace mu2e { CLHEP::RandFlat randomFlat_; std::string RPCType_; BinnedSpectrum spectrum_; + const double czmin_; + const double czmax_; bool pionDecayOff_; bool doHistograms_; RandomUnitSphere randomUnitSphere_; @@ -119,9 +123,11 @@ namespace mu2e { , randomFlat_{eng_} , RPCType_{conf().RPCType()} , spectrum_{BinnedSpectrum(conf().spectrum.get())} + , czmin_(conf().czmin()) + , czmax_(conf().czmax()) , pionDecayOff_{conf().pionDecayOff()} , doHistograms_{conf().doHistograms()} - , randomUnitSphere_ {eng_} + , randomUnitSphere_ {eng_, czmin_, czmax_} , randSpectrum_ {eng_, spectrum_.getPDF(),static_cast(spectrum_.getNbins())} , pionCaptureSpectrum_{&randomFlat_,&randomUnitSphere_} { @@ -133,6 +139,12 @@ namespace mu2e { throw cet::exception("BADINPUT") <<"RPCGun::produce(): no such process, must be mu2eInternalRPC or mu2eExternalRPC"; } + + // Validate the input cz values + if(czmin_ > czmax_ || czmin_ < -1. || czmax_ > 1.) throw cet::exception("BADINPUT") << "RPCGun cos(theta_z) range is not defined\n"; + if(process_ == ProcessCode::mu2eInternalRPC && (std::abs(czmin_ + 1.) > 1.e-3 || std::abs(czmax_ - 1.) > 1.e-3)) + throw cet::exception("BADINPUT") << "RPCGun cos(theta_z) restriction can't be used with internal conversion\n"; + if ( doHistograms_ ) { art::ServiceHandle tfs; art::TFileDirectory tfdir = tfs->mkdir( "RPCGun" );