diff --git a/source/Digitisers/src/FixedPadSizeDiskLayout.cc b/source/Digitisers/src/FixedPadSizeDiskLayout.cc index a212e2a..5230886 100644 --- a/source/Digitisers/src/FixedPadSizeDiskLayout.cc +++ b/source/Digitisers/src/FixedPadSizeDiskLayout.cc @@ -113,14 +113,8 @@ double FixedPadSizeDiskLayout::getPadWidth(int padIndex) const { // need to return padWidth in radians !! return _padWidth / _rows.at(rowNum).RCenter; -<<<<<<< HEAD - } - catch(std::out_of_range&){ - return 0. ; -======= } catch (std::out_of_range&) { return 0.; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 } } @@ -131,14 +125,8 @@ double FixedPadSizeDiskLayout::getPadPitch(int padIndex) const { // need to return padPitch in radians !! return _rows.at(rowNum).PhiPad; -<<<<<<< HEAD - } - catch(std::out_of_range&){ - return 0. ; -======= } catch (std::out_of_range&) { return 0.; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 } } diff --git a/source/Digitisers/src/TPCModularEndplate.h b/source/Digitisers/src/TPCModularEndplate.h index 9d93730..e998002 100644 --- a/source/Digitisers/src/TPCModularEndplate.h +++ b/source/Digitisers/src/TPCModularEndplate.h @@ -25,11 +25,7 @@ class TPCModularEndplate { }; /// no default c'tor -<<<<<<< HEAD - TPCModularEndplate() = delete ; -======= TPCModularEndplate() = delete; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 TPCModularEndplate(const TPCModularEndplate&) = delete; TPCModularEndplate& operator=(const TPCModularEndplate&) = delete; diff --git a/source/Refitting/include/DDCellsAutomatonMV.h b/source/Refitting/include/DDCellsAutomatonMV.h index 01f9456..3e3a99e 100644 --- a/source/Refitting/include/DDCellsAutomatonMV.h +++ b/source/Refitting/include/DDCellsAutomatonMV.h @@ -71,18 +71,6 @@ class IMarlinTrkSystem; typedef std::vector RawTrack; class DDCellsAutomatonMV : public Processor { -<<<<<<< HEAD - - public: - - virtual Processor* newProcessor() { return new DDCellsAutomatonMV ; } - - - DDCellsAutomatonMV() ; - DDCellsAutomatonMV(const DDCellsAutomatonMV&) = delete ; - DDCellsAutomatonMV& operator=(const DDCellsAutomatonMV&) = delete ; - -======= public: virtual Processor* newProcessor() { return new DDCellsAutomatonMV; } @@ -90,7 +78,6 @@ class DDCellsAutomatonMV : public Processor { DDCellsAutomatonMV(const DDCellsAutomatonMV&) = delete; DDCellsAutomatonMV& operator=(const DDCellsAutomatonMV&) = delete; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ @@ -119,36 +106,11 @@ class DDCellsAutomatonMV : public Processor { int _nDivisionsInThetaMV{}; int _nLayers{}; -<<<<<<< HEAD - protected: - int nEvt{}; - - int _nDivisionsInPhi{}; - int _nDivisionsInTheta{}; - int _nDivisionsInPhiMV{}; - int _nDivisionsInThetaMV{}; - int _nLayers{}; - -======= ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _bField{}; // two pi is not a constant in cmath. Calculate it, once! static const double TWOPI; UTIL::BitField64* _encoder{nullptr}; -<<<<<<< HEAD - int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; } - int getSideID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::side()]; }; - int getLayerID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::layer()]; }; - int getModuleID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::module()]; }; - int getSensorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; - - double _dPhi{}; - double _dTheta{}; - - unsigned int _nLayersVTX{}; - unsigned int _nLayersSIT{}; -======= int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; @@ -172,7 +134,6 @@ class DDCellsAutomatonMV : public Processor { double _dPhi{}; double _dTheta{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 unsigned int _nLayersVTX{}; unsigned int _nLayersSIT{}; @@ -276,17 +237,6 @@ class DDCellsAutomatonMV : public Processor { /** The quality of the output track collection */ int _output_track_col_quality{}; -<<<<<<< HEAD - - static const int _output_track_col_quality_GOOD; - static const int _output_track_col_quality_FAIR; - static const int _output_track_col_quality_POOR; - - std::string _bestSubsetFinder{}; - -} ; -======= ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 static const int _output_track_col_quality_GOOD; static const int _output_track_col_quality_FAIR; diff --git a/source/Refitting/include/ExtrToSIT.h b/source/Refitting/include/ExtrToSIT.h index 55907d2..aa068ff 100644 --- a/source/Refitting/include/ExtrToSIT.h +++ b/source/Refitting/include/ExtrToSIT.h @@ -54,15 +54,6 @@ class ExtrToSIT : public marlin::Processor { ExtrToSIT(const ExtrToSIT&) = delete; ExtrToSIT& operator=(const ExtrToSIT&) = delete; -<<<<<<< HEAD - virtual marlin::Processor* newProcessor() { return new ExtrToSIT ; } - - ExtrToSIT() ; - ExtrToSIT(const ExtrToSIT&) = delete; - ExtrToSIT& operator=(const ExtrToSIT&) = delete; - -======= ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ @@ -110,40 +101,6 @@ class ExtrToSIT : public marlin::Processor { /** Input track collection name for refitting. */ -<<<<<<< HEAD - std::string _input_track_col_name {}; - - /** Input track relations name for refitting. - */ - std::string _input_track_rel_name {}; - - /** Input SIT tracker summer hit collection. - */ - std::string _sitColName {}; - - /** Input VXD tracker summer hit collection. - */ - std::string _vxdColName {}; - - /** refitted track collection name. - */ - std::string _output_track_col_name {}; - - /** Output track relations name for refitting. - */ - std::string _output_track_rel_name {}; - - /** Output silicon track collection. - */ - std::string _siTrkColName {}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem{nullptr} ; - std::string _trkSystemName{} ; - - std::string _mcParticleCollectionName{} ; -======= std::string _input_track_col_name{}; /** Input track relations name for refitting. @@ -174,7 +131,6 @@ class ExtrToSIT : public marlin::Processor { */ MarlinTrk::IMarlinTrkSystem* _trksystem{nullptr}; std::string _trkSystemName{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::string _mcParticleCollectionName{}; diff --git a/source/Refitting/include/ExtrToTracker.h b/source/Refitting/include/ExtrToTracker.h index 958236b..70d731c 100644 --- a/source/Refitting/include/ExtrToTracker.h +++ b/source/Refitting/include/ExtrToTracker.h @@ -57,14 +57,7 @@ class ExtrToTracker : public marlin::Processor { public: virtual marlin::Processor* newProcessor() { return new ExtrToTracker; } -<<<<<<< HEAD - - virtual marlin::Processor* newProcessor() { return new ExtrToTracker ; } - - ExtrToTracker() ; -======= ExtrToTracker(); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 ExtrToTracker(const ExtrToTracker&) = delete; ExtrToTracker& operator=(const ExtrToTracker&) = delete; @@ -136,49 +129,6 @@ class ExtrToTracker : public marlin::Processor { /** Input track collection name for refitting. */ -<<<<<<< HEAD - std::string _input_track_col_name {}; - - - /** output collection name for the not used hits. - */ - std::string _output_not_used_col_name {}; - - /** output track collection name. - */ - std::string _output_track_col_name {}; - - /** Output track relations name for refitting. - */ - std::string _output_track_rel_name {}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem {nullptr}; - - /* std::string _mcParticleCollectionName ; */ - - bool _MSOn {}; - bool _ElossOn {}; - bool _SmoothOn {}; - double _Max_Chi2_Incr {}; - double _searchSigma {}; - - int _n_run {}; - int _n_evt {}; - int SITHitsFitted {}; - int SITHitsNonFitted {}; - int TotalSITHits {}; - int _nHitsChi2 {}; - - float _bField{}; - - bool _performFinalRefit {}; - - bool _extrapolateForward{}; - - const dd4hep::rec::SurfaceMap* _map {nullptr}; -======= std::string _input_track_col_name{}; /** output collection name for the not used hits. @@ -215,30 +165,10 @@ class ExtrToTracker : public marlin::Processor { float _bField{}; bool _performFinalRefit{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 bool _extrapolateForward{}; -<<<<<<< HEAD - //processor parameters - - StringVec _vecDigiHits{}; - StringVec _vecSubdetName{}; - std::vector _vecSubdetIsBarrel{}; - std::vector _vecSubdetNLayers{}; - std::vector _vecSubdetID{}; - std::vector _vecDigiHitsCol{}; - std::vector >* > _vecMapNeighbours{}; - - std::vector > > _vecMapsElHits{}; - - std::vector > _vecvecHitsInCol{}; - - -} ; -======= const dd4hep::rec::SurfaceMap* _map{nullptr}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 // processor parameters diff --git a/source/Refitting/include/FPCCDFullLDCTracking_MarlinTrk.h b/source/Refitting/include/FPCCDFullLDCTracking_MarlinTrk.h index 7cd76bd..b3e847b 100644 --- a/source/Refitting/include/FPCCDFullLDCTracking_MarlinTrk.h +++ b/source/Refitting/include/FPCCDFullLDCTracking_MarlinTrk.h @@ -293,19 +293,6 @@ class Detector; class FPCCDFullLDCTracking_MarlinTrk : public Processor { public: -<<<<<<< HEAD - - virtual Processor* newProcessor() { return new FPCCDFullLDCTracking_MarlinTrk ; } - FPCCDFullLDCTracking_MarlinTrk() ; - FPCCDFullLDCTracking_MarlinTrk(const FPCCDFullLDCTracking_MarlinTrk&) = delete ; - FPCCDFullLDCTracking_MarlinTrk& operator=(const FPCCDFullLDCTracking_MarlinTrk&) = delete ; - virtual void init() ; - virtual void processRunHeader( LCRunHeader* run ) ; - virtual void processEvent( LCEvent * evt ) ; - virtual void check( LCEvent * evt ) ; - virtual void end() ; - -======= virtual Processor* newProcessor() { return new FPCCDFullLDCTracking_MarlinTrk; } FPCCDFullLDCTracking_MarlinTrk(); FPCCDFullLDCTracking_MarlinTrk(const FPCCDFullLDCTracking_MarlinTrk&) = delete; @@ -316,7 +303,6 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { virtual void check(LCEvent* evt); virtual void end(); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 protected: void prepareVectors(LCEvent* evt); void CleanUp(); @@ -360,135 +346,6 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { int SegmentRadialOverlap(TrackExtended* pTracki, TrackExtended* pTrackj); bool VetoMerge(TrackExtended* firstTrackExt, TrackExtended* secondTrackExt); -<<<<<<< HEAD - - - int _nRun {}; - int _nEvt {}; - - MarlinTrk::HelixFit* _fastfitter{nullptr}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem {nullptr}; - - bool _MSOn{}, _ElossOn{}, _SmoothOn {}; - - std::string _TPCTrackCollection{}; - std::string _SiTrackCollection{}; - std::string _TPCTrackMCPCollName{}; - std::string _SiTrackMCPCollName{}; - - std::string _VTXTrackerHitCollection{}; - std::string _SITTrackerHitCollection{}; - std::string _SETTrackerHitCollection{}; - std::string _FTDPixelHitCollection{}; - std::string _FTDSpacePointCollection{}; - std::string _TPCTrackerHitCollection{}; - std::string _ETDTrackerHitCollection{}; - - std::string _LDCTrackCollection{}; - - - TrackExtendedVec _allSiTracks{}; - TrackExtendedVec _allTPCTracks{}; - TrackExtendedVec _allCombinedTracks{}; - TrackExtendedVec _allNonCombinedTPCTracks{}; - TrackExtendedVec _allNonCombinedSiTracks{}; - TrackExtendedVec _trkImplVec{}; - TrackerHitExtendedVec _allTPCHits{}; - TrackerHitExtendedVec _allVTXHits{}; - TrackerHitExtendedVec _allFTDHits{}; - TrackerHitExtendedVec _allSITHits{}; - TrackerHitExtendedVec _allSETHits{}; - TrackerHitExtendedVec _allETDHits{}; - - float PI{}, PIOVER2{}, TWOPI{}; - - float _bField{}; - float _chi2PrefitCut{}; - float _chi2FitCut{}; - - int _debug{}; - - float _dPCutForMerging{}; - float _d0CutForMerging{}; - float _z0CutForMerging{}; - float _dOmegaForMerging{}; - float _angleForMerging{}; - - - int _forceMerging{}; - float _dPCutForForcedMerging{}; - float _d0CutForForcedMerging{}; - float _z0CutForForcedMerging{}; - float _dOmegaForForcedMerging{}; - float _angleForForcedMerging{}; - - - int _mergeTPCSegments{}; - float _dPCutToMergeTPC{}; - float _PtCutToMergeTPC{}; - float _d0CutToMergeTPC{}; - float _z0CutToMergeTPC{}; - - float _cosThetaCutHighPtMerge{}; - float _cosThetaCutSoftHighPtMerge{}; - float _momDiffCutHighPtMerge{}; - float _momDiffCutSoftHighPtMerge{}; - float _hitDistanceCutHighPtMerge{}; - float _maxHitDistanceCutHighPtMerge{}; - float _maxFractionOfOutliersCutHighPtMerge{}; - - float _vetoMergeMomentumCut{}; - - float _initialTrackError_d0{}; - float _initialTrackError_phi0{}; - float _initialTrackError_omega{}; - float _initialTrackError_z0{}; - float _initialTrackError_tanL{}; - - double _maxChi2PerHit{}; - double _minChi2ProbForSiliconTracks{}; - double _maxChi2ForSiliconTracks{}; - bool _useMaxChi2ReqForSiTrk{}; - float _maxAllowedPercentageOfOutliersForTrackCombination{}; - int _maxAllowedSiHitRejectionsForTrackCombination{}; - - bool _runMarlinTrkDiagnostics{}; - std::string _MarlinTrkDiagnosticsName{}; - - int _nHitsExtrapolation{}; - - int _cutOnTPCHits{}; - int _cutOnSiHits{}; - - - int _assignVTXHits{},_assignFTDHits{},_assignSITHits{},_assignTPCHits{}; - - int _assignSETHits{}, _assignETDHits{}; - - float _distCutForVTXHits{},_distCutForFTDHits{},_distCutForSITHits{},_distCutForTPCHits{}; - - float _distCutForSETHits{}, _distCutForETDHits{}; - - - float _d0TrkCut{},_z0TrkCut{}; - - int _forbidOverlapInZTPC{},_forbidOverlapInZComb{}; - - LCEvent * _evt{nullptr}; - - std::map _trackExtrapolatedHelix{}; - std::set _candidateCombinedTracks{}; - - UTIL::BitField64* _encoder{nullptr}; - int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; } - int getSideID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::side()]; }; - int getLayerID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::layer()]; }; - int getModuleID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::module()]; }; - int getSensorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; -======= int _nRun{}; int _nEvt{}; @@ -498,98 +355,9 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { /** pointer to the IMarlinTrkSystem instance */ MarlinTrk::IMarlinTrkSystem* _trksystem{nullptr}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 bool _MSOn{}, _ElossOn{}, _SmoothOn{}; -<<<<<<< HEAD - - void setupGeom(const dd4hep::Detector& theDetector) ; - - double _tpc_inner_r{}; - double _tpc_outer_r{}; - double _tpc_pad_height{}; - int _tpc_nrows{}; - -// struct VXD_Layer { -// int nLadders; -// double phi0; -// double dphi; -// double senRMin; -// double supRMin; -// double length; -// double width; -// double offset; -// double senThickness; -// double supThickness; -// }; -// std::vector _VXDgeo; - - unsigned int _nLayersVTX{}; - -// struct SIT_Layer { -// int nLadders; -// double phi0; -// double dphi; -// double senRMin; -// double supRMin; -// double length; -// double width; -// double offset; -// double senThickness; -// double supThickness; -// }; -// std::vector _SITgeo; - - unsigned int _nLayersSIT{}; - - unsigned int _nLayersSET{}; - - -// struct FTD_Disk { -// int nPetals; -// double phi0; -// double dphi; -// -// double alpha; -// double rInner; -// double height; -// double innerBaseLength; -// double outerBaseLength; -// double senThickness; -// double supThickness; -// -// double senZPos_even_petal1; -// double senZPos_even_petal2; -// double senZPos_even_petal3; -// double senZPos_even_petal4; -// -// double supZPos_even_petal1; -// double supZPos_even_petal2; -// double supZPos_even_petal3; -// double supZPos_even_petal4; -// -// double senZPos_odd_petal1; -// double senZPos_odd_petal2; -// double senZPos_odd_petal3; -// double senZPos_odd_petal4; -// -// double supZPos_odd_petal1; -// double supZPos_odd_petal2; -// double supZPos_odd_petal3; -// double supZPos_odd_petal4; -// -// -// -// }; -// -// std::vector _FTDgeo; - std::vector _zLayerFTD{}; - - unsigned int _nLayersFTD{}; - int _nPhiFTD{}; - bool _petalBasedFTDWithOverlaps{}; -======= std::string _TPCTrackCollection{}; std::string _SiTrackCollection{}; std::string _TPCTrackMCPCollName{}; @@ -602,7 +370,6 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { std::string _FTDSpacePointCollection{}; std::string _TPCTrackerHitCollection{}; std::string _ETDTrackerHitCollection{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::string _LDCTrackCollection{}; @@ -640,46 +407,6 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { float _dOmegaForForcedMerging{}; float _angleForForcedMerging{}; -<<<<<<< HEAD -/////////////Addition by Mori////////////////// - - GetPurityUtil* _purityUtil{nullptr}; - moriUTIL* _moriUtil{nullptr}; - MCPMap _mcpMapSi{}; - MCPMap _mcpMapFull{}; - IntVec getNHitsInSubDet(SimTrackerHitVec simvec); - std::vector _naviVecSi{}; - std::vector _naviVecFull{}; - std::string _colNameVXDTrackerHitRelations{}; - std::string _colNameSITSpacePointRelations{}; - std::string _colNameFTDSpacePointRelations{}; - std::string _colNameFTDPixelTrackerHitRelations{}; - std::string _colNameTPCTrackerHitRelations{}; - std::string _colNameSETSpacePointRelations{}; - LCRelationNavigator* _navVXD{nullptr}; - LCRelationNavigator* _navSIT{nullptr}; - LCRelationNavigator* _navFTDsp{nullptr}; - LCRelationNavigator* _navFTDpix{nullptr}; - LCRelationNavigator* _navTPC{nullptr}; - LCRelationNavigator* _navSET{nullptr}; - std::string _colNameVXDSimHit{}; - std::string _colNameSITSimHit{}; - std::string _colNameFTDspSimHit{}; - std::string _colNameFTDpixSimHit{}; - std::string _colNameTPCSimHit{}; - std::string _colNameSETSimHit{}; - LCCollection* _simVXD{nullptr}; - LCCollection* _simSIT{nullptr}; - LCCollection* _simFTDsp{nullptr}; - LCCollection* _simFTDpix{nullptr}; - LCCollection* _simTPC{nullptr}; - LCCollection* _simSET{nullptr}; - - bool _mydebug{}; - bool _mydebugPrintMCP{}; - - bool _FinalTrackCut_strategyA{}; -======= int _mergeTPCSegments{}; float _dPCutToMergeTPC{}; float _PtCutToMergeTPC{}; @@ -695,7 +422,6 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { float _maxFractionOfOutliersCutHighPtMerge{}; float _vetoMergeMomentumCut{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _initialTrackError_d0{}; float _initialTrackError_phi0{}; @@ -703,23 +429,12 @@ class FPCCDFullLDCTracking_MarlinTrk : public Processor { float _initialTrackError_z0{}; float _initialTrackError_tanL{}; -<<<<<<< HEAD - MCPMap LoadMCPMap(int mode); - std::map< MCParticle*, SimTrackerHitVec > _mcpVXD{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpVXDFTD{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpVXDSIT{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpVXDFTDSIT{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpFTD{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpFTDSIT{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpSIT{}; -======= double _maxChi2PerHit{}; double _minChi2ProbForSiliconTracks{}; double _maxChi2ForSiliconTracks{}; bool _useMaxChi2ReqForSiTrk{}; float _maxAllowedPercentageOfOutliersForTrackCombination{}; int _maxAllowedSiHitRejectionsForTrackCombination{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 bool _runMarlinTrkDiagnostics{}; std::string _MarlinTrkDiagnosticsName{}; diff --git a/source/Refitting/include/FPCCDSiliconTracking_MarlinTrk.h b/source/Refitting/include/FPCCDSiliconTracking_MarlinTrk.h index 6881b4f..3bb4a59 100644 --- a/source/Refitting/include/FPCCDSiliconTracking_MarlinTrk.h +++ b/source/Refitting/include/FPCCDSiliconTracking_MarlinTrk.h @@ -214,17 +214,6 @@ class Detector; */ class FPCCDSiliconTracking_MarlinTrk : public Processor { public: -<<<<<<< HEAD - - virtual Processor* newProcessor() { return new FPCCDSiliconTracking_MarlinTrk ; } - - - FPCCDSiliconTracking_MarlinTrk() ; - FPCCDSiliconTracking_MarlinTrk(const FPCCDSiliconTracking_MarlinTrk&) = delete ; - FPCCDSiliconTracking_MarlinTrk& operator=(const FPCCDSiliconTracking_MarlinTrk&) = delete ; - - /** -======= virtual Processor* newProcessor() { return new FPCCDSiliconTracking_MarlinTrk; } FPCCDSiliconTracking_MarlinTrk(); @@ -232,7 +221,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { FPCCDSiliconTracking_MarlinTrk& operator=(const FPCCDSiliconTracking_MarlinTrk&) = delete; /** ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 * Initialization */ virtual void init(); @@ -249,31 +237,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { /** Called after data processing for clean up. */ -<<<<<<< HEAD - virtual void end() ; - - -protected: - - int _nRun {}; - int _nEvt {}; - EVENT::LCEvent* _current_event{nullptr}; - - int _nDivisionsInPhi{}; - int _nDivisionsInTheta{}; - int _nLayers{}; - - MarlinTrk::HelixFit* _fastfitter{nullptr}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem {nullptr}; - bool _runMarlinTrkDiagnostics{}; - std::string _MarlinTrkDiagnosticsName{}; - - bool _MSOn{}, _ElossOn{}, _SmoothOn{}; - -======= virtual void end(); protected: @@ -295,33 +258,11 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { bool _MSOn{}, _ElossOn{}, _SmoothOn{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _initialTrackError_d0{}; float _initialTrackError_phi0{}; float _initialTrackError_omega{}; float _initialTrackError_z0{}; float _initialTrackError_tanL{}; -<<<<<<< HEAD - - double _maxChi2PerHit{}; - double _maxChi2PerHit2nd{}; - - bool _UseEventDisplay{}; - std::vector _colours{}; - - void drawEvent(); - - - // histogram member variables - - bool _createDiagnosticsHistograms{}; - DiagnosticsHistograms::Histograms* _histos {nullptr}; - - - int _ntriplets{}, _ntriplets_good{}, _ntriplets_2MCP{}, _ntriplets_3MCP{}, _ntriplets_1MCP_Bad{}, _ntriplets_bad{}; - - -======= double _maxChi2PerHit{}; double _maxChi2PerHit2nd{}; @@ -338,7 +279,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { int _ntriplets{}, _ntriplets_good{}, _ntriplets_2MCP{}, _ntriplets_3MCP{}, _ntriplets_1MCP_Bad{}, _ntriplets_bad{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** helper function to get collection using try catch block */ LCCollection* GetCollection(LCEvent* evt, std::string colName); @@ -346,14 +286,8 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { LCRelationNavigator* GetRelations(LCEvent* evt, std::string RelName); /** input MCParticle collection and threshold used for Drawing */ -<<<<<<< HEAD - std::string _colNameMCParticles{}; - - -======= std::string _colNameMCParticles{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /// Compare tracks according to their chi2/ndf struct compare_TrackExtended { // n.b.: a and b should be TrackExtended const *, but the getters are not const :-( @@ -363,26 +297,11 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { return (a->getChi2() / a->getNDF() < b->getChi2() / b->getNDF()); } }; -<<<<<<< HEAD - - -======= - ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::string _VTXHitCollection{}; std::string _FTDPixelHitCollection{}; std::string _FTDSpacePointCollection{}; std::string _SITHitCollection{}; std::string _siTrkCollection{}; -<<<<<<< HEAD - - std::vector< LCCollection* > _colTrackerHits{}; - std::map< LCCollection*, std::string > _colNamesTrackerHits{}; - - std::vector _sectors{}; - std::vector _sectorsFTD{}; - -======= std::vector _colTrackerHits{}; std::map _colNamesTrackerHits{}; @@ -390,7 +309,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { std::vector _sectors{}; std::vector _sectorsFTD{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** * A helper class to allow good code readability by accessing tracks with N hits. * As the smalest valid track contains three hits, but the first index in a vector is 0, @@ -422,16 +340,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { } protected: -<<<<<<< HEAD - std::vector< TrackExtendedVec > _tracksNHits{}; - size_t _maxIndex{}; /// local cache variable to avoid calculation overhead - }; - - TracksWithNHitsContainer _tracksWithNHitsContainer{}; - - int InitialiseVTX(LCEvent * evt); - int InitialiseFTD(LCEvent * evt); -======= std::vector _tracksNHits{}; size_t _maxIndex{}; /// local cache variable to avoid calculation overhead }; @@ -440,22 +348,14 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { int InitialiseVTX(LCEvent* evt); int InitialiseFTD(LCEvent* evt); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 void ProcessOneSector(int iSectorPhi, int iSectorTheta); void ProcessOneSectorVer2(int iSectorPhi, int iSectorTheta); void CleanUp(); TrackExtended* TestTriplet(TrackerHitExtended* outerHit, TrackerHitExtended* middleHit, TrackerHitExtended* innerHit, HelixClass_double& helix, int omegamode); -<<<<<<< HEAD - int _useBuildTrackForHighPt{}; - double _cosThetaRangeForBuildTrackForHighPt{}; - double _phiRangeForBuildTrackForHighPt{}; - void getPhiThetaRegionForHighPt(int* boundaries,TrackExtended* trackAR); -======= int BuildTrack_KalFit(TrackerHitExtended* outerHit, TrackerHitExtended* middleHit, TrackerHitExtended* innerHit, HelixClass_double& helix, int innerlayer, TrackExtended* trackAR); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 int _useBuildTrackForHighPt{}; double _cosThetaRangeForBuildTrackForHighPt{}; @@ -475,11 +375,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { int AttachHitToTrack_KalFit(TrackExtended* trackAR, TrackerHitExtended* hit); void FinalRefit(LCCollectionVec* trk_col, LCCollectionVec* rel_col); -<<<<<<< HEAD - -======= - ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _bField{}; float _chi2WRPhiTriplet{}; float _chi2WRPhiQuartet{}; @@ -491,40 +386,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { float _minDistCutAttachForVXD{}; int _minimalLayerToAttach{}; int _minMissAddition{}; -<<<<<<< HEAD - - // two pi is not a constant in cmath. Calculate it, once! - static const double TWOPI; - - double _dPhi{}; - double _dTheta{}; - double _dPhiFTD{}; - - - - std::vector _Combinations{}; - std::vector _CombinationsFTD{}; - - float _resolutionRPhiVTX{}; - float _resolutionZVTX{}; - - float _resolutionRPhiFTD{}; - float _resolutionZFTD{}; - - float _resolutionRPhiSIT{}; - float _resolutionZSIT{}; - - float _phiCutForMerging{}; - float _tanlambdaCutForMerging{}; - float _angleCutForMerging{}; - //float _angleCutForMerging_highPt; - //float _angleCutForMerging_lowPt; - - int _print{}; - int _checkForDelta{}; - float _minDistToDelta{}; - -======= // two pi is not a constant in cmath. Calculate it, once! static const double TWOPI; @@ -555,71 +416,20 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { int _checkForDelta{}; float _minDistToDelta{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _distRPhi{}; float _distZ{}; float _chi2FitCut{}; float _chi2FitCut_lowPt{}; -<<<<<<< HEAD - - - TrackExtendedVec _trackImplVec{}; - - - float _cutOnD0{}, _cutOnZ0{}, _cutOnOmegaVXD{}, _cutOnOmegaFTD{}; - double _cutOnPtVXD{},_cutOnPtFTD{}; - -======= TrackExtendedVec _trackImplVec{}; float _cutOnD0{}, _cutOnZ0{}, _cutOnOmegaVXD{}, _cutOnOmegaFTD{}; double _cutOnPtVXD{}, _cutOnPtFTD{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 int _minimalHits{}; int _nHitsChi2{}; int _attachVXD{}; int _attachFTD{}; -<<<<<<< HEAD - - int _max_hits_per_sector{}; - - int _nTotalVTXHits{},_nTotalFTDHits{},_nTotalSITHits{}; - int _useSIT{}; - int _useFTD{}; - - - // int _createMap; - - UTIL::BitField64* _encoder{nullptr}; - int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; } - int getSideID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::side()]; }; - int getLayerID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::layer()]; }; - int getModuleID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::module()]; }; - int getSensorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; - - int getDetectorID(SimTrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; } - int getSideID(SimTrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::side()]; }; - int getLayerID(SimTrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::layer()]; }; - int getModuleID(SimTrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::module()]; }; - int getSensorID(SimTrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; - - void setupGeom(const dd4hep::Detector& theDetector) ; - - - unsigned int _nLayersVTX{}; - - unsigned int _nLayersSIT{}; - - - std::vector _zLayerFTD{}; - - unsigned int _nlayersFTD{}; - bool _petalBasedFTDWithOverlaps{}; - int _nPhiFTD{}; - -======= int _max_hits_per_sector{}; @@ -684,17 +494,12 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { bool _petalBasedFTDWithOverlaps{}; int _nPhiFTD{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 int _output_track_col_quality{}; static const int _output_track_col_quality_GOOD; static const int _output_track_col_quality_FAIR; static const int _output_track_col_quality_POOR; -<<<<<<< HEAD - int _sw_theta{};//search window theta -======= int _sw_theta{}; // search window theta ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _chi2FitCut_kalman{}; bool _useClusterRejection{}; float _minDotOf2Clusters{}; @@ -709,24 +514,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { struct GeoData_t { int nladder{}; -<<<<<<< HEAD - double rmin{}; // distance of inner surface of sensitive region from IP - double dphi{}; // azimuthal angle step of each ladder - double phi0{}; // aximuthal angle offset - std::vector cosphi{}; // cos[phi_ladder], cos_phi of each ladder - std::vector sinphi{}; // sin[phi_ladder], sin_phi of each ladder - std::vector phi{}; // phi of each ladder - std::vector phiAtXiMin{}; // phiAtXiMin of each ladder - std::vector phiAtXiMax{}; // phiAtXiMax of each ladder - std::vector ladder_incline{};//the tilt of the line of the ladder expressed by phi - double sthick{}; // sensitive region thickness - double sximin{}; // minimum xi of sensitive region. - double sximax{}; // maximum xi of sensitive region - double hlength{}; // ladder's half length in z - int num_xi_pixel{}; // Number of xi pixel in this ladder - int num_zeta_pixel{}; // Number of zeta pixel in this ladder - double rmes{}; //distance in R of measurement surface -======= double rmin{}; // distance of inner surface of sensitive region from IP double dphi{}; // azimuthal angle step of each ladder double phi0{}; // aximuthal angle offset @@ -743,47 +530,21 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { int num_xi_pixel{}; // Number of xi pixel in this ladder int num_zeta_pixel{}; // Number of zeta pixel in this ladder double rmes{}; // distance in R of measurement surface ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 }; struct vxdGeoData_t { -<<<<<<< HEAD - int nLayer{}; - int maxLadder{}; - std::vector geodata{}; - }_vxd{},_sit{}; -======= int nLayer{}; int maxLadder{}; std::vector geodata{}; } _vxd{}, _sit{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 void InitVXDGeometry(const dd4hep::Detector& theDetector); void InitSITGeometry(const dd4hep::Detector& theDetector); FloatVec _pixelSizeVec{}; float _pixelheight{}; -<<<<<<< HEAD - TVector3 LocalToGlobal(TVector3 local,int layer,int ladder); - //purityMCP CheckOriginOf2Clusters(TrackerHit* A, TrackerHit* B); - void calcTrackParameterOfMCP(MCParticle* pmcp, double* par); - - class ClusterStatus{ - public : - int cellid0 {}; - int cellid1{}; - unsigned int layer {}; - unsigned int ladder{}; - unsigned int xiwidth {}; - unsigned int zetawidth {}; - unsigned int nPix {}; - unsigned int tilt {}; - unsigned int quality {}; -======= TVector3 LocalToGlobal(TVector3 local, int layer, int ladder); // purityMCP CheckOriginOf2Clusters(TrackerHit* A, TrackerHit* B); void calcTrackParameterOfMCP(MCParticle* pmcp, double* par); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 class ClusterStatus { public: @@ -816,42 +577,24 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { ClusterStatus() { ; } }; -<<<<<<< HEAD - //Old Ver////////////////// - typedef std::map< std::pair< int, int >, int > RangeMap; -======= // Old Ver////////////////// typedef std::map, int> RangeMap; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 RangeMap _phiRangeForTriplet{}; double getNeededPhiSectors(double Pt, int outly, int inly); // Difference of radian is returned /////////////////////////// -<<<<<<< HEAD - //New Ver////////////////////==under construction==== - typedef std::map< std::vector , std::vector > RangeMapVer2; -======= // New Ver////////////////////==under construction==== typedef std::map, std::vector> RangeMapVer2; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 RangeMapVer2 _phiRangeForTripletVer2{}; void getNeededPhiSectorsVer2(double Pt, std::vector layers, std::vector& phiDiff); /////////////////////////////======================== -<<<<<<< HEAD - float _safetyPhiRange_ratio{};/** - Extra range in addition to main range used for triplet construction process and needed to find triplet - is calculated by getNeededPhiSectors, but safety range is not considered. - Value of _safetyRange is used such as Range = Range*(1 + _safetyRange); - */ -======= float _safetyPhiRange_ratio{}; /** Extra range in addition to main range used for triplet construction process and needed to find triplet is calculated by getNeededPhiSectors, but safety range is not considered. Value of _safetyRange is used such as Range = Range*(1 + _safetyRange); */ ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 int _safetyPhiRange_fix{}; float _fudgeFactorForSITsr_rphi{}; float _fudgeFactorForSITsr_z{}; @@ -880,26 +623,12 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { bool _keepCandidate{}; // used in AttachRemainingVTXHitsVeryFast <-- under construction for now -<<<<<<< HEAD - double _nSigmaBuild_phi{}; - double _nSigmaBuild_theta{}; - - bool _keepCandidate{};//used in AttachRemainingVTXHitsVeryFast <-- under construction for now - - moriUTIL* _moriUtil{nullptr}; - GetPurityUtil* _purityUtil{nullptr}; - -//////////////////////////////////////////////////////////////// -////from here, a lot of debug tools and variables for mori ///// -//////////////////////////////////////////////////////////////// -======= moriUTIL* _moriUtil{nullptr}; GetPurityUtil* _purityUtil{nullptr}; //////////////////////////////////////////////////////////////// ////from here, a lot of debug tools and variables for mori ///// //////////////////////////////////////////////////////////////// ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 bool _mydebug{}; bool _mydebugKalFit{}; bool _mydebugIntersection{}; @@ -910,30 +639,17 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { bool _mydebugVXDHits{}; bool _mydebugSITHits{}; bool _mydebugTriplet{}; -<<<<<<< HEAD - int _mydebugTripletMode{}; -======= int _mydebugTripletMode{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 bool _mydebugTripletVXD{}; bool _mydebugTripletFTD{}; bool _mydebugTripletVXDFTD{}; bool _mydebugBuildTrack{}; -<<<<<<< HEAD - int _mydebugBuildTrackMode{}; - bool _mydebugAttachVXD{}; - bool _mydebugPrintMCP{}; - bool _stopwatch{}; - class Timer{ - public: -======= int _mydebugBuildTrackMode{}; bool _mydebugAttachVXD{}; bool _mydebugPrintMCP{}; bool _stopwatch{}; class Timer { public: ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 TStopwatch inAnEvt{}; TStopwatch InitialiseVTX{}; TStopwatch InitialiseFTD{}; @@ -944,11 +660,7 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { TStopwatch AttachRemainingVXD{}; TStopwatch AttachRemainingFTD{}; TStopwatch FinalRefit{}; -<<<<<<< HEAD - void reset(){ -======= void reset() { ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 inAnEvt.Reset(); InitialiseVTX.Reset(); InitialiseFTD.Reset(); @@ -974,23 +686,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { AttachRemainingFTD.CpuTime()); printf("FinalRefit : RT=%.3f s, CPU=%.3f s \n", FinalRefit.RealTime(), FinalRefit.CpuTime()); } -<<<<<<< HEAD - Timer(){reset();} - }_timer{}; - TStopwatch _timer2Triplet{}; - TStopwatch _timer2Build{}; - bool _mydebugstopwatch2{}; - - float _currentPurity{}; - MCPMap LoadMCPMap(); - std::map< MCParticle*, SimTrackerHitVec > _mcpVXD{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpVXDFTD{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpVXDSIT{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpVXDFTDSIT{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpFTD{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpFTDSIT{}; - std::map< MCParticle*, SimTrackerHitVec > _mcpSIT{}; -======= Timer() { reset(); } } _timer{}; TStopwatch _timer2Triplet{}; @@ -1006,7 +701,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { std::map _mcpFTD{}; std::map _mcpFTDSIT{}; std::map _mcpSIT{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 enum MCPContributions { contVXD, @@ -1022,31 +716,6 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { enum MCPContributions getMCPContribution(IntVec nsub); -<<<<<<< HEAD - class Triplet : public IMPL::TrackImpl{ - public : - static int numOfProcesses; - int id{}; - int quality_code{}; - int detID[3]{};//内側に近いところから詰める。 - int layer[3]{}; - float probability{}; - float purity{}; - SimTrackerHitVec simVecFromTrk{};//TrackerHitVecに対応するもの - std::pair< MCParticle* , SimTrackerHitVec > mcTruth {};//Dominant MCPについての情報 - - //new (2013_08_10) - TrackerHitVec truthTrkHits {};//Dominant MCPのsimthitsに対応するTrackerHitVec. - enum MCPContributions mcpcont{}; - IntVec nsub{};//vxd:0,sit:1,ftd:2 <--for Dominant MCP - - - float mcp_d0{}; - float mcp_z0{}; - float mcp_omega{}; - float mcp_phi0{}; - float mcp_tanL{}; -======= class Triplet : public IMPL::TrackImpl { public: static int numOfProcesses; @@ -1069,71 +738,9 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { float mcp_omega{}; float mcp_phi0{}; float mcp_tanL{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 // bool availableInBuildedTrack; -<<<<<<< HEAD - Triplet(bool incrementID = true){ - id = numOfProcesses; - if(incrementID){ - numOfProcesses++; - } - quality_code = -1; - detID[0] = detID[1] = detID[2] = -1; - layer[0] = layer[1] = layer[2] = -1; - probability = 1e20; - purity = 1e20; - simVecFromTrk.clear(); - mcTruth.first = 0; mcTruth.second.clear(); - truthTrkHits.clear(); - mcpcont = contSize; - nsub.clear(); - mcp_d0 = mcp_z0 = mcp_omega = mcp_phi0 = mcp_tanL = 1e20; - } - Triplet(const Triplet&) = default; - }; - Triplet* _curtriplet{nullptr}; - - - enum BuildTrackResult{ - NormalEnd, - ManyMisAssignments, - ManyOutliers, - PhiThetaError, - BuildTrackResultSize - }; - class BuildedTrack : public IMPL::TrackImpl{ - public : - static int numOfProcesses; - int id{}; - - BuildTrackResult result{}; - int nMisAssign{}; - Triplet triplet{}; - const MCParticle* truthmcp{nullptr}; - SimTrackerHitVec simvec{}; - float probability{}; - float purity{}; - SimTrackerHitVec simVecFromTrk{};//TrackerHitVecに対応するもの - BuildedTrack():triplet(false){ - id = numOfProcesses; - numOfProcesses++; - result = BuildTrackResultSize; - nMisAssign = -1; - truthmcp = 0; - simvec.clear(); - probability = 1e20; - purity = 1e20; - simVecFromTrk.clear(); - } - BuildedTrack(const BuildedTrack&) = default; - BuildedTrack& operator=(const BuildedTrack&) = default; - }; - bool _availableInBuildedTrack{}; - - typedef std::vector< BuildedTrack > BuildedTrackVec; -======= Triplet(bool incrementID = true) { id = numOfProcesses; if (incrementID) { @@ -1187,40 +794,21 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { bool _availableInBuildedTrack{}; typedef std::vector BuildedTrackVec; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 BuildedTrackVec _buildedTrackContainer{}; void SetBuildedTrack(TrackExtended* trackAR, BuildedTrackVec& btrackvec); void BuildedTrackDebuger1(BuildedTrackVec::iterator begin, BuildedTrackVec::iterator end); void BuildedTrackDebuger2(std::vector::iterator begin, std::vector::iterator end); -<<<<<<< HEAD - //時間がアレばclass templateにしてみたい。 - class MCP_BuildedTrack{ - public : - std::pair pair{}; - IntVec nsub{};//nhits in sub detectors. 0 VXD, 1 FTD, 2 SIT -======= // 時間がアレばclass templateにしてみたい。 class MCP_BuildedTrack { public: std::pair pair{}; IntVec nsub{}; // nhits in sub detectors. 0 VXD, 1 FTD, 2 SIT ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::vector BuildedTrackVec{}; std::vector BuildedTrack2ndVec{}; std::vector BuildedTrack3rdVec{}; }; -<<<<<<< HEAD - typedef std::map BTMap; - BTMap _mcpBuildedTrackContainer{}; - - std::vector< std::map > _mcpRemainingBTContainerA{}; - //purity 100%のトリプレットが生成されなかった生成されなかったmcp - std::vector< std::map > _mcpRemainingBTContainerB{}; - //purity 100%のトリプレットが生成されたものの、quality_code != 0により結局再構成されなかったmcp - -======= typedef std::map BTMap; BTMap _mcpBuildedTrackContainer{}; @@ -1228,33 +816,18 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { // purity 100%のトリプレットが生成されなかった生成されなかったmcp std::vector> _mcpRemainingBTContainerB{}; // purity 100%のトリプレットが生成されたものの、quality_code != 0により結局再構成されなかったmcp ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::vector _tripletContainer{}; -<<<<<<< HEAD - - std::vector< Triplet > _tripletContainer{}; - - class MCP_Triplet{ - public : - std::pair pair{}; - IntVec nsub{};//nhits in sub detectors. 0 VXD, 1 FTD, 2 SIT -======= class MCP_Triplet { public: std::pair pair{}; IntVec nsub{}; // nhits in sub detectors. 0 VXD, 1 FTD, 2 SIT ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::vector tripvec{}; std::vector trip2ndvec{}; std::vector trip3rdvec{}; }; -<<<<<<< HEAD - typedef std::map TripMap; -======= typedef std::map TripMap; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 TripMap _mcpTripletContainer{}; std::vector> _mcpRemainingTRContainerA{}; @@ -1262,16 +835,7 @@ class FPCCDSiliconTracking_MarlinTrk : public Processor { std::vector> _mcpRemainingTRContainerB{}; // purity 100%のトリプレットが生成されたものの、quality_code != 0により結局再構成されなかったmcp -<<<<<<< HEAD - std::vector< std::map > _mcpRemainingTRContainerA{}; - //purity 100%のトリプレットが生成されなかった生成されなかったmcp - std::vector< std::map > _mcpRemainingTRContainerB{}; - //purity 100%のトリプレットが生成されたものの、quality_code != 0により結局再構成されなかったmcp - - void TripletDebugerWithMCPRemain(int nth, std::vector< std::map > A); -======= void TripletDebugerWithMCPRemain(int nth, std::vector> A); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 MCPMap _mcpMap{}; std::vector _naviVec{}; diff --git a/source/Refitting/include/FullLDCTracking_MarlinTrk.h b/source/Refitting/include/FullLDCTracking_MarlinTrk.h index 4fb9b79..0c0ae21 100644 --- a/source/Refitting/include/FullLDCTracking_MarlinTrk.h +++ b/source/Refitting/include/FullLDCTracking_MarlinTrk.h @@ -306,7 +306,6 @@ class FullLDCTracking_MarlinTrk : public Processor { int SegmentRadialOverlap(TrackExtended* pTracki, TrackExtended* pTrackj); bool VetoMerge(TrackExtended* firstTrackExt, TrackExtended* secondTrackExt); -<<<<<<< HEAD int _nRun{}; int _nEvt{}; @@ -335,232 +334,6 @@ class FullLDCTracking_MarlinTrk : public Processor { std::string _LDCTrackCollection{}; - TrackExtendedVec _allSiTracks{}; - TrackExtendedVec _allTPCTracks{}; - TrackExtendedVec _allCombinedTracks{}; - TrackExtendedVec _allNonCombinedTPCTracks{}; - TrackExtendedVec _allNonCombinedSiTracks{}; - TrackExtendedVec _trkImplVec{}; - TrackerHitExtendedVec _allTPCHits{}; - TrackerHitExtendedVec _allVTXHits{}; - TrackerHitExtendedVec _allFTDHits{}; - TrackerHitExtendedVec _allSITHits{}; - TrackerHitExtendedVec _allSETHits{}; - TrackerHitExtendedVec _allETDHits{}; - - float PI{}, PIOVER2{}, TWOPI{}; - - float _bField{}; - float _chi2PrefitCut{}; - float _chi2FitCut{}; - - int _debug{}; - - float _dPCutForMerging{}; - float _d0CutForMerging{}; - float _z0CutForMerging{}; - float _dOmegaForMerging{}; - float _angleForMerging{}; - - int _forceMerging{}; - float _dPCutForForcedMerging{}; - float _d0CutForForcedMerging{}; - float _z0CutForForcedMerging{}; - float _dOmegaForForcedMerging{}; - float _angleForForcedMerging{}; - - int _mergeTPCSegments{}; - float _dPCutToMergeTPC{}; - float _PtCutToMergeTPC{}; - float _d0CutToMergeTPC{}; - float _z0CutToMergeTPC{}; - - float _cosThetaCutHighPtMerge{}; - float _cosThetaCutSoftHighPtMerge{}; - float _momDiffCutHighPtMerge{}; - float _momDiffCutSoftHighPtMerge{}; - float _hitDistanceCutHighPtMerge{}; - float _maxHitDistanceCutHighPtMerge{}; - float _maxFractionOfOutliersCutHighPtMerge{}; - - float _vetoMergeMomentumCut{}; - - float _initialTrackError_d0{}; - float _initialTrackError_phi0{}; - float _initialTrackError_omega{}; - float _initialTrackError_z0{}; - float _initialTrackError_tanL{}; - - double _maxChi2PerHit{}; - double _minChi2ProbForSiliconTracks{}; - float _maxAllowedPercentageOfOutliersForTrackCombination{}; - int _maxAllowedSiHitRejectionsForTrackCombination{}; - - bool _runMarlinTrkDiagnostics{}; - std::string _MarlinTrkDiagnosticsName{}; - - int _nHitsExtrapolation{}; - - int _cutOnTPCHits{}; - int _cutOnSiHits{}; - - int _assignVTXHits{}, _assignFTDHits{}, _assignSITHits{}, _assignTPCHits{}; - - int _assignSETHits{}, _assignETDHits{}; - - float _distCutForVTXHits{}, _distCutForFTDHits{}, _distCutForSITHits{}, _distCutForTPCHits{}; - - float _distCutForSETHits{}, _distCutForETDHits{}; - - float _d0TrkCut{}, _z0TrkCut{}; - - int _forbidOverlapInZTPC{}, _forbidOverlapInZComb{}; - - float _energyLossErrorTPC{}; - - LCEvent* _evt{nullptr}; - - std::map _trackExtrapolatedHelix{}; - std::set _candidateCombinedTracks{}; - - UTIL::BitField64* _encoder{nullptr}; - int getDetectorID(TrackerHit* hit) { - _encoder->setValue(hit->getCellID0()); - return (*_encoder)[lcio::LCTrackerCellID::subdet()]; - } - int getSideID(TrackerHit* hit) { - _encoder->setValue(hit->getCellID0()); - return (*_encoder)[lcio::LCTrackerCellID::side()]; - }; - int getLayerID(TrackerHit* hit) { - _encoder->setValue(hit->getCellID0()); - return (*_encoder)[lcio::LCTrackerCellID::layer()]; - }; - int getModuleID(TrackerHit* hit) { - _encoder->setValue(hit->getCellID0()); - return (*_encoder)[lcio::LCTrackerCellID::module()]; - }; - int getSensorID(TrackerHit* hit) { - _encoder->setValue(hit->getCellID0()); - return (*_encoder)[lcio::LCTrackerCellID::sensor()]; - }; -======= - - int _nRun{}; - int _nEvt{}; - - MarlinTrk::HelixFit* _fastfitter{nullptr}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem{nullptr}; - std::string _trkSystemName{}; - - bool _MSOn{}, _ElossOn{}, _SmoothOn{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 - - std::string _TPCTrackCollection{}; - std::string _SiTrackCollection{}; - std::string _TPCTrackMCPCollName{}; - std::string _SiTrackMCPCollName{}; - -<<<<<<< HEAD - double _tpc_inner_r{}; - double _tpc_outer_r{}; - double _tpc_pad_height{}; - int _tpc_nrows{}; - - // struct VXD_Layer { - // int nLadders; - // double phi0; - // double dphi; - // double senRMin; - // double supRMin; - // double length; - // double width; - // double offset; - // double senThickness; - // double supThickness; - // }; - // std::vector _VXDgeo; - - unsigned int _nLayersVTX{}; - - // struct SIT_Layer { - // int nLadders; - // double phi0; - // double dphi; - // double senRMin; - // double supRMin; - // double length; - // double width; - // double offset; - // double senThickness; - // double supThickness; - // }; - // std::vector _SITgeo; - - unsigned int _nLayersSIT{}; - - unsigned int _nLayersSET{}; - - -// struct FTD_Disk { -// int nPetals; -// double phi0; -// double dphi; -// -// double alpha; -// double rInner; -// double height; -// double innerBaseLength; -// double outerBaseLength; -// double senThickness; -// double supThickness; -// -// double senZPos_even_petal1; -// double senZPos_even_petal2; -// double senZPos_even_petal3; -// double senZPos_even_petal4; -// -// double supZPos_even_petal1; -// double supZPos_even_petal2; -// double supZPos_even_petal3; -// double supZPos_even_petal4; -// -// double senZPos_odd_petal1; -// double senZPos_odd_petal2; -// double senZPos_odd_petal3; -// double senZPos_odd_petal4; -// -// double supZPos_odd_petal1; -// double supZPos_odd_petal2; -// double supZPos_odd_petal3; -// double supZPos_odd_petal4; -// -// -// -// }; -// -// std::vector _FTDgeo; - std::vector _zLayerFTD{}; - - unsigned int _nLayersFTD{}; - int _nPhiFTD{}; - bool _petalBasedFTDWithOverlaps{}; - -} ; -======= - std::string _VTXTrackerHitCollection{}; - std::string _SITTrackerHitCollection{}; - std::string _SETTrackerHitCollection{}; - std::string _FTDPixelHitCollection{}; - std::string _FTDSpacePointCollection{}; - std::string _TPCTrackerHitCollection{}; - std::string _ETDTrackerHitCollection{}; - - std::string _LDCTrackCollection{}; - std::string m_vtxDetName{}; std::string m_forwardTrackerDetName{}; std::string m_innerBarrelTrackerDetName{}; @@ -762,6 +535,5 @@ class FullLDCTracking_MarlinTrk : public Processor { int _nPhiFTD{}; bool _petalBasedFTDWithOverlaps{}; }; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 #endif diff --git a/source/Refitting/include/RefitFinal.h b/source/Refitting/include/RefitFinal.h index aca326c..f8ebc9a 100644 --- a/source/Refitting/include/RefitFinal.h +++ b/source/Refitting/include/RefitFinal.h @@ -15,7 +15,6 @@ class IMarlinTrack; } // namespace MarlinTrk class RefitFinal : public marlin::Processor { -<<<<<<< HEAD /// Nhits cut struct struct NHitsCut{ @@ -23,8 +22,6 @@ class RefitFinal : public marlin::Processor { int nHits_min {}; // minimum number of hits }; -======= ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 public: virtual marlin::Processor* newProcessor() { return new RefitFinal; } @@ -52,12 +49,8 @@ class RefitFinal : public marlin::Processor { virtual void end(); protected: -<<<<<<< HEAD - int FitInit2(Track *track, MarlinTrk::IMarlinTrack *_marlinTrk); -======= int FitInit2(Track* track, MarlinTrk::IMarlinTrack* _marlinTrk); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /* helper function to get collection using try catch block */ lcio::LCCollection* GetCollection(lcio::LCEvent* evt, std::string colName); diff --git a/source/Refitting/include/RefitProcessor.h b/source/Refitting/include/RefitProcessor.h index ac8412e..1999d85 100644 --- a/source/Refitting/include/RefitProcessor.h +++ b/source/Refitting/include/RefitProcessor.h @@ -35,22 +35,12 @@ class IMarlinTrkSystem; class RefitProcessor : public marlin::Processor { public: -<<<<<<< HEAD - - virtual marlin::Processor* newProcessor() { return new RefitProcessor ; } - - RefitProcessor() ; - RefitProcessor(const RefitProcessor&) = delete ; - RefitProcessor& operator=(const RefitProcessor&) = delete ; - -======= virtual marlin::Processor* newProcessor() { return new RefitProcessor; } RefitProcessor(); RefitProcessor(const RefitProcessor&) = delete; RefitProcessor& operator=(const RefitProcessor&) = delete; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ @@ -87,49 +77,6 @@ class RefitProcessor : public marlin::Processor { /** Input track collection name for refitting. */ -<<<<<<< HEAD - std::string _input_track_col_name {}; - - /** Input track relations name for refitting. - */ - std::string _input_track_rel_name {}; - - /** refitted track collection name. - */ - std::string _output_track_col_name {}; - - /** Output track relations name for refitting. - */ - std::string _output_track_rel_name {}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem {nullptr}; - - bool _MSOn {}; - bool _ElossOn {}; - bool _SmoothOn {}; - - float _initialTrackError_d0{}; - float _initialTrackError_phi0{}; - float _initialTrackError_omega{}; - float _initialTrackError_z0{}; - float _initialTrackError_tanL{}; - float _maxChi2PerHit{}; - double _mass {}; - - int _n_run {}; - int _n_evt {}; - - int _initialTrackState{}; - int _fitDirection {}; - - std::string _trkSystemName {}; - - float _bField{}; - -} ; -======= std::string _input_track_col_name{}; /** Input track relations name for refitting. @@ -170,6 +117,5 @@ class RefitProcessor : public marlin::Processor { float _bField{}; }; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 #endif diff --git a/source/Refitting/include/SiliconTracking_MarlinTrk.h b/source/Refitting/include/SiliconTracking_MarlinTrk.h index fb11c66..0d434f5 100644 --- a/source/Refitting/include/SiliconTracking_MarlinTrk.h +++ b/source/Refitting/include/SiliconTracking_MarlinTrk.h @@ -181,17 +181,6 @@ class LCRelationNavigator; */ class SiliconTracking_MarlinTrk : public Processor { public: -<<<<<<< HEAD - - virtual Processor* newProcessor() { return new SiliconTracking_MarlinTrk ; } - - - SiliconTracking_MarlinTrk() ; - SiliconTracking_MarlinTrk(const SiliconTracking_MarlinTrk&) = delete ; - SiliconTracking_MarlinTrk& operator=(const SiliconTracking_MarlinTrk&) = delete ; - - /** -======= virtual Processor* newProcessor() { return new SiliconTracking_MarlinTrk; } SiliconTracking_MarlinTrk(); @@ -199,7 +188,6 @@ class SiliconTracking_MarlinTrk : public Processor { SiliconTracking_MarlinTrk& operator=(const SiliconTracking_MarlinTrk&) = delete; /** ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 * Initialization */ virtual void init(); @@ -219,26 +207,6 @@ class SiliconTracking_MarlinTrk : public Processor { virtual void end(); protected: -<<<<<<< HEAD - - int _nRun {}; - int _nEvt {}; - EVENT::LCEvent* _current_event{nullptr}; - - int _nDivisionsInPhi{}; - int _nDivisionsInTheta{}; - int _nLayers{}; - - MarlinTrk::HelixFit* _fastfitter{nullptr}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem {nullptr}; - bool _runMarlinTrkDiagnostics{}; - std::string _MarlinTrkDiagnosticsName{}; - - bool _MSOn{}, _ElossOn{}, _SmoothOn {}; -======= int _nRun{}; int _nEvt{}; EVENT::LCEvent* _current_event{nullptr}; @@ -256,29 +224,12 @@ class SiliconTracking_MarlinTrk : public Processor { std::string _MarlinTrkDiagnosticsName{}; bool _MSOn{}, _ElossOn{}, _SmoothOn{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** switches: False for backward compatible (default). True to apply new methods. */ bool _useSimpleUpdatedCoreBin{}; bool _useSimpleAttachHitToTrack{}; -<<<<<<< HEAD - - float _initialTrackError_d0{}; - float _initialTrackError_phi0{}; - float _initialTrackError_omega{}; - float _initialTrackError_z0{}; - float _initialTrackError_tanL{}; - - double _maxChi2PerHit{}; - - bool _UseEventDisplay{}; - int _detector_model_for_drawing{}; - std::vector _colours{}; - float _helix_max_r{}; - -======= float _initialTrackError_d0{}; float _initialTrackError_phi0{}; @@ -293,27 +244,15 @@ class SiliconTracking_MarlinTrk : public Processor { std::vector _colours{}; float _helix_max_r{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 void drawEvent(); // histogram member variables -<<<<<<< HEAD - - bool _createDiagnosticsHistograms{}; - DiagnosticsHistograms::Histograms* _histos{nullptr}; - - - int _ntriplets{}, _ntriplets_good{}, _ntriplets_2MCP{}, _ntriplets_3MCP{}, _ntriplets_1MCP_Bad{}, _ntriplets_bad{}; - - -======= bool _createDiagnosticsHistograms{}; DiagnosticsHistograms::Histograms* _histos{nullptr}; int _ntriplets{}, _ntriplets_good{}, _ntriplets_2MCP{}, _ntriplets_3MCP{}, _ntriplets_1MCP_Bad{}, _ntriplets_bad{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** helper function to get collection using try catch block */ LCCollection* GetCollection(LCEvent* evt, std::string colName); @@ -322,16 +261,9 @@ class SiliconTracking_MarlinTrk : public Processor { /** input MCParticle collection and threshold used for Drawing */ -<<<<<<< HEAD - std::string _colNameMCParticles{}; - float _MCpThreshold {}; - - -======= std::string _colNameMCParticles{}; float _MCpThreshold{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /// Compare tracks according to their chi2/ndf struct compare_TrackExtended { // n.b.: a and b should be TrackExtended const *, but the getters are not const :-( @@ -341,26 +273,11 @@ class SiliconTracking_MarlinTrk : public Processor { return (a->getChi2() / a->getNDF() < b->getChi2() / b->getNDF()); } }; -<<<<<<< HEAD - - -======= - ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 std::string _VTXHitCollection{}; std::string _FTDPixelHitCollection{}; std::string _FTDSpacePointCollection{}; std::string _SITHitCollection{}; std::string _siTrkCollection{}; -<<<<<<< HEAD - - std::vector< LCCollection* > _colTrackerHits{}; - std::map< LCCollection*, std::string > _colNamesTrackerHits{}; - - std::vector _sectors{}; - std::vector _sectorsFTD{}; - -======= std::vector _colTrackerHits{}; std::map _colNamesTrackerHits{}; @@ -368,7 +285,6 @@ class SiliconTracking_MarlinTrk : public Processor { std::vector _sectors{}; std::vector _sectorsFTD{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** * A helper class to allow good code readability by accessing tracks with N hits. * As the smalest valid track contains three hits, but the first index in a vector is 0, @@ -400,16 +316,6 @@ class SiliconTracking_MarlinTrk : public Processor { } protected: -<<<<<<< HEAD - std::vector< TrackExtendedVec > _tracksNHits{}; - size_t _maxIndex{}; /// local cache variable to avoid calculation overhead - }; - - TracksWithNHitsContainer _tracksWithNHitsContainer{}; - - int InitialiseVTX(LCEvent * evt); - int InitialiseFTD(LCEvent * evt); -======= std::vector _tracksNHits{}; size_t _maxIndex{}; /// local cache variable to avoid calculation overhead }; @@ -418,7 +324,6 @@ class SiliconTracking_MarlinTrk : public Processor { int InitialiseVTX(LCEvent* evt); int InitialiseFTD(LCEvent* evt); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 void ProcessOneSector(int iSectorPhi, int iSectorTheta); void CleanUp(); TrackExtended* TestTriplet(TrackerHitExtended* outerHit, TrackerHitExtended* middleHit, TrackerHitExtended* innerHit, @@ -439,11 +344,6 @@ class SiliconTracking_MarlinTrk : public Processor { int AttachHitToTrack(TrackExtended* trackAR, TrackerHitExtended* hit, int iopt); void FinalRefit(LCCollectionVec* trk_col, LCCollectionVec* rel_col); -<<<<<<< HEAD - -======= - ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _bField{}; float _chi2WRPhiTriplet{}; float _chi2WRPhiQuartet{}; @@ -453,82 +353,6 @@ class SiliconTracking_MarlinTrk : public Processor { float _chi2WZSeptet{}; float _minDistCutAttach{}; int _minimalLayerToAttach{}; -<<<<<<< HEAD - - // two pi is not a constant in cmath. Calculate it, once! - static const double TWOPI; - - double _dPhi{}; - double _dTheta{}; - double _dPhiFTD{}; - - - - std::vector _Combinations{}; - std::vector _CombinationsFTD{}; - - float _resolutionRPhiVTX{}; - float _resolutionZVTX{}; - - float _resolutionRPhiFTD{}; - float _resolutionZFTD{}; - - float _resolutionRPhiSIT{}; - float _resolutionZSIT{}; - - float _phiCutForMerging{}; - float _tanlambdaCutForMerging{}; - float _angleCutForMerging{}; - - int _print{}; - int _checkForDelta{}; - float _minDistToDelta{}; - - float _distRPhi{}; - float _distZ{}; - float _chi2FitCut{}; - - - TrackExtendedVec _trackImplVec{}; - - - float _cutOnD0{}, _cutOnZ0{}, _cutOnOmega{}, _cutOnPt{}; - - int _minimalHits{}; - int _nHitsChi2{}; - int _attachFast{}; - - int _max_hits_per_sector{}; - - int _nTotalVTXHits{},_nTotalFTDHits{},_nTotalSITHits{}; - int _useSIT{}; - - std::string _trkSystemName {}; - - // int _createMap; - - UTIL::BitField64* _encoder{nullptr}; - int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; } - int getSideID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::side()]; }; - int getLayerID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::layer()]; }; - int getModuleID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::module()]; }; - int getSensorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; - - void setupGeom(const dd4hep::Detector& theDetector); - - - unsigned int _nLayersVTX{}; - - unsigned int _nLayersSIT{}; - - - std::vector _zLayerFTD{}; - - unsigned int _nlayersFTD{}; - bool _petalBasedFTDWithOverlaps{}; - int _nPhiFTD{}; - -======= // two pi is not a constant in cmath. Calculate it, once! static const double TWOPI; @@ -612,7 +436,6 @@ class SiliconTracking_MarlinTrk : public Processor { bool _petalBasedFTDWithOverlaps{}; int _nPhiFTD{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 int _output_track_col_quality{}; static const int _output_track_col_quality_GOOD; static const int _output_track_col_quality_FAIR; diff --git a/source/Refitting/include/TrackSubsetProcessor.h b/source/Refitting/include/TrackSubsetProcessor.h index 442ffe0..413ec38 100644 --- a/source/Refitting/include/TrackSubsetProcessor.h +++ b/source/Refitting/include/TrackSubsetProcessor.h @@ -43,18 +43,6 @@ using namespace marlin; */ class TrackSubsetProcessor : public Processor { -<<<<<<< HEAD - - public: - - virtual Processor* newProcessor() { return new TrackSubsetProcessor ; } - - - TrackSubsetProcessor() ; - TrackSubsetProcessor(const TrackSubsetProcessor&) = delete ; - TrackSubsetProcessor& operator=(const TrackSubsetProcessor&) = delete ; - -======= public: virtual Processor* newProcessor() { return new TrackSubsetProcessor; } @@ -62,7 +50,6 @@ class TrackSubsetProcessor : public Processor { TrackSubsetProcessor(const TrackSubsetProcessor&) = delete; TrackSubsetProcessor& operator=(const TrackSubsetProcessor&) = delete; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ @@ -89,52 +76,18 @@ class TrackSubsetProcessor : public Processor { void removeShortTracks(std::vector& tracks); /** Input collection names */ -<<<<<<< HEAD - std::vector< std::string > _trackInputColNames{}; - - /** Output collection name */ - std::string _trackOutputColName{}; - - MarlinTrk::IMarlinTrkSystem* _trkSystem{nullptr}; - std::string _trkSystemName {}; - - bool _MSOn {}; - bool _ElossOn {}; - bool _SmoothOn {}; - bool _removeShortTracks {}; -======= std::vector _trackInputColNames{}; /** Output collection name */ std::string _trackOutputColName{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 MarlinTrk::IMarlinTrkSystem* _trkSystem{nullptr}; std::string _trkSystemName{}; -<<<<<<< HEAD - float _initialTrackError_d0{}; - float _initialTrackError_phi0{}; - float _initialTrackError_omega{}; - float _initialTrackError_z0{}; - float _initialTrackError_tanL{}; - - double _maxChi2PerHit{}; - - float _bField{}; - - int _nRun {}; - int _nEvt {}; - - double _omega{}; - -} ; -======= bool _MSOn{}; bool _ElossOn{}; bool _SmoothOn{}; bool _removeShortTracks{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 float _initialTrackError_d0{}; float _initialTrackError_phi0{}; @@ -179,13 +132,7 @@ class TrackQI { inline double operator()(Track* track) { return ROOT::Math::chisquared_cdf_c(track->getChi2(), track->getNdf()); } protected: -<<<<<<< HEAD - - MarlinTrk::IMarlinTrkSystem* _trkSystem{nullptr}; - -======= MarlinTrk::IMarlinTrkSystem* _trkSystem{nullptr}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 }; #endif diff --git a/source/Refitting/include/TruthTrackFinder.h b/source/Refitting/include/TruthTrackFinder.h index 22a7335..f31a60c 100644 --- a/source/Refitting/include/TruthTrackFinder.h +++ b/source/Refitting/include/TruthTrackFinder.h @@ -23,17 +23,6 @@ using namespace marlin; using namespace AIDA; class TruthTrackFinder : public Processor { -<<<<<<< HEAD - - public: - - virtual Processor* newProcessor() { return new TruthTrackFinder ; } - - TruthTrackFinder() ; - TruthTrackFinder(const TruthTrackFinder&) = delete ; - TruthTrackFinder& operator=(const TruthTrackFinder&) = delete ; - -======= public: virtual Processor* newProcessor() { return new TruthTrackFinder; } @@ -41,7 +30,6 @@ class TruthTrackFinder : public Processor { TruthTrackFinder(const TruthTrackFinder&) = delete; TruthTrackFinder& operator=(const TruthTrackFinder&) = delete; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 // Initialisation - run at the beginning to start histograms, etc. virtual void init(); @@ -80,21 +68,6 @@ class TruthTrackFinder : public Processor { void removeHitsSameLayer(const std::vector&, std::vector&); // Collection names for (in/out)put -<<<<<<< HEAD - std::vector m_inputTrackerHitCollections {}; - std::vector m_inputTrackerHitRelationCollections {}; - std::string m_inputParticleCollection {}; - std::string m_outputTrackCollection {}; - std::string m_outputTrackRelationCollection{}; - - bool m_useTruthInPrefit{}; - bool m_fitForward{}; - - // Run and event counters - int m_eventNumber {}; - int m_runNumber {}; - -======= std::vector m_inputTrackerHitCollections{}; std::vector m_inputTrackerHitRelationCollections{}; std::string m_inputParticleCollection{}; @@ -108,7 +81,6 @@ class TruthTrackFinder : public Processor { int m_eventNumber{}; int m_runNumber{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 // Track fit factory MarlinTrk::IMarlinTrkSystem* trackFactory{nullptr}; @@ -121,12 +93,6 @@ class TruthTrackFinder : public Processor { double m_maxChi2perHit{}; double m_magneticField{}; int m_fitFails{}; -<<<<<<< HEAD - - -} ; -======= }; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 #endif diff --git a/source/Refitting/include/TruthTracker.h b/source/Refitting/include/TruthTracker.h index 0140ba2..00b8ed5 100644 --- a/source/Refitting/include/TruthTracker.h +++ b/source/Refitting/include/TruthTracker.h @@ -74,23 +74,12 @@ class IMarlinTrkSystem; */ class TruthTracker : public marlin::Processor { public: -<<<<<<< HEAD - - virtual marlin::Processor* newProcessor() { return new TruthTracker ; } - - - TruthTracker() ; - TruthTracker(const TruthTracker&) = delete ; - TruthTracker& operator=(const TruthTracker&) = delete ; - -======= virtual marlin::Processor* newProcessor() { return new TruthTracker; } TruthTracker(); TruthTracker(const TruthTracker&) = delete; TruthTracker& operator=(const TruthTracker&) = delete; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ @@ -124,18 +113,6 @@ class TruthTracker : public marlin::Processor { }; protected: -<<<<<<< HEAD - - - const LCObjectVec* getSimHits( TrackerHit* trkhit, const FloatVec* weights = NULL); - - UTIL::BitField64* _encoder{nullptr}; - int getDetectorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::subdet()]; } - int getSideID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::side()]; }; - int getLayerID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::layer()]; }; - int getModuleID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::module()]; }; - int getSensorID(TrackerHit* hit) { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; -======= const LCObjectVec* getSimHits(TrackerHit* trkhit, const FloatVec* weights = NULL); UTIL::BitField64* _encoder{nullptr}; @@ -159,7 +136,6 @@ class TruthTracker : public marlin::Processor { _encoder->setValue(hit->getCellID0()); return (*_encoder)[lcio::LCTrackerCellID::sensor()]; }; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /** helper function to get collection using try catch block */ LCCollection* GetCollection(LCEvent* evt, std::string colName); @@ -182,29 +158,6 @@ class TruthTracker : public marlin::Processor { /** input MCParticle collection */ -<<<<<<< HEAD - std::string _colNameMCParticles{}; - - /** input TrackerHit collections - */ - std::vector< std::string > _colNamesTrackerHits{}; - - /** input relation collections - */ - std::vector< std::string > _colNamesTrackerHitRelations{}; - - std::vector< LCCollection* > _colTrackerHits{}; - std::vector< LCRelationNavigator* > _navTrackerHitRel{}; - - /** output track collection - */ - std::string _output_track_col_name {}; - LCCollectionVec* _trackVec{nullptr}; - - /** Output track relations - */ - std::string _output_track_rel_name {}; -======= std::string _colNameMCParticles{}; /** input TrackerHit collections @@ -226,33 +179,10 @@ class TruthTracker : public marlin::Processor { /** Output track relations */ std::string _output_track_rel_name{}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 LCCollectionVec* _trackRelVec{nullptr}; /** output track segments collection, used for tracks which cannot be formed from a single fit */ -<<<<<<< HEAD - std::string _output_track_segments_col_name {}; - LCCollectionVec* _trackSegmentsVec{nullptr}; - - /** Output track segments relations, used for tracks which cannot be formed from a single fit - */ - std::string _output_track_segment_rel_name {}; - LCCollectionVec* _trackSegmentsRelVec{nullptr}; - - int _nMCP{}; - - int _n_run {}; - int _n_evt {}; - - float _MCpThreshold {}; - - bool _useMCParticleParametersFotInitOfFit{}; - - /** pointer to the IMarlinTrkSystem instance - */ - MarlinTrk::IMarlinTrkSystem* _trksystem {nullptr}; -======= std::string _output_track_segments_col_name{}; LCCollectionVec* _trackSegmentsVec{nullptr}; @@ -273,44 +203,11 @@ class TruthTracker : public marlin::Processor { /** pointer to the IMarlinTrkSystem instance */ MarlinTrk::IMarlinTrkSystem* _trksystem{nullptr}; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 bool _runMarlinTrkDiagnostics{}; std::string _MarlinTrkDiagnosticsName{}; bool _FitTracksWithMarlinTrk{}; bool _create_prefit_using_MarlinTrk{}; -<<<<<<< HEAD - - bool _MSOn {}; - bool _ElossOn {}; - bool _SmoothOn {}; - - float _initialTrackError_d0{}; - float _initialTrackError_phi0{}; - float _initialTrackError_omega{}; - float _initialTrackError_z0{}; - float _initialTrackError_tanL{}; - - bool _UseIterativeFitting{}; - bool _UseEventDisplay{}; - - double _maxChi2PerHit{}; - - double _Bz{}; - - unsigned _nCreatedTracks{}; - - EVENT::LCEvent* _current_event{nullptr}; - - int _detector_model_for_drawing{}; - std::vector _colours{}; - float _helix_max_r{}; - - std::string _trkSystemName {}; - - int _fitDirection {}; -} ; -======= bool _MSOn{}; bool _ElossOn{}; @@ -341,6 +238,5 @@ class TruthTracker : public marlin::Processor { int _fitDirection{}; }; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 #endif diff --git a/source/Refitting/src/DDCellsAutomatonMV.cc b/source/Refitting/src/DDCellsAutomatonMV.cc index d5e984f..03527bd 100644 --- a/source/Refitting/src/DDCellsAutomatonMV.cc +++ b/source/Refitting/src/DDCellsAutomatonMV.cc @@ -432,19 +432,8 @@ void DDCellsAutomatonMV::processEvent(LCEvent* evt) { } else { streamlog_out(DEBUG2) << "Keeping track because of good helix fit: chi2/ndf = " << chi2OverNdf << "\n"; } -<<<<<<< HEAD - else { - streamlog_out( DEBUG2 ) << "Keeping track because of good helix fit: chi2/ndf = " << chi2OverNdf << "\n"; - } - } - catch( VXDHelixFitterException& e ){ - - - streamlog_out( DEBUG2 ) << "Track rejected, because fit failed: " << e.what() << "\n"; -======= } catch (VXDHelixFitterException& e) { streamlog_out(DEBUG2) << "Track rejected, because fit failed: " << e.what() << "\n"; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 delete trackCand; continue; } @@ -481,25 +470,8 @@ void DDCellsAutomatonMV::processEvent(LCEvent* evt) { continue; } -<<<<<<< HEAD - // debug - //streamlog_out(DEBUG4) << " Kalman fitting: deleting track " << trackCand << std::endl ; - - delete trackCand; - - continue; - - } - - - } - catch( FitterException& e ){ - - streamlog_out( DEBUG4 ) << "Track rejected, because fit failed: " << e.what() << "\n"; -======= } catch (FitterException& e) { streamlog_out(DEBUG4) << "Track rejected, because fit failed: " << e.what() << "\n"; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 delete trackCand; continue; } @@ -590,16 +562,6 @@ void DDCellsAutomatonMV::processEvent(LCEvent* evt) { // Applying a x2/ndf cut on final tracks -<<<<<<< HEAD - } - } - - catch( FitterException& e ){ - - streamlog_out( DEBUG4 ) << "DDCellsAutomatonMV: track couldn't be finalized due to fitter error: " << e.what() << "\n"; - delete trackImpl; - } -======= if (((1.0 * trackImpl->getChi2()) / (1.0 * trackImpl->getNdf())) < 10.0) { trackVec->addElement(trackImpl); @@ -612,7 +574,6 @@ void DDCellsAutomatonMV::processEvent(LCEvent* evt) { << "\n"; delete trackImpl; } ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 } } // Finalisation ends diff --git a/source/Refitting/src/RefitFinal.cc b/source/Refitting/src/RefitFinal.cc index eb17c3b..5db3223 100644 --- a/source/Refitting/src/RefitFinal.cc +++ b/source/Refitting/src/RefitFinal.cc @@ -52,18 +52,9 @@ RefitFinal::RefitFinal() : Processor("RefitFinal") { registerProcessorParameter("EnergyLossOn", "Use Energy Loss in Fit", _ElossOn, bool(true)); -<<<<<<< HEAD - - registerProcessorParameter("SmoothOn", "Smooth All Mesurement Sites in Fit", - _SmoothOn, bool(false)); - - registerProcessorParameter("Max_Chi2_Incr", - "maximum allowable chi2 increment when moving from one site to another", -======= registerProcessorParameter("SmoothOn", "Smooth All Mesurement Sites in Fit", _SmoothOn, bool(false)); registerProcessorParameter("Max_Chi2_Incr", "maximum allowable chi2 increment when moving from one site to another", ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 _Max_Chi2_Incr, _Max_Chi2_Incr); registerProcessorParameter("ReferencePoint", @@ -78,49 +69,13 @@ RefitFinal::RefitFinal() : Processor("RefitFinal") { registerProcessorParameter("MinClustersOnTrackAfterFit", "Final minimum number of track clusters", _minClustersOnTrackAfterFit, int(4)); -<<<<<<< HEAD - - registerProcessorParameter("ReducedChi2Cut", "Cut on the reduced chi square", _ReducedChi2Cut, - double(-1.)); - - registerProcessorParameter("NHitsCuts", "Cuts on Nhits: ,,... ", _NHitsCutsStr, - StringVec(0)); - -======= ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 } void RefitFinal::init() { // usually a good idea to printParameters(); -<<<<<<< HEAD - // Extracting nHits cuts - _NHitsCuts.resize( _NHitsCutsStr.size() / 2 ) ; - - unsigned i=0, index=0 ; - while( i < _NHitsCutsStr.size() ) { - std::vector detIds; - // Extracting the comma-separated list of detector IDs - std::string split; - std::istringstream ss(_NHitsCutsStr[ i++ ].c_str()); - while ( std::getline(ss, split, ',') ) - _NHitsCuts[index].detIDs.push_back(std::atoi(split.c_str())); - // Storing the nHits value - _NHitsCuts[index].nHits_min = std::atoi( _NHitsCutsStr[ i++ ].c_str() ); - - streamlog_out(DEBUG9) << "nHits cut " << index << ": " << _NHitsCuts[index].nHits_min << " from detIds: "; - for (int detId : _NHitsCuts[index].detIDs) streamlog_out(DEBUG9) << " " << detId; - streamlog_out(DEBUG9) << std::endl; - - ++index ; - } - - _trksystem = - MarlinTrk::Factory::createMarlinTrkSystem("DDKalTest", nullptr, ""); -======= _trksystem = MarlinTrk::Factory::createMarlinTrkSystem("DDKalTest", nullptr, ""); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 /////////////////////////////// @@ -141,20 +96,11 @@ void RefitFinal::init() { void RefitFinal::processRunHeader(LCRunHeader*) { ++_n_run; } -<<<<<<< HEAD -void RefitFinal::processEvent(LCEvent *evt) { - - // set the correct configuration for the tracking system for this event - MarlinTrk::TrkSysConfig< MarlinTrk::IMarlinTrkSystem::CFG::useQMS> mson( _trksystem, _MSOn ) ; - MarlinTrk::TrkSysConfig< MarlinTrk::IMarlinTrkSystem::CFG::usedEdx> elosson( _trksystem,_ElossOn) ; - MarlinTrk::TrkSysConfig< MarlinTrk::IMarlinTrkSystem::CFG::useSmoothing> smoothon( _trksystem,_SmoothOn) ; -======= void RefitFinal::processEvent(LCEvent* evt) { // set the correct configuration for the tracking system for this event MarlinTrk::TrkSysConfig mson(_trksystem, _MSOn); MarlinTrk::TrkSysConfig elosson(_trksystem, _ElossOn); MarlinTrk::TrkSysConfig smoothon(_trksystem, _SmoothOn); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 ++_n_evt; @@ -165,14 +111,8 @@ void RefitFinal::processEvent(LCEvent* evt) { } // establish the track collection that will be created -<<<<<<< HEAD - LCCollectionVec *trackVec = new LCCollectionVec(LCIO::TRACK); - UTIL::BitField64 encoder(lcio::LCTrackerCellID::encoding_string()); - encoder.reset(); // reset to 0 -======= LCCollectionVec* trackVec = new LCCollectionVec(LCIO::TRACK); _encoder->reset(); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 // if we want to point back to the hits we need to set the flag LCFlagImpl trkFlag(0); trkFlag.setBit(LCIO::TRBIT_HITS); @@ -210,8 +150,8 @@ void RefitFinal::processEvent(LCEvent* evt) { for (int iHit = 0; iHit < nHitsTrack && iHit < nHitsTrack; ++iHit) { marlin_trk->addHit(trkHits[iHit]); - encoder.setValue(trkHits[iHit]->getCellID0()) ; - ++hitInSubDet[encoder[UTIL::LCTrackerCellID::subdet()]]; + _encoder->setValue(trkHits[iHit]->getCellID0()); + ++hitInSubDet[_encoder->operator[](UTIL::LCTrackerCellID::subdet())]; } int init_status = FitInit2(track, marlin_trk.get()); @@ -220,33 +160,7 @@ void RefitFinal::processEvent(LCEvent* evt) { continue; } -<<<<<<< HEAD - // Checking numbers of hits in subdetectors - if (_NHitsCuts.size() > 0) { - bool skipTrack(false); - for (const NHitsCut& cut : _NHitsCuts) { - // Summing the number of hits from each detector - int nHits = 0; - for (int detId : cut.detIDs) { - nHits += hitInSubDet[detId]; - } - // Checking if the cut is satisfied _before_ the fit - if (nHits < cut.nHits_min) { - streamlog_out(DEBUG5) << "Skip track " << track->id() << ": " - << " not enough detector hits: " << nHits << "/" << cut.nHits_min << std::endl; - skipTrack = true; - counter++; - break; - } - } - if (skipTrack) continue; - } - - streamlog_out(DEBUG4) << "Refit: Trackstate after initialisation\n" - << marlin_trk->toString() << std::endl; -======= streamlog_out(DEBUG4) << "Refit: Trackstate after initialisation\n" << marlin_trk->toString() << std::endl; ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 streamlog_out(DEBUG5) << "track initialised " << std::endl; @@ -280,12 +194,8 @@ void RefitFinal::processEvent(LCEvent* evt) { marlin_trk->getHitsInFit(hits_in_fit); if (int(hits_in_fit.size()) < _minClustersOnTrackAfterFit) { -<<<<<<< HEAD - streamlog_out(DEBUG5) << "Less than " << _minClustersOnTrackAfterFit << " hits in fit: Track " -======= streamlog_out(DEBUG3) << "Less than " << _minClustersOnTrackAfterFit << " hits in fit: Track " ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 "Discarded. Number of hits = " << trkHits.size() << std::endl; continue; diff --git a/source/Refitting/src/SiliconTracking_MarlinTrk.cc b/source/Refitting/src/SiliconTracking_MarlinTrk.cc index 4af4792..71eecaa 100644 --- a/source/Refitting/src/SiliconTracking_MarlinTrk.cc +++ b/source/Refitting/src/SiliconTracking_MarlinTrk.cc @@ -141,34 +141,7 @@ class Histograms { exit(1); } -<<<<<<< HEAD - if( _h2D.at( idx ) ){ - streamlog_out( ERROR ) << "create2D: Histogram already created ERROR exit(1) called from File" << __FILE__ << " line " << __LINE__ << std::endl; - exit(1); - } - - _h2D.at( idx ) = new TH2F(n, t, nBinX, minX, maxX, nBinY, minY, maxY) ; - - streamlog_out( DEBUG ) << " create 2D histo " << n << " at index " << idx << std::endl ; - - } - - void fill2D( int idx , double valx, double valy, double weight=1.0 ){ _h2D.at( idx )->Fill(valx, valy, weight) ; } - - - protected: - - std::vector _h1D{}; - std::vector _h2D{}; - - }; - - - -} -======= _h2D.at(idx) = new TH2F(n, t, nBinX, minX, maxX, nBinY, minY, maxY); ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 streamlog_out(DEBUG) << " create 2D histo " << n << " at index " << idx << std::endl; } @@ -2113,21 +2086,12 @@ void SiliconTracking_MarlinTrk::CreateTrack(TrackExtended* trackAR) { if (found == 1) { if (_useSimpleAttachHitToTrack) { // improvement for the fitting -<<<<<<< HEAD - trackAR->ClearTrackerHitExtendedVec(); - for (int i=0;iClearTrackerHitExtendedVec(); for (int i = 0; i < nHits; ++i) { int i_opt = 2; TrackerHitExtended* trkHit = hitVec[i]; AttachHitToTrack(trackOld, trkHit, i_opt); } ->>>>>>> 665b5fed8309e84cc4197b80012c02c680e32b90 } else { // backward compatible diff --git a/source/Utils/include/SplitCollectionByLayer.h b/source/Utils/include/SplitCollectionByLayer.h index 5fcccb8..e2d83e2 100644 --- a/source/Utils/include/SplitCollectionByLayer.h +++ b/source/Utils/include/SplitCollectionByLayer.h @@ -1,14 +1,16 @@ #ifndef SplitCollectionByLayer_h #define SplitCollectionByLayer_h 1 -#include "marlin/EventModifier.h" #include "marlin/Processor.h" +#include "marlin/EventModifier.h" #include "lcio.h" #include -using namespace lcio; -using namespace marlin; + +using namespace lcio ; +using namespace marlin ; + /** Utility processor that allows to split a collection of Hits into * several collections based on the layer information in the cellID word. @@ -23,59 +25,81 @@ using namespace marlin; */ class SplitCollectionByLayer : public Processor { + protected: - /// helper struct - struct OutColInfo { - std::string name{}; - unsigned layer0{}; - unsigned layer1{}; + + ///helper struct + struct OutColInfo{ + OutColInfo(const OutColInfo&) = default; + OutColInfo& operator=(const OutColInfo&) = default; + + std::vector layers{} ; LCCollection* collection{nullptr}; + OutColInfo() : layers(std::vector(0)), collection(nullptr) {} }; /// Enum used for hit types - enum HitType { SimTrackerHitType = 1, TrackerHitType, SimCalorimeterHitType, CalorimeterHitType, UnkownType }; + enum HitType{ + SimTrackerHitType = 1, + TrackerHitType, + TrackerHitPlaneType, + SimCalorimeterHitType, + CalorimeterHitType, + UnkownType + }; + + public: -public: - virtual Processor* newProcessor() { return new SplitCollectionByLayer; } + virtual Processor* newProcessor() { return new SplitCollectionByLayer ; } - SplitCollectionByLayer(); - SplitCollectionByLayer(const SplitCollectionByLayer&) = delete; - SplitCollectionByLayer& operator=(const SplitCollectionByLayer&) = delete; - virtual const std::string& name() const { return Processor::name(); } + SplitCollectionByLayer() ; + SplitCollectionByLayer(const SplitCollectionByLayer&) = delete ; + SplitCollectionByLayer& operator=(const SplitCollectionByLayer&) = delete ; + + virtual const std::string & name() const { return Processor::name() ; } /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ - virtual void init(); + virtual void init() ; /** Called for every run. */ - virtual void processRunHeader(LCRunHeader* run); + virtual void processRunHeader( LCRunHeader* run ) ; /** Called for every event - the working horse. */ - virtual void processEvent(LCEvent* evt); + virtual void processEvent( LCEvent * evt ) ; + + + virtual void check( LCEvent * evt ) ; - virtual void check(LCEvent* evt); /** Called after data processing for clean up. */ - virtual void end(); + virtual void end() ; + + + protected: -protected: ////Input collection name. - std::string _colName{}; + std::string _colName {}; /// Output collections and layers: - StringVec _outColAndLayers{}; + StringVec _outColAndLayers {}; + + /// Whether to add empty collections to the event + bool _addEmptyCollections{false} ; - std::vector _outCols{}; + std::map _outCols{} ; - HitType _type{}; + HitType _type {}; - int _nRun{}; - int _nEvt{}; -}; + int _nRun {}; + int _nEvt {}; +} ; #endif + + diff --git a/source/Utils/src/SplitCollectionByLayer.cc b/source/Utils/src/SplitCollectionByLayer.cc index a4218a6..6ad2133 100644 --- a/source/Utils/src/SplitCollectionByLayer.cc +++ b/source/Utils/src/SplitCollectionByLayer.cc @@ -1,187 +1,254 @@ #include "SplitCollectionByLayer.h" -#include #include +#include +#include -#include -#include +#include #include #include -#include +#include +#include +#include #include // #include "UTIL/LCTrackerConf.h" // #include -using namespace lcio; -using namespace marlin; -SplitCollectionByLayer aSplitCollectionByLayer; +using namespace lcio ; +using namespace marlin ; + + +SplitCollectionByLayer aSplitCollectionByLayer ; + + + +SplitCollectionByLayer::SplitCollectionByLayer() : Processor("SplitCollectionByLayer") , + _nRun(0), _nEvt(0) { -SplitCollectionByLayer::SplitCollectionByLayer() : Processor("SplitCollectionByLayer"), _nRun(0), _nEvt(0) { // modify processor description - _description = "split a hit collection based on the layer number of the hits "; + _description = "split a hit collection based on the layer number of the hits " ; + // register steering parameters: name, description, class-variable, default value - registerProcessorParameter("InputCollection", "Name of the input collection with hits", _colName, - std::string("FTDCollection")); - - StringVec outColEx; - outColEx.push_back("FTD_PIXELCollection"); - outColEx.push_back("0"); - outColEx.push_back("1"); - outColEx.push_back("FTD_STRIPCollection"); - outColEx.push_back("2"); - outColEx.push_back("6"); - - registerProcessorParameter("OutputCollections", "Name of the output collection with start and end layer number", - _outColAndLayers, outColEx); + registerProcessorParameter("InputCollection" , + "Name of the input collection with hits" , + _colName , + std::string("FTDCollection") + ); + + StringVec outColEx ; + outColEx.push_back("FTD_PIXELCollection") ; + outColEx.push_back("0") ; + outColEx.push_back("1") ; + outColEx.push_back("FTD_STRIPCollection") ; + outColEx.push_back("2") ; + outColEx.push_back("6") ; + + registerProcessorParameter("OutputCollections" , + "Name of the output collection with start and end layer number" , + _outColAndLayers , + outColEx + ); + + registerProcessorParameter("KeepEmptyCollections" , + "Whether collections should be added to the event even if they are empty" , + _addEmptyCollections , + false + ); + + } + template -long cellIDFromHit(const LCObject* o) { - long id = -1; - const T* h = dynamic_cast(o); - if (h) - id = (h->getCellID0() & 0xffffffff) | ((long(h->getCellID1()) << 32) & 0xffffffff00000000); - return id; +long cellIDFromHit( const LCObject* o){ + long id = -1 ; + const T* h = dynamic_cast( o ) ; + if( h ) id = ( h->getCellID0() & 0xffffffff ) | ( ( long(h->getCellID1()) << 32 ) & 0xffffffff00000000 ) ; + return id ; } + + void SplitCollectionByLayer::init() { - streamlog_out(DEBUG) << " init called " << std::endl; + + streamlog_out(DEBUG) << " init called " << std::endl ; // usually a good idea to - printParameters(); + printParameters() ; + + + unsigned i=0; + while( i < _outColAndLayers.size() ){ - _outCols.resize(_outColAndLayers.size() / 3); + std::string name = _outColAndLayers[ i++ ] ; + size_t layerStart = std::atoi( _outColAndLayers[ i++ ].c_str() ) ; + size_t layerEnd = std::atoi( _outColAndLayers[ i++ ].c_str() ) ; - unsigned i = 0, index = 0; - while (i < _outColAndLayers.size()) { - _outCols[index].name = _outColAndLayers[i++]; - _outCols[index].layer0 = std::atoi(_outColAndLayers[i++].c_str()); - _outCols[index].layer1 = std::atoi(_outColAndLayers[i++].c_str()); - _outCols[index].collection = 0; + // Ensuring that a collection setup is created for this name + if (_outCols.find(name) == _outCols.end()) { + _outCols[name] = OutColInfo(); + } - ++index; + // Adding layers for the collection setup + for (size_t layer = layerStart; layer <= layerEnd; ++layer) { + _outCols[name].layers.push_back(layer); + } } - _nRun = 0; - _nEvt = 0; + streamlog_out(MESSAGE) << "Will split collection " << _colName << " by layers into the following collections:" << std::endl; + for(const auto &outCol : _outCols){ + streamlog_out(MESSAGE) << " " << outCol.first << ": "; + for(const auto &layer : outCol.second.layers) { + streamlog_out(MESSAGE) << layer << " "; + } + streamlog_out(MESSAGE) << std::endl; + } + + _nRun = 0 ; + _nEvt = 0 ; + } -void SplitCollectionByLayer::processRunHeader(LCRunHeader*) { _nRun++; } -void SplitCollectionByLayer::processEvent(LCEvent* evt) { - LCCollection* col = 0; +void SplitCollectionByLayer::processRunHeader( LCRunHeader* ) { - try { - col = evt->getCollection(_colName); + _nRun++ ; +} - } catch (lcio::DataNotAvailableException& e) { - streamlog_out(DEBUG5) << " input collection not in event : " << _colName << " - nothing to do !!! " - << std::endl; - return; + + + +void SplitCollectionByLayer::processEvent( LCEvent * evt ) { + + + LCCollection* col = 0 ; + + try{ col = evt->getCollection( _colName ) ; + + } catch( lcio::DataNotAvailableException& e) { + + streamlog_out( DEBUG5 ) << " input collection not in event : " << _colName << " - nothing to do !!! " << std::endl ; + return ; } // remember the type of the hit collection - if (col->getTypeName() == lcio::LCIO::SIMTRACKERHIT) - _type = SimTrackerHitType; - else if (col->getTypeName() == lcio::LCIO::TRACKERHIT) - _type = TrackerHitType; - else if (col->getTypeName() == lcio::LCIO::SIMCALORIMETERHIT) - _type = SimCalorimeterHitType; - else if (col->getTypeName() == lcio::LCIO::CALORIMETERHIT) - _type = CalorimeterHitType; + if( col->getTypeName() == lcio::LCIO::SIMTRACKERHIT ) + _type = SimTrackerHitType ; + else if( col->getTypeName() == lcio::LCIO::TRACKERHIT ) + _type = TrackerHitType ; + else if( col->getTypeName() == lcio::LCIO::TRACKERHITPLANE ) + _type = TrackerHitPlaneType ; + else if( col->getTypeName() == lcio::LCIO::SIMCALORIMETERHIT ) + _type = SimCalorimeterHitType ; + else if( col->getTypeName() == lcio::LCIO::CALORIMETERHIT ) + _type = CalorimeterHitType ; else - _type = UnkownType; + _type = UnkownType ; + - std::string encoderString = col->getParameters().getStringVal("CellIDEncoding"); + std::string encoderString = col->getParameters().getStringVal( "CellIDEncoding" ) ; - UTIL::BitField64 encoder(encoderString); + UTIL::BitField64 encoder( encoderString ) ; + + unsigned layerIndex = encoder.index("layer") ; - unsigned layerIndex = encoder.index("layer"); //---- create output collections - for (unsigned i = 0, N = _outCols.size(); i < N; ++i) { - LCCollectionVec* newCol = new LCCollectionVec(col->getTypeName()); + for(auto &outCol : _outCols){ + + LCCollectionVec* newCol = new LCCollectionVec( col->getTypeName() ) ; - newCol->setSubset(true); + newCol->setSubset( true ) ; - newCol->parameters().setValue("CellIDEncoding", encoderString); + newCol->parameters().setValue( "CellIDEncoding", encoderString ) ; outCol.second.collection = newCol ; - _outCols[i].collection = newCol; + streamlog_out( DEBUG5 ) << " created new output collection " << outCol.first << " of type " << col->getTypeName() << std::endl ; + } - streamlog_out(DEBUG5) << " create new output collection " << _outCols[i].name << " of type " << col->getTypeName() - << std::endl; - streamlog_out(DEBUG5) << " create new output collection " << _outCols[i].name << " of type " << col->getTypeName() - << " to the event " << std::endl; - } //---- loop over hits - int nHit = col->getNumberOfElements(); + int nHit = col->getNumberOfElements() ; + + for(int iHit=0; iHit< nHit ; iHit++){ + + lcio::LCObject* h = col->getElementAt( iHit ) ; - for (int iHit = 0; iHit < nHit; iHit++) { - lcio::LCObject* h = col->getElementAt(iHit); + long id = -1 ; - long id = -1; + switch( _type ){ - switch (_type) { case SimTrackerHitType: - id = cellIDFromHit(h); - break; + id = cellIDFromHit( h ) ; + break ; case TrackerHitType: - id = cellIDFromHit(h); - break; + id = cellIDFromHit( h ) ; + break ; + case TrackerHitPlaneType: + id = cellIDFromHit( h ) ; + break ; case SimCalorimeterHitType: - id = cellIDFromHit(h); - break; + id = cellIDFromHit( h ) ; + break ; case CalorimeterHitType: - id = cellIDFromHit(h); - break; + id = cellIDFromHit( h ) ; + break ; case UnkownType: - continue; + continue ; } - encoder.setValue(id); + encoder.setValue( id ) ; - unsigned int layerID = encoder[layerIndex]; + size_t layerID = encoder[ layerIndex ] ; - // check if we have an output collection for this layer - for (int i = 0, N = _outCols.size(); i < N; ++i) { - if ((_outCols[i].layer0 <= layerID) && (layerID <= _outCols[i].layer1)) { - _outCols[i].collection->addElement(h); - streamlog_out(DEBUG0) << " adding hit for layer " << layerID << " to collection : " << _outCols[i].name - << std::endl; - } + // check if we have an output collection for this layer + for(auto &outCol : _outCols){ + if (std::find(outCol.second.layers.begin(), outCol.second.layers.end(), layerID) == outCol.second.layers.end()) continue; + outCol.second.collection->addElement( h ) ; + streamlog_out( DEBUG0 ) << " adding hit for layer " << layerID << " to collection : " << outCol.first << std::endl ; } } + // add non empty collections to the event - for (unsigned i = 0, N = _outCols.size(); i < N; ++i) { - LCCollection* newCol = _outCols[i].collection; + for(const auto &outCol : _outCols){ - if (newCol->getNumberOfElements() > 0) { - evt->addCollection(newCol, _outCols[i].name); + LCCollection* newCol = outCol.second.collection ; - streamlog_out(DEBUG5) << " output collection " << _outCols[i].name << " of type " << col->getTypeName() - << " added to the event " << std::endl; + if( _addEmptyCollections || newCol->getNumberOfElements() > 0 ) { + evt->addCollection( newCol , outCol.first ) ; + streamlog_out( DEBUG5 ) << " Output collection " << outCol.first << " of type " << col->getTypeName() << " added to the event" << std::endl ; } } - streamlog_out(DEBUG3) << " processing event: " << evt->getEventNumber() << " in run: " << evt->getRunNumber() - << std::endl; - _nEvt++; + + + + streamlog_out( DEBUG3 ) << " processing event: " << evt->getEventNumber() + << " in run: " << evt->getRunNumber() << std::endl ; + + + _nEvt ++ ; } -void SplitCollectionByLayer::check(LCEvent*) { + + +void SplitCollectionByLayer::check( LCEvent* ) { // nothing to check here - could be used to fill checkplots in reconstruction processor } -void SplitCollectionByLayer::end() { - streamlog_out(MESSAGE) << "SplitCollectionByLayer::end() " << name() << " processed " << _nEvt << " events in " - << _nRun << " runs " << std::endl; + +void SplitCollectionByLayer::end(){ + + streamlog_out( MESSAGE ) << "SplitCollectionByLayer::end() " << name() + << " processed " << _nEvt << " events in " << _nRun << " runs " + << std::endl ; + } +