CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/RecoTracker/DebugTools/interface/CkfDebugTrackCandidateMaker.h

Go to the documentation of this file.
00001 
00002 #ifndef CkfDebugTrackCandidateMaker_h
00003 #define CkfDebugTrackCandidateMaker_h
00004 
00005 #include "RecoTracker/CkfPattern/interface/CkfTrackCandidateMakerBase.h"
00006 #include "RecoTracker/DebugTools/interface/CkfDebugTrajectoryBuilder.h"
00007 #include "FWCore/Framework/interface/EDProducer.h"
00008 
00009 namespace cms {
00010   class CkfDebugTrackCandidateMaker : public CkfTrackCandidateMakerBase, public edm::EDProducer {
00011   public:
00012     CkfDebugTrackCandidateMaker(const edm::ParameterSet& conf) : CkfTrackCandidateMakerBase(conf) {
00013       produces<TrackCandidateCollection>();
00014     }
00015 
00016     virtual void beginRun (edm::Run & run, edm::EventSetup const & es){
00017       beginRunBase(run,es); 
00018       initDebugger(es);
00019     }
00020 
00021     virtual void produce(edm::Event& e, const edm::EventSetup& es){produceBase(e,es);}
00022     virtual void endJob() {delete dbg; }
00023 
00024   private:
00025     virtual TrajectorySeedCollection::const_iterator 
00026       lastSeed(TrajectorySeedCollection& theSeedColl){return theSeedColl.begin()+1;}
00027 
00028     void initDebugger(edm::EventSetup const & es){
00029       dbg = new CkfDebugger(es);
00030       myTrajectoryBuilder = dynamic_cast<const CkfDebugTrajectoryBuilder*>(theTrajectoryBuilder);
00031       if (myTrajectoryBuilder) myTrajectoryBuilder->setDebugger( dbg);
00032       else throw cms::Exception("CkfDebugger") << "please use CkfDebugTrajectoryBuilder";
00033         //theTrajectoryBuilder->setDebugger( dbg);
00034     };
00035     
00036     void printHitsDebugger(edm::Event& e){dbg->printSimHits(e);};
00037     void countSeedsDebugger(){dbg->countSeed();};
00038     void deleteAssocDebugger(){dbg->deleteHitAssociator();};
00039     void deleteDebugger(){delete dbg;};
00040     CkfDebugger *  dbg;
00041     const CkfDebugTrajectoryBuilder* myTrajectoryBuilder;
00042   };
00043 }
00044 
00045 #endif