ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/ShallowTools/plugins/ShallowTrackClustersProducer.cc
(Generate patch)

Comparing UserCode/ShallowTools/plugins/ShallowTrackClustersProducer.cc (file contents):
Revision 1.7 by bbetchar, Wed Sep 2 12:05:33 2009 UTC vs.
Revision 1.9 by bbetchar, Wed Sep 2 19:41:51 2009 UTC

# Line 21 | Line 21
21  
22   ShallowTrackClustersProducer::ShallowTrackClustersProducer(const edm::ParameterSet& iConfig)
23    :  theTracksLabel( iConfig.getParameter<edm::InputTag>("Tracks") ),
24 +     theClustersLabel( iConfig.getParameter<edm::InputTag>("Clusters") ),
25       Suffix       ( iConfig.getParameter<std::string>("Suffix")    ),
26       Prefix       ( iConfig.getParameter<std::string>("Prefix") )
27   {
# Line 64 | Line 65 | ShallowTrackClustersProducer::ShallowTra
65  
66   void ShallowTrackClustersProducer::
67   produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
68 <  shallow::CLUSTERMAP clustermap = shallow::make_cluster_map(iEvent);
68 >  shallow::CLUSTERMAP clustermap = shallow::make_cluster_map(iEvent,theClustersLabel);
69  
70    int size = clustermap.size();
71    std::auto_ptr<std::vector<unsigned int> > trackmulti   ( new std::vector<unsigned int>(size,    0)   );
# Line 120 | Line 121 | produce(edm::Event& iEvent, const edm::E
121        const TrajectoryStateOnSurface unbiased = combiner(measurement.forwardPredictedState(), measurement.backwardPredictedState());
122        const SiStripRecHit2D* hit = dynamic_cast<const SiStripRecHit2D*> ( measurement.recHit()->hit() );  
123        
124 <      if(!hit) break;
124 >      if(!hit) continue;
125        shallow::CLUSTERMAP::const_iterator cluster = clustermap.find( std::make_pair(hit->geographicalId().rawId(), hit->cluster()->firstStrip() ));
126 <      if(cluster == clustermap.end() ) break;
126 >      if(cluster == clustermap.end() ) throw cms::Exception("Logic Error") << "Cluster not found: this could be a configuration error" << std::endl;
127        
128        unsigned i = cluster->second;
129        if( 0 == (trackmulti->at(i))++ ) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines