#include "AbsEnv/AbsEnv.hh" #include "TrackingMods/SiPatternRecModule.hh" #include "TrackingHL/TrackFinding/SiliconTrackMonger.hh" #include "TrackingHL/OutsideIn/OutsideInStrategyA.hh" #include "TrackingHL/OutsideIn/OutsideInStrategyC.hh" #include "RegionalObjects/COT_TrackSeed.hh" #include "TrackingUtils/VertexFitting/BeamSpot.hh" #include "TrackingUtils/VertexFitting/CdfBeamSpot.hh" #include "TrackingSI/TrackFinding/CombinedOISVXKalTrackStrategy.hh" #include "TrackingSI/TrackFinding/KalTrackStrategy.hh" #include "TrackingSI/TrackFinding/KalForwardTrackStrategy.hh" #include "TrackingObjects/Storable/FastZVertexColl.hh" #include "TrackingSI/PathFinder/SmarterSiPathFinder.hh" #include "TrackingSI/PathFinder/HomemadeSiPathFinder.hh" #include "GeometryBase/CdfDetector.hh" #include "SiliconGeometry/AbsSiDetectorNode.hh" #include "SiliconGeometry/HWSiDetectorNode.hh" #include "TrackingObjects/SiData/SiClusterSet.hh" #include "TrackingSI/Utils/SiConfig.hh" #include "TrackingSI/TrackFinding/PerfectSiStrategy.hh" #include "Edm/ConstHandle.hh" #include "Edm/GenericConstHandle.hh" #include "Edm/Link.hh" #include "ErrorLogger_i/gERRLOG.hh" #include "RRL3/GrowResultList.hh" #include "SimulationObjects/OBSV_StorableBank.hh" #include "RegionalObjects/UniverseRegion.hh" #include "TrackingObjects/Storable/CdfTrackColl.hh" #include "TrackingSI/Integrator/SimpleSiliconIntegrator.hh" #include "TrackingObjects/Deprecated/TRY_InputStream.hh" #include "TrackingUtils/Utility/TrackingDebug.hh" #include "TrackingObjects/CT_Track/CT_TrackSet.hh" #include "TrackingSI/Utils/SiExpected.hh" #include "TrackingKal/KalConverter.hh" #include #include #include //=========================== // Constructor //============================ SiPatternRecModule::SiPatternRecModule( const char* const theName, const char* const theDescription ) : AppModule( theName, theDescription ), _writeOut("WriteBanks",this,true), _doOI("PerformOutsideInTracking",this,true), _doOIZ("PerformOIZTracking",this,true), _doKalSvxStandalone("PerformKalSvxStandaloneTracking",this,false), _doKalFWDStandalone("PerformKalForwardTracking",this,false), _doKalOISvxStandalone("PerformKalOISvxStandaloneTracking",this,true), _noKalStandalone("KalStandaloneOff",this,false), _kalUseZ90("UseZ90InKal",this,true), _kalUseStereo("UseStereoInKal",this,true), _kalUseSiliMap("UseSiliMapInKal",this,false), _kalUseTimeoutKludge("UseTimeoutKludgeInKal",this,true), _kalCOTErrorScale("KalCOTErrorScale",this,2.25), //for further explanation of those tcl switches read note : 5968 _kalOI3LoopChi2Cut1("KalOI3LoopChi2Cut1",this,40.0), _kalOI3LoopChi2Cut2("KalOI3LoopChi2Cut2",this,30.0), _kalOI3LoopChi2Cut3("KalOI3LoopChi2Cut3",this,20.0), _kalOI3LoopChi2Cut4("KalOI3LoopChi2Cut4",this,10.0), _kalOI3LoopChi2Cutz("KalOI3LoopChi2Cutz",this,40.0), _kalOI3LoopCleanUpPhi("KalOI3LoopCleanUpPhi",this,true), _kalOI3LoopCleanUpZ("KalOI3LoopCleanUpZ",this,true), _kalOI3LoopPhiSigmaRoad1("KalOI3LoopPhiSigmaRoad1",this,8.0), _kalOI3LoopPhiSigmaRoad2("KalOI3LoopPhiSigmaRoad2",this,6.0), _kalOI3LoopPhiSigmaRoad3("KalOI3LoopPhiSigmaRoad3",this,3.0), _kalOI3LoopPhiminRoad("KalOI3LoopPhiminRoad",this,0.0), _kalOI3LoopZSigmaRoad("KalOI3LoopZSigmaRoad",this,4.0), _kalOI3LoopSASSigmaRoad("KalOI3LoopSASSigmaRoad",this,4.0), _kalOI3LoopMinPhiHits("KalOI3LoopMinPhiHits",this,3), _kalOI3LoopDebugLevel("KalOI3LoopDebugLevel",this,0), _kalSVXMinPhiHits("KalSVXMinPhiHits",this,4), _kalSVXMaxChi2pdof("KalSVXMaxChi2pdof",this,20), _kalSVXPhiWindow("KalSVXPhiWindow",this,0.05), _kalSVXZWindow("KalSVXZWindow",this,0.5), _kalSVXPVz1("KalSVXPVz1",this,5), _kalSVXPVz2("KalSVXPVz2",this,1.6), _kalSVXSigmaPhiWindow("KalSVXSigmaPhiWindow",this,6.0), _kalSVXSigmaStereoWindow ("KalSVXSigmaStereoWindow",this,6.0), _kalSVXSigmaZWindow("KalSVXSigmaZWindow",this,6.0), _kalSVXCleanUpPhi("KalSVXCleanUpPhi",this,true), _kalSVXCleanUpZ("KalSVXCleanUpZ",this,false), _kalSVXDeltaPhiSection("KalSVXDeltaPhiSection",this,M_PI/20), _kalSVXDebugLevel("KalSVXDebugLevel",this,0), _kalFWDMinPhiHits("KalFWDMinPhiHits",this,4), _kalFWDMaxChi2pdof("KalFWDMaxChi2pdof",this,20), _kalFWDPhiWindow("KalFWDPhiWindow",this,0.05), _kalFWDZWindow("KalFWDZWindow",this,0.5), _kalFWDPVz1("KalFWDPVz1",this,5), _kalFWDPVz2("KalFWDPVz2",this,1.6), _kalFWDSigmaPhiWindow("KalFWDSigmaPhiWindow",this,6.0), _kalFWDSigmaStereoWindow ("KalFWDSigmaStereoWindow",this,6.0), _kalFWDSigmaZWindow("KalFWDSigmaZWindow",this,6.0), _kalFWDCleanUpPhi("KalFWDCleanUpPhi",this,true), _kalFWDCleanUpZ("KalFWDCleanUpZ",this,false), _kalFWDDeltaPhiSection("KalFWDDeltaPhiSection",this,M_PI/20), _kalFWDDebugLevel("KalFWDDebugLevel",this,0), _doPerfectSi("PerformPerfectSiTracking",this,false), _passAllCandidates("PassAllCandidates",this,false), _minPt("MinimumPt",this,0.2), _minSVXPt("MinimumSVXPt",this,0.2), _minFWDPt("MinimumFWDPt",this,0.2), _maxFWDPt("MaximumFWDPt",this,200.0), _zigzag("zigzagbonding",this,true), _x0("BeamX0",this,-0.16695,-2.0,2.0), _y0("BeamY0",this,0.43157,-2.0,2.0), _monger(NULL), _beamSpot(NULL), _siPathFinder(NULL), _materialIntegrator(NULL), _pathName("pathName",this,"default"), _debugRegional("DebugRegional",this,false), _missingLayer("missingLayer",this,-1), _missingMultLayers("missingMultLayers",this,8,8,0,0,1), /* S.B. Added */ _cotSF("cotSF",this,1.5), _use90Z("use90Z",this,true), _uniqueOutputColl("uniqueOutputColl",this,false), _KALOIonUnusedCOTTracksOnly("KALOIonUnusedCOTTracksOnly",this,true), _WEIOIonUnusedCOTTracksOnly("WEIOIonUnusedCOTTracksOnly",this,false), _method("method",this,"GLOBAL"), _inputTracks("inputTracks",this,"COT_Global_Tracking"), _inputHitSet("inputHitSet",this,"GlobalSI_HitSet"), _outputTracks("outputTracks",this,"GlobalSI_Tracking"), _useSiExpected("useSiExpected",this,false), _processName("ProcessName",this,"PROD"), _ZVerDescrip("ZVerDescrip",this,""), // ZVertexColl _donotSVXBeam("SVXBeamOff",this,false), _useallHits("UseAllHitsInKalStandalone",this,false), _useallHitsFWD("UseAllHitsInKalFoeward",this,false), _kalLimitCpuTime ("KalLimitCpuTime",this,false), _kalMaxCpuTime ("KalMaxCpuTime",this,900.0,0.0,86400.0), _kalLimitRealTime("KalLimitRealTime",this,false), _kalMaxRealTime ("KalMaxRealTime",this,900.0,0.0,86400.0), _kalLimitMemory ("KalLimitMemory",this,false), _kalMaxMemory ("KalMaxMemory",this,500.0,32.0,8192.0) { if ( verbose() ) { std::cerr << "HELLO from Module SiPatternRec" << std::endl; } // Add Commands to the menu commands()->append(&_writeOut); commands()->append(&_doOI); commands()->append(&_doOIZ); commands()->append(&_doKalSvxStandalone); commands()->append(&_doKalFWDStandalone); commands()->append(&_doKalOISvxStandalone); commands()->append(&_kalUseZ90); commands()->append(&_kalUseStereo); commands()->append(&_kalUseSiliMap); commands()->append(&_kalUseTimeoutKludge); commands()->append(&_kalCOTErrorScale); commands()->append(&_noKalStandalone); commands()->append(&_kalOI3LoopChi2Cut1); commands()->append(&_kalOI3LoopChi2Cut2); commands()->append(&_kalOI3LoopChi2Cut3); commands()->append(&_kalOI3LoopChi2Cut4); commands()->append(&_kalOI3LoopChi2Cutz); commands()->append(&_kalOI3LoopCleanUpPhi); commands()->append(&_kalOI3LoopCleanUpZ); commands()->append(&_kalOI3LoopPhiSigmaRoad1); commands()->append(&_kalOI3LoopPhiSigmaRoad2); commands()->append(&_kalOI3LoopPhiSigmaRoad3); commands()->append(&_kalOI3LoopPhiminRoad); commands()->append(&_kalOI3LoopZSigmaRoad); commands()->append(&_kalOI3LoopSASSigmaRoad); commands()->append(&_kalOI3LoopMinPhiHits); commands()->append(&_kalOI3LoopDebugLevel); commands()->append(&_kalSVXMinPhiHits); commands()->append(&_kalSVXMaxChi2pdof); commands()->append(&_kalSVXPhiWindow); commands()->append(&_kalSVXZWindow); commands()->append(&_kalSVXPVz1); commands()->append(&_kalSVXPVz2); commands()->append(&_kalSVXSigmaPhiWindow); commands()->append(&_kalSVXSigmaStereoWindow); commands()->append(&_kalSVXSigmaZWindow); commands()->append(&_kalSVXCleanUpPhi); commands()->append(&_kalSVXCleanUpZ); commands()->append(&_kalSVXDeltaPhiSection); commands()->append(&_kalSVXDebugLevel); commands()->append(&_kalFWDMinPhiHits); commands()->append(&_kalFWDMaxChi2pdof); commands()->append(&_kalFWDPhiWindow); commands()->append(&_kalFWDZWindow); commands()->append(&_kalFWDPVz1); commands()->append(&_kalFWDPVz2); commands()->append(&_kalFWDSigmaPhiWindow); commands()->append(&_kalFWDSigmaStereoWindow); commands()->append(&_kalFWDSigmaZWindow); commands()->append(&_kalFWDCleanUpPhi); commands()->append(&_kalFWDCleanUpZ); commands()->append(&_kalFWDDeltaPhiSection); commands()->append(&_kalFWDDebugLevel); commands()->append(&_doPerfectSi); commands()->append(&_passAllCandidates); commands()->append(&_minPt); commands()->append(&_minSVXPt); commands()->append(&_minFWDPt); commands()->append(&_maxFWDPt); commands()->append(&_zigzag); commands()->append(&_x0); commands()->append(&_y0); commands()->append(&_pathName); commands()->append(&_debugRegional); commands()->append(&_uniqueOutputColl); commands()->append(&_missingLayer); commands()->append(&_missingMultLayers); // S.B. Added commands()->append(&_cotSF); commands()->append(&_use90Z); commands()->append(&_KALOIonUnusedCOTTracksOnly); commands()->append(&_WEIOIonUnusedCOTTracksOnly); commands()->append(&_method); commands()->append(&_inputTracks); commands()->append(&_inputHitSet); commands()->append(&_outputTracks); commands()->append(&_useSiExpected); commands()->append(&_processName); commands()->append(&_ZVerDescrip); commands()->append(&_donotSVXBeam); commands()->append(&_useallHits); commands()->append(&_useallHitsFWD); commands()->append( &_kalLimitCpuTime); commands()->append( &_kalMaxCpuTime); commands()->append( &_kalLimitRealTime); commands()->append( &_kalMaxRealTime); commands()->append( &_kalLimitMemory); commands()->append( &_kalMaxMemory); // Add Some description to the commands. _writeOut .addDescription("\tOption to write tracks to persistent storage"); _doOI .addDescription("\tOption to do outside-in tracking"); _doKalSvxStandalone.addDescription ("\tOption t do standalone silicon tracking with the KalSiliconStandAloneTracker"); _doKalFWDStandalone.addDescription ("\tOption t do standalone silicon tracking with the KalSiliconForwardTracker (experimentel!!) "); _doKalOISvxStandalone.addDescription ("\tOption t do combined Tracking OI and silicon stand alone with the TrackingKal Algorithms"); ; _noKalStandalone .addDescription ("switch off standalone tracking in Karlsruher Combined OI Standalone Tracking -> run only OI tracking"); _kalUseZ90.addDescription("\tIf true (default) Kal algorithms will use 90 deg Z-hits"); _kalUseStereo.addDescription("\tIf true KalOI algorithm will uses stereo hits (if false and UseZ90InKal true there will be no Z90"); _kalUseTimeoutKludge.addDescription("\tIf true (default) Kal algorithms will not process events with more than 5000 SI hits. Halfladders with more than 40 hits on one side will also be ommitted in the pattern recognition. This is a kludge we want to get rid of ASAP. If you are not running on the farm or process MC you should set this to false."); _doPerfectSi .addDescription("\tPerfect Tracking: true geometry, Si only."); _doOIZ .addDescription("\tOption to do OIZ tracking"); _passAllCandidates.addDescription("\tOption to write out all candidates"); _minPt.addDescription("\tMinimum Pt for OITracker at which to look for tracks"); _minSVXPt.addDescription("\tMinimum Pt for KalSiliconStandaloneTracker at which to look for tracks"); _kalOI3LoopPhiSigmaRoad1.addDescription("\tIf #Hits of track <= 2 then x times rPhiSigmaWindow1 for search of the next possible hit. "); _kalOI3LoopPhiSigmaRoad2.addDescription("\tIf #Hits of track < 5 then x times rPhiSigmaWindow2 for search of the next possible hit. "); _kalOI3LoopPhiSigmaRoad3.addDescription("\tIf #Hits of track >= 5 then x times rPhiSigmaWindow3 for search of the next possible hit. "); _kalOI3LoopPhiminRoad.addDescription("\tIf #Hits of track = 0 then minimum value is rPhiminWindow for search of the next possible hit. "); _kalSVXDeltaPhiSection.addDescription("\t Set DeltaPhi-Section for 3DHit-Selection "); _zigzag .addDescription("\tzigzag bonding flag for layer 7"); _x0 .addDescription("\tx of beam postion necessary for Kal-Silicon-Stand-Alone strategies, for MC should be set to 0.0"); _y0 .addDescription("\ty of beam postion necessary for Kal-Silicon-Stand-Alone strategies, for MC should be set to 0.0"); _missingLayer .addDescription( "\tTo exclude a layer from pattern recognition\n" "\t\t 0: L00\n\t\t1-5:SVXII\n\t\t6-7ISL\n\t\t(other for none)\n"); // S.B. Added _missingMultLayers .addDescription( "\tExclude a set of layers from pattern recognition (0:include, 1:exclude)\n" "\tLayer No.: 0:L00, 1-5:SVXII, 6-7:ISL"); _cotSF .addDescription("\tTo rescale cot covariant matrix for OI tracking\n"); _use90Z .addDescription("\tTo include 90 z layers in OIZ tracking\n"); _uniqueOutputColl .addDescription( "\t If true, the default description of the output track collection will be \n" "\t appended with the module name (this is useful if several clones of \n" "\t SiPatternRecModule are running within the same job"); _WEIOIonUnusedCOTTracksOnly.addDescription("\t Option for running WEI OI after KAL OI"); _KALOIonUnusedCOTTracksOnly.addDescription("\t Option for running KAL OI after WEI OI"); _method.addDescription( "\t Switch to select regional or global: \n" "\t \"REGIONAL\" = use regional input (default): can still handle global tracking!\n" "\t \"GLOBAL\" = use global input: much simpler, can also handle named I/O collections (see next)"); _inputTracks.addDescription("\t Description for input tracks in GLOBAL mode: default is \"COT_Global_Tracking\" "); _inputHitSet.addDescription("\t Description for input silicon hits in GLOBAL mode: default is \"GlobalSI_HitSet\" "); _outputTracks.addDescription("\t Description for output tracks in GLOBAL mode: default is \"GlobalSI_Tracking\" "); _useSiExpected.addDescription("\t Use expected ladder information in si standalone tracking"); _processName.addDescription("\t Process name for input objects"); _ZVerDescrip.addDescription("\t set Description of the imported ZVertexCollection"); _donotSVXBeam.addDescription("\t don't get the beam position from SVXBeamDatabase"); _useallHits.addDescription("\t When set to true, KalSiliconStandaloneTracking will use all Hits for Tracking (even though they're used before). Attention, the combinatorics will increase"); _useallHitsFWD.addDescription("\t When set to true, KalSiliconForwardTracking will use all Hits for Tracking (even though they're used before). Attention, the combinatorics will increase"); _kalLimitCpuTime.addDescription("!EXPERTS ONLY! When set to true, Kal Silicon Standalone Tracking will bail out after the allowed CPU time/event (as measured by ZMtimer) elapsed. The time cut can be configured with the 'KalMaxCpuTime' talk-to. This introduces implicit hardware dependence! !EXPERTS ONLY!"); _kalMaxCpuTime.addDescription("!EXPERTS ONLY! Maximum allowed CPU time[s]/event (as measured by ZMtimer) for Kal Silicon Standalone Tracking. Has no effect as long as 'KalLimitCpuTime' is set to 'false'. !EXPERTS ONLY!"); _kalLimitRealTime.addDescription("!EXPERTS ONLY! When set to true, Kal Silicon Standalone Tracking will bail out after the allowed real time/event (as measured by ZMtimer) elapsed. The time cut can be configured with the 'KalMaxRealTime' talk-to. This introduces implicit hardware dependence! !EXPERTS ONLY!"); _kalMaxRealTime.addDescription("!EXPERTS ONLY! Maximum allowed real time[s]/event (as measured by ZMtimer) for Kal Silicon Standalone Tracking. Has no effect as long as 'KalLimitRealTime' is set to 'false'. !EXPERTS ONLY!"); _kalLimitMemory.addDescription("!EXPERTS ONLY! When set to true, Kal Silicon Standalone Tracking will bail out if the process consumes more memory then configured with the 'KalMaxMemory' talk-to. !EXPERTS ONLY!"); _kalMaxMemory.addDescription("!EXPERTS ONLY! Maximum allowed process memory [MB](rss from ProcStats) checked for in Kal Silicon Standalone Tracking. Has no effect as long as 'KalLimitMemory' is set to 'false'. !EXPERTS ONLY!"); } //============================ // Constructor //============================ SiPatternRecModule::~SiPatternRecModule() { if (_monger != 0) { _monger->destroyAllStrategies(); delete _monger; delete _siPathFinder; delete _beamSpot; delete _materialIntegrator; } // if ( verbose() ) // { std::cerr << "GOODBYE from Module SiPatternRec" << std::endl; // } } //===================== // Operations //===================== AppResult SiPatternRecModule::beginJob( AbsEvent* aJob ) { if ( verbose() ) { std::cerr << "BEGIN JOB from Module SiPatternRec" << std::endl; } // // This has to happen BEFORE either SiConfig, a Kal strategy // or KalUtils is constructed. Otherwise it will have no effect // and a warning will be issued. // KalConverter::instance()->useSiliMap(_kalUseSiliMap.value()); //===================================================== // Instantiate a monger & a wafer set. //===================================================== const AbsSiDetectorNode *siDetector = CdfDetector::instance()->getSiDetector(); _monger = new SiliconTrackMonger; _svxBeam = new SvxBeam(); _monger->setcotSF(_cotSF.value()); _monger->setuse90Z(_use90Z.value()); // tell monger about _missingLayer _monger->setMissingLayer(_missingLayer.value()); // S.B. Added AbsParmList::ConstIterator iml = _missingMultLayers.begin(); for (int i=0; i<8; ++i, ++iml) { _multLayers[i]=*iml; SiConfig::instance()->setMissingLayerFlag(i,*iml); } _monger->setMissingMultLayers(_multLayers); _monger->setKALOIonUnusedCOTTracksOnly(_KALOIonUnusedCOTTracksOnly.value()); _monger->setWEIOIonUnusedCOTTracksOnly(_WEIOIonUnusedCOTTracksOnly.value()); SiConfig::instance()->zigzag_ = _zigzag.value(); SiConfig::instance()->enableTimeoutKludge_ = _kalUseTimeoutKludge.value(); SiConfig::instance()->setCOTerrorScale(_kalCOTErrorScale.value()); SiConfig::instance()->LimitCpuTime_ = _kalLimitCpuTime.value(); SiConfig::instance()->MaxCpuTime_ = _kalMaxCpuTime.value(); SiConfig::instance()->LimitRealTime_ = _kalLimitRealTime.value(); SiConfig::instance()->MaxCpuTime_ = _kalMaxRealTime.value(); SiConfig::instance()->LimitMemory_ = _kalLimitMemory.value(); SiConfig::instance()->MaxMemory_ = _kalMaxMemory.value(); SiConfig::instance()->SiSaCpuTimeErrNum_ = 11; SiConfig::instance()->SiSaRealTimeErrNum_ = 12; SiConfig::instance()->SiSaMemoryErrNum_ = 13; SiConfig::instance()->setKalOI3LDebugLevel(_kalOI3LoopDebugLevel.value()); SiConfig::instance()->setKalSiSaDebugLevel(_kalSVXDebugLevel.value()); _siExpected = new SiExpected(this); //===================================================== // Make a path finder. If you don't have the full detector // then stick with the slow but certain homemade path finder! //===================================================== if (!dynamic_cast (siDetector) ) { _siPathFinder = new HomemadeSiPathFinder(siDetector); } else { _siPathFinder = new SmarterSiPathFinder(siDetector); } _beamSpot = new CdfBeamSpot; std::cout << "SiPatternRecModule: using SimpleSiliconIntegrator (default)." << std::endl; _materialIntegrator = new SimpleSiliconIntegrator(siDetector); //===================================================== // Atribute some strategies & helper objects //===================================================== // double zWindow0=0.35,phiWindow0=0.025; // 4 mm windows // double maxChiSq=50.0; // change the order of calling the strategies in case of running WEI first and KAL only on the left over track if (_KALOIonUnusedCOTTracksOnly.value()) { if (_doOI.value() ) { OutsideInStrategyA *os00 = new OutsideInStrategyA(); _monger->addStrategy(os00); } if (_doKalOISvxStandalone.value()) { CombinedOISVXKalTrackStrategy *oisvxkts = CombinedOISVXKalTrackStrategy::instance(); oisvxkts->setDo90z(_kalUseZ90.value()); oisvxkts->setDoStereo(_kalUseStereo.value()); if (_noKalStandalone.value()) oisvxkts->switchOffStandalone(); oisvxkts->setMinPT( _minPt.value()); oisvxkts->setMinSVXPT( _minSVXPt.value()); oisvxkts->setx0( _x0.value()); oisvxkts->sety0( _y0.value()); oisvxkts->beamoff( _donotSVXBeam.value()); oisvxkts->useallhits( _useallHits.value()); oisvxkts->setOI3LoopChi2cuts( _kalOI3LoopChi2Cut1.value(), _kalOI3LoopChi2Cut2.value(), _kalOI3LoopChi2Cut3.value(), _kalOI3LoopChi2Cut4.value(), _kalOI3LoopChi2Cutz.value()); oisvxkts->setOI3LoopCleanUp( _kalOI3LoopCleanUpPhi.value(), _kalOI3LoopCleanUpZ.value()); oisvxkts->setOI3LoopMinPhiHits(_kalOI3LoopMinPhiHits.value()); oisvxkts->setOI3LoopRoadSearchWindows(_kalOI3LoopPhiSigmaRoad1.value(), _kalOI3LoopPhiSigmaRoad2.value(), _kalOI3LoopPhiSigmaRoad3.value(), _kalOI3LoopPhiminRoad.value(), _kalOI3LoopZSigmaRoad.value(), _kalOI3LoopSASSigmaRoad.value()); oisvxkts->setSVXMinPhiHits(_kalSVXMinPhiHits.value()); oisvxkts->setSVXMaxChi2pdof(_kalSVXMaxChi2pdof.value()); oisvxkts->setSVXWindows(_kalSVXPhiWindow.value(), _kalSVXZWindow.value()); oisvxkts->setSVXPVz(_kalSVXPVz1.value(), _kalSVXPVz2.value()); oisvxkts->setSVXRoadSearchWindows(_kalSVXSigmaPhiWindow.value(), _kalSVXSigmaStereoWindow.value(), _kalSVXSigmaZWindow.value()); oisvxkts->setSVXCleanUp(_kalSVXCleanUpPhi.value(), _kalSVXCleanUpZ.value()); oisvxkts->setSVXDeltaPhi(_kalSVXDeltaPhiSection.value()); cout<<"KalOIStrategy around"<addStrategy(oisvxkts); } } else { if (_doKalOISvxStandalone.value()) { CombinedOISVXKalTrackStrategy *oisvxkts = CombinedOISVXKalTrackStrategy::instance(); oisvxkts->setOI3LoopChi2cuts( _kalOI3LoopChi2Cut1.value(), _kalOI3LoopChi2Cut2.value(), _kalOI3LoopChi2Cut3.value(), _kalOI3LoopChi2Cut4.value(), _kalOI3LoopChi2Cutz.value()); oisvxkts->setOI3LoopCleanUp(_kalOI3LoopCleanUpPhi.value(), _kalOI3LoopCleanUpZ.value()); oisvxkts->setOI3LoopMinPhiHits(_kalOI3LoopMinPhiHits.value()); oisvxkts->setOI3LoopRoadSearchWindows(_kalOI3LoopPhiSigmaRoad1.value(), _kalOI3LoopPhiSigmaRoad2.value(), _kalOI3LoopPhiSigmaRoad3.value(), _kalOI3LoopPhiminRoad.value(), _kalOI3LoopZSigmaRoad.value(), _kalOI3LoopSASSigmaRoad.value()); oisvxkts->setSVXMinPhiHits(_kalSVXMinPhiHits.value()); oisvxkts->setSVXMaxChi2pdof(_kalSVXMaxChi2pdof.value()); oisvxkts->setSVXWindows(_kalSVXPhiWindow.value(), _kalSVXZWindow.value()); oisvxkts->setSVXPVz(_kalSVXPVz1.value(), _kalSVXPVz2.value()); oisvxkts->setSVXRoadSearchWindows(_kalSVXSigmaPhiWindow.value(), _kalSVXSigmaStereoWindow.value(), _kalSVXSigmaZWindow.value()); oisvxkts->setSVXCleanUp(_kalSVXCleanUpPhi.value(), _kalSVXCleanUpZ.value()); oisvxkts->setSVXDeltaPhi(_kalSVXDeltaPhiSection.value()); // // pass tcl talk to choice whether we use // 90 deg z-hits in the strategy, // wether we use stereo-hits and if we // do 3loop OI version // the stereo switch is not valid for standalone, // because it is based on the 3D hits // if for OI stereo is switched off 90 z-hits will // not added, too // oisvxkts->setDo90z(_kalUseZ90.value()); oisvxkts->setDoStereo(_kalUseStereo.value()); if (_noKalStandalone.value()) oisvxkts->switchOffStandalone(); oisvxkts->setMinPT( _minPt.value()); oisvxkts->setMinSVXPT( _minSVXPt.value()); oisvxkts->setx0( _x0.value()); oisvxkts->sety0( _y0.value()); oisvxkts->beamoff( _donotSVXBeam.value()); oisvxkts->useallhits( _useallHits.value()); cout<<"Add KALOI to monger"<addStrategy(oisvxkts); } if (_doOI.value() ) { OutsideInStrategyA *os00 = new OutsideInStrategyA(); _monger->addStrategy(os00); } } if (_doOIZ.value()) { OutsideInStrategyC *os02 = new OutsideInStrategyC(CdfTrack::OutsideInAlg); _monger->addStrategy(os02); } if (_doKalSvxStandalone.value()) { KalTrackStrategy *kts = KalTrackStrategy::instance(); // // pass tcl talk to choice whether we use // 90 deg z-hits to the strategy // kts->setDo90z(_kalUseZ90.value()); kts->setMinSVXPT ( _minSVXPt.value()); kts->setx0(_x0.value()); kts->sety0(_y0.value()); kts->beamoff (_donotSVXBeam.value()); kts->useallhits( _useallHits.value()); kts->setMinPhiHits(_kalSVXMinPhiHits.value()); kts->setMaxChi2pdof(_kalSVXMaxChi2pdof.value()); kts->setWindows(_kalSVXPhiWindow.value(), _kalSVXZWindow.value()); kts->setPVz(_kalSVXPVz1.value(), _kalSVXPVz2.value()); kts->setRoadSearchWindows(_kalSVXSigmaPhiWindow.value(), _kalSVXSigmaStereoWindow.value(), _kalSVXSigmaZWindow.value()); kts->setCleanUp(_kalSVXCleanUpPhi.value(), _kalSVXCleanUpZ.value()); kts->setSVXDeltaPhi(_kalSVXDeltaPhiSection.value()); _monger->addStrategy(kts); } if (_doKalFWDStandalone.value()) { KalForwardTrackStrategy *fwd = KalForwardTrackStrategy::instance(); // // pass tcl talk to choice whether we use // 90 deg z-hits to the strategy // fwd->setDo90z(_kalUseZ90.value()); fwd->setMinFWDPT ( _minFWDPt.value()); fwd->setx0(_x0.value()); fwd->sety0(_y0.value()); fwd->beamoff (_donotSVXBeam.value()); fwd->useallhits( _useallHitsFWD.value()); fwd->setMinPhiHits(_kalFWDMinPhiHits.value()); fwd->setMaxChi2pdof(_kalFWDMaxChi2pdof.value()); fwd->setWindows(_kalFWDPhiWindow.value(), _kalFWDZWindow.value()); fwd->setPVz(_kalFWDPVz1.value(), _kalFWDPVz2.value()); fwd->setRoadSearchWindows(_kalFWDSigmaPhiWindow.value(), _kalFWDSigmaStereoWindow.value(), _kalFWDSigmaZWindow.value()); fwd->setCleanUp(_kalFWDCleanUpPhi.value(), _kalFWDCleanUpZ.value()); fwd->setFWDDeltaPhi(_kalFWDDeltaPhiSection.value()); _monger->addStrategy(fwd); } if (_doPerfectSi.value()) { std::cout << "SiPatternRecModule: added PerfectSi pattern recognition strategy.\n" << "SiPatternRecModule (a piece of advice):\n" << "\t If you want to run perfect tracking, please also consider using\n" << "\t PT_TrackingModule. That's a real tool, while this is just a toy." << std::cout; _monger->addStrategy( new PerfectSiStrategy() ); } _monger->setMaterialIntegrator(_materialIntegrator); _monger->setSiPathFinder(_siPathFinder); _monger->setBeamSpot(_beamSpot); std::cerr << "=============================================" << std::endl; std::cerr << "Initialization report from siPatternRecModule" << std::endl; std::cerr << "Pass all candidates is " << _passAllCandidates.value() << std::endl; std::cerr << "Pt ranges are " << _minPt.value() << " < pt " << std::endl; std::cerr << "Bank writing flag is " << _writeOut.value() << std::endl; std::cerr << "=============================================" << std::endl; // //ths // for (vector::iterator stra = hitset.begin(); // ih != hitset.end(); ++ih) { // vector::iterator inext = ih; // SiliconPatternRecStrategy::iterator mystra // cout << "#### Stragegys : " << _monger->SiliconPatternRecStrategy::iterator_siliconPatternRecStrategy.endStrategies() << endl; // At this point all strategies that we are going to run in this job // have been defined, and we can make our timers that will do timing // benchmarks of the pattern.rec strategies. _monger->createTimers(); return AppResult::OK; } AppResult SiPatternRecModule::beginRun( AbsEvent* aRun ) { if ( verbose() ) { std::cerr << "BEGIN RUN from Module SiPatternRec" << std::endl; } if (_useSiExpected.value()) { _siExpectedAvailableInRun = _siExpected->beginRun(); } else { _siExpectedAvailableInRun = false; } if(!_donotSVXBeam.value()) { _svxBeam->loadRun(); if ( SiConfig::instance()->getSVXBeamline(_svxBeam) ); } return AppResult::OK; } AppResult SiPatternRecModule::event( AbsEvent* anEvent ) { if ( _siExpectedAvailableInRun && !AbsEnv::instance()->monteFlag()) { SiConfig::instance()->cacheSiliconWaferStatus(_siExpected, _siExpected->beginEvent(anEvent)); } else SiConfig::instance()->cacheSiliconWaferStatus(_siExpected, false); // Look for user error - TKN if (_method.value() != "REGIONAL" && _method.value() != "GLOBAL") { ERRLOG( ELerror, "invalid method") << "\nmethod \"" << _method.value() << "\"does not exist." << "\noptions are REGIONAL and GLOBAL" << "\n\t RETURNING...\n" << endmsg; return AppResult::ERROR; } // REGIONAL code shoved in the closet (see talk-to) - TKN else if (_method.value() == "REGIONAL") { AppResult regionalResult = _doRegional(anEvent); if (_debugRegional.value()) cout << "_doRegional() returns " << regionalResult.value() << "\n"; } // GLOBAL code - can process named I/O (see talk-to) - TKN else if (_method.value() == "GLOBAL") { // need ability to manipulate the output description string outputDescription = _outputTracks.value(); // get input track collection - make sure it is OK - create view with selected tracks CdfTrackView_h selectedTracks; CdfTrackColl_ch inputTrackColl; const StorableObject::SelectByDescription selector(_inputTracks.value()); const StorableObject::SelectByProcessName selector2(_processName.value()); if (CdfTrackColl::find(inputTrackColl,selector&&selector2) == CdfTrackColl::OK) { ConstLink inputTrackCollLink( inputTrackColl ); selectedTracks = CdfTrackView_h( new CdfTrackView( inputTrackCollLink, inputTrackColl->contents().begin(), inputTrackColl->contents().end(), track_cut::PtGreaterThan(_minPt.value()) ) ); } else { if (verbose()) { ERRLOG( ELwarning, "error finding input CdfTrackColl") << "\nCdfTrackColl with description" << _inputTracks.value() << "not found in event record..." << endmsg; } return AppResult::ERROR; } // get input hitset - make sure it is OK EventRecord::ConstIterator hitSetIter(anEvent,"SiHitSet",_inputHitSet.value(),_processName.value()); if (!hitSetIter.is_valid()) { if (verbose()) { ERRLOG( ELwarning, "input SiHitSet not found") << "\nSiHitSet with description" << _inputHitSet.value() << "not found in event record..." << endmsg; } return AppResult::ERROR; } SiHitSet_ch inputHitSet(hitSetIter); if (inputHitSet->empty()) { if (verbose()) { ERRLOG( ELwarning, "input SiHitSet is empty") << "\nSiHitSet with description" << _inputHitSet.value() << "is empty\n" << endmsg; } return AppResult::ERROR; } if (inputHitSet->nEntries()>80000) { ERRLOG( ELerror, "Err:3") << "@SUB=SiPatternRecModule" << "input SiHitSet has greater then 80000 hits" << "\nN Hit = " << inputHitSet->nEntries() << endmsg; return AppResult::ERROR; } (*inputHitSet)[0]; // create output tracks with silicon hits - use unique description if requested (see talk-to) CdfTrackColl_h outputTracks = CdfTrackColl_h(new CdfTrackColl(inputHitSet)); if (_uniqueOutputColl.value()) { outputDescription += "_"; outputDescription += name(); } outputTracks->set_description(outputDescription); // create output 3D hit set Si3DHitList output3DHitList; // Z vertex list - demand COT standalone list - make sure it is OK const FastZVertexColl *PVSet = NULL; EventRecord::ConstIterator zVertexIter(anEvent,"FastZVertexColl","COT Standalone",_processName.value()); if (zVertexIter.is_valid()) { ConstHandle vertexSet( zVertexIter); if (vertexSet->contents().size()==0) { ERRLOG( ELwarning, "input FastZVertexColl is empty") << "\nFastZVertexColl with description COT Standalone is empty\n" << endmsg; } if (!PVSet) { PVSet = &*vertexSet; } } else { ERRLOG( ELwarning, "input FastZVertexColl not found") << "\nFastZVertexColl with description COT Standalone not found in event record..." << endmsg; return AppResult::ERROR; } if (_ZVerDescrip.value() != "") { const ZVertexColl *ZPVSet = NULL; EventRecord::ConstIterator iter(anEvent,"ZVertexColl",_ZVerDescrip.value(),_processName.value()); if (iter.is_valid()) { ConstHandle vertexSet(iter); if (!ZPVSet) { ZPVSet = &*vertexSet; } else { ERRLOG( ELwarning, "Searched PVSet's not in event" ) << "SUB=@SiPatternRecModule::event" << endmsg; } } SiConfig::instance()->importZVertices(ZPVSet); } // ready to rock 'n roll...contact the SiliconTrackMonger _monger->set2DHitList( const_cast(inputHitSet.operator->())); _monger->set3DHitList( &output3DHitList ); _monger->setVertexSet( PVSet ); _monger->setSegmentSet( &(selectedTracks->contents()) ); _monger->setSiliconTrackSet( outputTracks ); _monger->executeStrategies(); outputTracks->assignTrackIds( anEvent ); // Loop over tracks and tell parents about children...a bit ugly ConstLink collLink( outputTracks ); CdfTrackColl::iterator iend = outputTracks->contents().end(); for ( CdfTrackColl::const_iterator i = outputTracks->contents().begin() ; i != iend ; ++i ) { //ths //cout << "tracks : " << (**i).algorithm() << endl; if ( (**i).parent().is_nonnull() ) { (**i).parent()->setChildLink( CdfTrack_cfwdlnk( collLink, i ) ); } } // Write out the tracks to persistent storage if requested. if (_writeOut.value()){ if ( currentRCPID().isValid() ) outputTracks->set_rcp_id( currentRCPID() ); anEvent->append(outputTracks); } _monger->nullSiliconTrackSet(); } return AppResult::OK; } AppResult SiPatternRecModule::endRun( AbsEvent* aRun ) { if ( verbose() ) { std::cerr << "END RUN from Module SiPatternRec" << std::endl; } return AppResult::OK; } AppResult SiPatternRecModule::endJob( AbsEvent* aJob ) { if ( verbose() ) { std::cerr << "END JOB from Module SiPatternRec" << std::endl; } // Report the average timing info for all strategies. _monger->printTimers(); return AppResult::OK; } AppResult SiPatternRecModule::abortJob( AbsEvent* aJob ) { if ( verbose() ) { std::cerr << "ABORT JOB from Module SiPatternRec" << std::endl; } return AppResult::OK; } AppModule* SiPatternRecModule::clone(const char* cloneName) { return new SiPatternRecModule(cloneName,"this is a clone SiPatternRecModule"); } AppResult SiPatternRecModule::_doRegional( AbsEvent* anEvent ) { string dbm, dbm0; int evntnr; if (_debugRegional.value()) { dbm0 = "SiPatternRecModule::event("; dbm = ") ("+_pathName.value()+"): "; evntnr = AbsEnv::instance()->trigNumber(); } const AbsSiDetectorNode *siDetector = CdfDetector::instance()->getSiDetector(); int nEvent = AbsEnv::instance()->trigNumber(); int nRun = AbsEnv::instance()->runNumber(); if ( (verbose() && nEvent%1==0) ) { std::cerr << "PROCESS EVENT from Module SiPatternRec: trigger # " << std::setw(4) << nRun << "/" << std::setw(5) << nEvent << std::endl; } // ------------------------------------------------------------------------------------ // // EDM2 implementation of regional tracking. Each region has an associated // // GrowResultList, to which the results of tracking inside that region are appended. // // The regions themselves are already stored in the GrowResultLists. // // It is assumed here that SiClusteringModule has run previously. This will // // have dealt with the issue of creating a GrowResultList containing the World in the // // event of RegionDefModule not having run. // // ------------------------------------------------------------------------------------ // // Set the Selectors for this path. First, obviously, the class name itself : StorableObject::SelectByClassName class_name("GrowResultList"); // and secondly, only GrowResultLists from this path : StorableObject::SelectByDescription description(_pathName.value()); for (EventRecord::ConstIterator GrowResultListIter(anEvent,description && class_name); GrowResultListIter != anEvent->end(); GrowResultListIter++) { if (_debugRegional.value()) { std::cout << dbm0 << evntnr << dbm <<"found a GrowResultList with object_id = " << GrowResultListIter->object_id() << " and description = " << GrowResultListIter->description() << std::endl; } ConstHandle GrowResultListCH(GrowResultListIter); // only need to do the tracking if a CdfTrackColl with description RegionalSI_Tracking is not allready in the GrowResultList. // this could be the case if the RegionDefModule ran in "reuseResult"-mode and copied the links // to the allready existing results into this GrowResultList GrowResultList::typeIterator trackCollIter(GrowResultListCH); if (_debugRegional.value()) { if (trackCollIter.is_valid() && (*trackCollIter)->description() == "GlobalSI_Tracking") { std::cout << dbm0 << evntnr << dbm << "GrowResultList allready contains a CdfTrackColl with description = " << (*trackCollIter)->description() << " --> SKIPPING "<< std::endl; } } if (trackCollIter.is_valid() && (*trackCollIter)->description() == "GlobalSI_Tracking") continue; // Find the PhysicsRegion in the GrowResultList : GrowResultList::typeIterator physicsIter(GrowResultListCH); if (!physicsIter.is_valid()) continue; if (_debugRegional.value()) { std::cout << dbm0 << evntnr << dbm << "GrowResultList contains a link to a " << (*physicsIter)->myType() << std::endl; } //-----------------------------------------------------------------------// // Find out whether this region was seeded from a COT track. If so, get // // this track to use as input to OI. // //-----------------------------------------------------------------------// CdfTrack_clnk theCOT_Track; GrowResultList::typeIterator COT_TrackSeedIter(GrowResultListCH); if (COT_TrackSeedIter.is_valid()) { theCOT_Track = (*COT_TrackSeedIter)->getCOT_Track(); } //-----------------------------------------------------------------------// // Access the input data // //-----------------------------------------------------------------------// // Retrieve the cluster data from the GrowResultList : GrowResultList::typeIterator hitSetIter(GrowResultListCH); if (!hitSetIter.is_valid()) continue; if (_debugRegional.value()) { std::cout << dbm0 << evntnr < hitSetC(*hitSetIter); SiHitSet *hitList = const_cast(hitSetC.operator->()); if ( hitList->empty() ) { continue; } if (hitList->nEntries()>80000) { ERRLOG( ELerror, "Err:3") << "@SUB=SiPatternRecModule" << "input SiHitSet has greater then 80000 hits" << "\nN Hit = " << hitList->nEntries() << endmsg; return AppResult::ERROR; } // OK, this is a hack to make sure that the hits are numbered // so that tracks can save the hit links properly. This is // necessary only in the case that the hit set has been read // in from a file, but will not hurt in any event. This line // should be removed once hit links are stored via SiHitSet::Index // values. // (*hitList)[0]; // ----------------------------------------------------------------------// // Mat Martin and Dave Waters. If COT track was the seed, then only this // // track should be considered in the strategies. Make a special // // CdfTrackView containing only this seed track : // // ----------------------------------------------------------------------// CdfTrackView_h hView; hView = new CdfTrackView; if (theCOT_Track.is_null()) { if (_debugRegional.value()) { std::cout << dbm0 << evntnr << dbm << "COT track seed was not found. Using all tracks as input." << std::endl; } //----------------------------------------------------------------------- // input track list for Si pattern recognition is given by the "default" // list of COT tracks ("COT_Global_Tracking" collection) //----------------------------------------------------------------------- CdfTrackColl_ch cot_global; const StorableObject::SelectByDescription sel("COT_Global_Tracking"); if (CdfTrackColl::find(cot_global,sel) == CdfTrackColl::OK) { // loop over the COT tracks and put // them into the view ConstLink collLink( cot_global ); const CdfTrackColl::CollType& cont = cot_global->contents(); for ( CdfTrackColl::CollType::const_iterator i = cont.begin() ; i != cont.end() ; ++i) { hView->contents().push_back(CdfTrackView::value_type(collLink, i)); } } } else { if (_debugRegional.value()) { std::cout << dbm0 << evntnr <contents().push_back(theCOT_Track); } // Apply Pt cut to input COT tracks // if ( _minPt.value() != 0.0 ) { CdfTrackView::collection_type & v = hView->contents(); CdfTrackView::iterator newEnd; newEnd = std::remove_if( v.begin(), v.end(), !track_cut::PtGreaterThan( _minPt.value() ) ); v.erase( newEnd, v.end() ); } // Create a new track collection for output tracks CdfTrackColl* trackSet = new CdfTrackColl(hitSetC); string description; description = "GlobalSI_Tracking"; //---------------------------------------------------------------------- // append module name to the description if requested //---------------------------------------------------------------------- if (_uniqueOutputColl.value()) { description += "_"; description += name(); } trackSet->set_description(description); Si3DHitList *hitSet3D = new Si3DHitList; const FastZVertexColl *PVSet = NULL; EventRecord::ConstIterator iter(anEvent,"FastZVertexColl","*",_processName.value()); if (iter.is_valid()) { ConstHandle vertexSet(iter); if (!PVSet) { PVSet = &*vertexSet; } else { ERRLOG( ELwarning, "Multiple PVSet's in event" ) << "SUB=@SiPatternRecModule::event" << "I'm taking the first!" << endmsg; // std::cerr << "Warning in SiPatternRecModule: multiple PVSet's on record" << std::endl; // std::cerr << "I'm taking the first!" << std::std::endl; } } // const FastZVertexColl *kalPVSet = NULL; // StorableObject::SelectByDescription descold("Old Algo Primary Vertices"); // EventRecord::ConstIterator iterold(anEvent,descold); // if (iterold.is_valid()) { // ConstHandle vertexSetold(iterold); // kalPVSet = &*vertexSetold; // SiConfig::instance()->importZVertices(kalPVSet); // } // // if (kalPVSet == NULL) // { // StorableObject::SelectByDescription descMC("MC Truth Vertices"); // EventRecord::ConstIterator iterMC(anEvent,descMC); // if (iterMC.is_valid()) { // ConstHandle vertexSetMC(iterMC); // kalPVSet = &*vertexSetMC; // SiConfig::instance()->importZVertices(kalPVSet); // } // } // // if (kalPVSet == NULL) // SiConfig::instance()->importZVertices(PVSet); // if (_ZVerDescrip.value() != "") { const ZVertexColl *ZPVSet = NULL; EventRecord::ConstIterator iter(anEvent,"ZVertexColl",_ZVerDescrip.value(),_processName.value()); if (iter.is_valid()) { ConstHandle vertexSet(iter); if (!ZPVSet) { ZPVSet = &*vertexSet; } else { ERRLOG( ELwarning, "Searched PVSet's not in event" ) << "SUB=@SiPatternRecModule::event" << endmsg; } } SiConfig::instance()->importZVertices(ZPVSet); } //-----------------------------------------------------------------------// // DSW Find out which actual bank I have in the end : // // std::cout << " Number of clusters = " << clusterList->nEntries() << std::endl; // //-----------------------------------------------------------------------// _monger->set2DHitList(hitList); _monger->set3DHitList(hitSet3D); _monger->setVertexSet(PVSet); _monger->setSegmentSet( &(hView->contents()) ); _monger->setSiliconTrackSet( Link( trackSet ) ); _monger->executeStrategies(); trackSet->assignTrackIds( anEvent ); // Loop over tracks and tell parents about children. This needs to // be done here because the strategies do not know about the // CdfTrackColl used for the output tracks, which is needed to set the // links properly. // ConstLink collLink( trackSet ); CdfTrackColl::const_iterator iend = trackSet->contents().end(); for ( CdfTrackColl::const_iterator i = trackSet->contents().begin() ; i != iend ; ++i ) { if ( (**i).parent().is_nonnull() ) { (**i).parent()->setChildLink( CdfTrack_cfwdlnk( collLink, i ) ); } } //-----------------------------------------------------------------------// // Write out the tracks to persistent storage. // // No need to write out clusters, they are already stored. // //-----------------------------------------------------------------------// if (_writeOut.value()) { if ( currentRCPID().isValid() ) { trackSet->set_rcp_id( currentRCPID() ); } // Append the CdfTrackColl, even if empty. This simplifies things // down-stream, for example, in calculating efficiencies. // if (trackSet->contents().size()!=0) // { CdfTrackColl_h trackSetH(trackSet); if (_debugRegional.value()) { std::cout << dbm0 << evntnr << dbm << "CdfTrackColl with size " << trackSet->contents().size() << " being appended to GrowResultList. " << std::endl; } // Get the GenericConstantHandle back in order to add to the regional GrowResultLists : GenericConstHandle trackSetGCH = anEvent->append(trackSetH); // Append the track set to the GrowResultList for this region : GrowResultListCH->push_back( Link(const_cast( trackSetGCH.operator->() ))); // } // else // { // trackSet->destroy(); // } } else { trackSet->destroy(); } //-----------------------------------------------------------------------// // Clean up now // //-----------------------------------------------------------------------// // Handles do not currently own the memory to which // they point. //if ( hView.is_nonnull() ) //{ // hView->destroy(); //} delete hitSet3D; } // DSW 21.01.99 Loop over regions. if (_debugRegional.value()) { for (EventRecord::ConstIterator trackSetIter(anEvent,"CdfTrackColl","*",_processName.value()); trackSetIter.is_valid(); ++trackSetIter) { std::cout << dbm0 << evntnr << dbm << "CdfTrackColl found with description = " << trackSetIter->description() << std::endl; // MSM. The code commented out below is potentially useful regional debug printout... // It prints out the tracks in the set, in addition to the individual hits for examination of obsp info. // Remove the first set of // to get the printout. // // If the trackset has the description RegionalSI_Tracking then print out the hits.. // ConstHandle trackSetCH; // trackSetCH = trackSetIter; // if(trackSetCH->description()=="RegionalSI_Tracking"){ // std::cout <<"==========================================================================================="<contents().begin(); // trackIter != trackSetCH->contents().end(); ++trackIter) // { // std::cout<<"The track just printed: "<numSIHits()<beginSIHits(); // hitIter != (*trackIter)->endSIHits(); ++hitIter) // { // const SiCluster *theCluster = (*hitIter)->getCluster(); // //std::cout<<" Number of strips in cluster: "<getNstrip()<print(std::cout); // std::cout<