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.6 by bbetchar, Tue Aug 11 14:07:09 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 59 | Line 60 | ShallowTrackClustersProducer::ShallowTra
60    produces <std::vector<float> >       ( Prefix + "driftx"        + Suffix );
61    produces <std::vector<float> >       ( Prefix + "drifty"        + Suffix );
62    produces <std::vector<float> >       ( Prefix + "driftz"        + Suffix );
63 +  produces <std::vector<float> >       ( Prefix + "globalZofunitlocalY" + Suffix );            
64   }
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 98 | Line 100 | produce(edm::Event& iEvent, const edm::E
100    std::auto_ptr<std::vector<float> >  driftx        ( new std::vector<float>(size,  -10000  ));
101    std::auto_ptr<std::vector<float> >  drifty        ( new std::vector<float>(size,  -10000  ));
102    std::auto_ptr<std::vector<float> >  driftz        ( new std::vector<float>(size,  -10000  ));
103 +  std::auto_ptr<std::vector<float> >  globalZofunitlocalY ( new std::vector<float>(size, -1000));
104  
105    edm::ESHandle<TrackerGeometry> theTrackerGeometry;         iSetup.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry );  
106    edm::ESHandle<MagneticField> magfield;                     iSetup.get<IdealMagneticFieldRecord>().get(magfield);                    
# Line 118 | 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))++ ) {
# Line 158 | Line 161 | produce(edm::Event& iEvent, const edm::E
161          driftx->at(i)       = drift.x();
162          drifty->at(i)       = drift.y();
163          driftz->at(i)       = drift.z();
164 +        globalZofunitlocalY->at(i) = (theStripDet->toGlobal(LocalVector(0,1,0))).z();
165        }
166      }
167    }
# Line 191 | Line 195 | produce(edm::Event& iEvent, const edm::E
195    iEvent.put(rhmerr,      Prefix + "rhmerr"      + Suffix );  
196    iEvent.put(ubstrip,     Prefix + "ubstrip"     + Suffix );  
197    iEvent.put(ubmerr,      Prefix + "ubmerr"      + Suffix );  
198 <  iEvent.put( driftx,        Prefix + "driftx"        );
199 <  iEvent.put( drifty,        Prefix + "drifty"        );
200 <  iEvent.put( driftz,        Prefix + "driftz"        );
198 >  iEvent.put( driftx,     Prefix + "driftx"      + Suffix );
199 >  iEvent.put( drifty,     Prefix + "drifty"      + Suffix );
200 >  iEvent.put( driftz,     Prefix + "driftz"      + Suffix );
201 >  iEvent.put( globalZofunitlocalY, Prefix + "globalZofunitlocalY" + Suffix );
202   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines