Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:24

0001 
0002 #ifndef CkfDebugTrackCandidateMaker_h
0003 #define CkfDebugTrackCandidateMaker_h
0004 
0005 #include "RecoTracker/CkfPattern/interface/CkfTrackCandidateMakerBase.h"
0006 #include "CkfDebugTrajectoryBuilder.h"
0007 #include "FWCore/Framework/interface/EDProducer.h"
0008 #include "DataFormats/TrackReco/interface/SeedStopInfo.h"
0009 
0010 namespace cms {
0011   class CkfDebugTrackCandidateMaker : public edm::EDProducer, public CkfTrackCandidateMakerBase {
0012   public:
0013     CkfDebugTrackCandidateMaker(const edm::ParameterSet& conf) : CkfTrackCandidateMakerBase(conf, consumesCollector()) {
0014       produces<TrackCandidateCollection>();
0015       produces<SeedStopInfo>();
0016     }
0017 
0018     void beginRun(edm::Run const& run, edm::EventSetup const& es) override {
0019       beginRunBase(run, es);
0020       initDebugger(es);
0021     }
0022 
0023     void produce(edm::Event& e, const edm::EventSetup& es) override { produceBase(e, es); }
0024     void endJob() override { delete dbg; }
0025 
0026   private:
0027     TrajectorySeedCollection::const_iterator lastSeed(TrajectorySeedCollection const& theSeedColl) override {
0028       return theSeedColl.begin() + 1;
0029     }
0030 
0031     void initDebugger(edm::EventSetup const& es) {
0032       dbg = new CkfDebugger(es, consumesCollector());
0033       myTrajectoryBuilder = dynamic_cast<const CkfDebugTrajectoryBuilder*>(theTrajectoryBuilder.get());
0034       if (myTrajectoryBuilder)
0035         myTrajectoryBuilder->setDebugger(dbg);
0036       else
0037         throw cms::Exception("CkfDebugger") << "please use CkfDebugTrajectoryBuilder";
0038       //theTrajectoryBuilder->setDebugger( dbg);
0039     };
0040 
0041     void printHitsDebugger(edm::Event& e) override { dbg->printSimHits(e); };
0042     void countSeedsDebugger() override { dbg->countSeed(); };
0043     void deleteAssocDebugger() override { dbg->deleteHitAssociator(); };
0044     void deleteDebugger() { delete dbg; };
0045     CkfDebugger* dbg;
0046     const CkfDebugTrajectoryBuilder* myTrajectoryBuilder;
0047   };
0048 }  // namespace cms
0049 
0050 #endif