CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/RecoLocalTracker/SiStripRecHitConverter/plugins/SiStripRecHitConverter.cc

Go to the documentation of this file.
00001 #include "RecoLocalTracker/SiStripRecHitConverter/plugins/SiStripRecHitConverter.h"
00002 #include "FWCore/Framework/interface/Event.h"
00003 
00004 SiStripRecHitConverter::SiStripRecHitConverter(edm::ParameterSet const& conf) 
00005   : recHitConverterAlgorithm(conf) ,
00006     matchedRecHitsTag( conf.getParameter<std::string>( "matchedRecHits" ) ), 
00007     rphiRecHitsTag( conf.getParameter<std::string>( "rphiRecHits" ) ), 
00008     stereoRecHitsTag( conf.getParameter<std::string>( "stereoRecHits" ) ),
00009     clusterProducer(conf.getParameter<edm::InputTag>("ClusterProducer")),
00010     lazyGetterProducer(conf.getParameter<edm::InputTag>("LazyGetterProducer")),
00011     regional(conf.getParameter<bool>("Regional"))
00012 {
00013   produces<SiStripMatchedRecHit2DCollection>( matchedRecHitsTag );
00014   produces<SiStripRecHit2DCollection>( rphiRecHitsTag );
00015   produces<SiStripRecHit2DCollection>( stereoRecHitsTag );
00016   produces<SiStripRecHit2DCollection>( rphiRecHitsTag + "Unmatched" );
00017   produces<SiStripRecHit2DCollection>( stereoRecHitsTag +  "Unmatched" );
00018 }
00019 
00020 void SiStripRecHitConverter::
00021 produce(edm::Event& e, const edm::EventSetup& es)
00022 {
00023   edm::Handle<edmNew::DetSetVector<SiStripCluster> > clusters;
00024   edm::Handle<edm::RefGetter<SiStripCluster> > refclusters;
00025   edm::Handle<edm::LazyGetter<SiStripCluster> > lazygetter;
00026   
00027   if (regional){
00028     e.getByLabel(clusterProducer, refclusters);
00029     e.getByLabel(lazyGetterProducer, lazygetter);
00030   } else e.getByLabel(clusterProducer, clusters);
00031   
00032   SiStripRecHitConverterAlgorithm::products output;
00033   recHitConverterAlgorithm.initialize(es);
00034 
00035   if (regional) recHitConverterAlgorithm.run(refclusters,lazygetter,output);
00036   else          recHitConverterAlgorithm.run(clusters, output);
00037   
00038   LogDebug("SiStripRecHitConverter") << "found\n"  
00039                                      << output.rphi->dataSize()   << "  clusters in mono detectors\n"                            
00040                                      << output.stereo->dataSize() << "  clusters in partners stereo detectors\n";
00041 
00042   e.put( output.matched,         matchedRecHitsTag );
00043   e.put( output.rphi,            rphiRecHitsTag    );
00044   e.put( output.stereo,          stereoRecHitsTag  );
00045   e.put( output.rphiUnmatched,   rphiRecHitsTag   + "Unmatched" );
00046   e.put( output.stereoUnmatched, stereoRecHitsTag + "Unmatched" );  
00047 
00048 }