00001 #ifndef RecoLocalTracker_SiPixelRecHits_SiPixelRecHitConverter_h 00002 #define RecoLocalTracker_SiPixelRecHits_SiPixelRecHitConverter_h 00003 00004 //--------------------------------------------------------------------------- 00032 //--------------------------------------------------------------------------- 00033 00034 //--- Base class for CPEs: 00035 #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" 00036 //&&& #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h" 00037 00038 //--- Geometry + DataFormats 00039 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00040 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" 00041 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" 00042 #include "DataFormats/Common/interface/EDProduct.h" 00043 #include "DataFormats/Common/interface/DetSetVector.h" 00044 00045 //--- Framework 00046 #include "FWCore/Framework/interface/EDProducer.h" 00047 #include "FWCore/Framework/interface/Event.h" 00048 #include "FWCore/Framework/interface/EventSetup.h" 00049 00050 //#define TP_OLD 00051 #ifdef TP_OLD 00052 #include "FWCore/Framework/interface/Handle.h" 00053 #else 00054 #include "DataFormats/Common/interface/Handle.h" 00055 #endif 00056 #include "FWCore/Framework/interface/ESHandle.h" 00057 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00058 #include "FWCore/Utilities/interface/InputTag.h" 00059 00060 class MagneticField; 00061 namespace cms 00062 { 00063 class SiPixelRecHitConverter : public edm::EDProducer 00064 { 00065 public: 00066 //--- Constructor, virtual destructor (just in case) 00067 explicit SiPixelRecHitConverter(const edm::ParameterSet& conf); 00068 virtual ~SiPixelRecHitConverter(); 00069 00070 //--- Factory method to make CPE's depending on the ParameterSet 00071 //--- Not sure if we need to make more than one CPE to run concurrently 00072 //--- on different parts of the detector (e.g., one for the barrel and the 00073 //--- one for the forward). The way the CPE's are written now, it's 00074 //--- likely we can use one (and they will switch internally), or 00075 //--- make two of the same but configure them differently. We need a more 00076 //--- realistic use case... 00077 00078 //--- The top-level event method. 00079 virtual void produce(edm::Event& e, const edm::EventSetup& c); 00080 00081 // Begin Job 00082 //virtual void beginJob(); 00083 virtual void beginJob(); 00084 00085 //--- Execute the position estimator algorithm(s). 00086 //--- New interface with DetSetVector 00087 void run(const edmNew::DetSetVector<SiPixelCluster>& input, 00088 SiPixelRecHitCollectionNew & output, 00089 edm::ESHandle<TrackerGeometry> & geom); 00090 00091 void run(edm::Handle<edmNew::DetSetVector<SiPixelCluster> > inputhandle, 00092 SiPixelRecHitCollectionNew & output, 00093 edm::ESHandle<TrackerGeometry> & geom); 00094 00095 private: 00096 edm::ParameterSet conf_; 00097 // TO DO: maybe allow a map of pointers? 00098 std::string cpeName_; // what the user said s/he wanted 00099 const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) 00100 //&&& PixelCPEBase * cpe_; // what we got (for now, one ptr to base class) 00101 bool ready_; // needed CPE's valid => good to go! 00102 edm::InputTag src_; 00103 int theVerboseLevel; // algorithm's verbosity 00104 bool m_newCont; // save also in emdNew::DetSetVector 00105 }; 00106 } 00107 00108 00109 #endif