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.1 by bbetchar, Sat Jun 6 14:23:09 2009 UTC vs.
Revision 1.2 by bbetchar, Wed Jun 10 01:24:50 2009 UTC

# Line 2 | Line 2
2  
3   #include "UserCode/ShallowTools/interface/ShallowTools.h"
4  
5 #include "DataFormats/TrackReco/interface/Track.h"
5   #include "TrackingTools/PatternTools/interface/Trajectory.h"
6   #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
7   #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
# Line 16 | Line 15
15   #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
16   #include "Geometry/CommonTopologies/interface/StripTopology.h"
17   #include "FWCore/Framework/interface/ESHandle.h"
18 + #include "boost/foreach.hpp"
19  
20   ShallowTrackClustersProducer::ShallowTrackClustersProducer(const edm::ParameterSet& iConfig)
21    :  theTracksLabel( iConfig.getParameter<edm::InputTag>("Tracks") ),
# Line 115 | Line 115 | produce(edm::Event& iEvent, const edm::E
115        unsigned i = cluster->second;
116        if( 0 == (trackmulti->at(i))++ ) {
117          const StripGeomDetUnit* theStripDet = dynamic_cast<const StripGeomDetUnit*>( theTrackerGeometry->idToDet( hit->geographicalId() ) );
118 <        LocalVector lbfield=(theStripDet->surface()).toLocal(magfield->inTesla(theStripDet->surface().position()));
119 <        float tanLorentzAnglePerTesla = SiStripLorentzAngle->getLorentzAngle(hit->geographicalId());  
120 <        float driftz_ = theStripDet->specificSurface().bounds().thickness();
121 <        float driftx_ =-tanLorentzAnglePerTesla * lbfield.y() * driftz_;
122 <        float drifty_ = tanLorentzAnglePerTesla * lbfield.x() * driftz_;
118 >        LocalVector drift = shallow::drift( theStripDet, *magfield, *SiStripLorentzAngle);
119          
120          trackindex->at(i)   = shallow::findTrackIndex(tracks, track);
121          localtheta->at(i)   = (theStripDet->toLocal(tsos.globalDirection())).theta();
# Line 136 | Line 132 | produce(edm::Event& iEvent, const edm::E
132          globalz->at(i)      = tsos.globalPosition().z();                            
133          insidistance->at(i) = 1./fabs(cos(localtheta->at(i)));                      
134          projwidth->at(i)    = tan(localtheta->at(i))*cos(localphi->at(i));        
135 <        covered->at(i)      = driftz_/localpitch->at(i) * fabs(projwidth->at(i) - driftx_/driftz_);
135 >        covered->at(i)      = drift.z()/localpitch->at(i) * fabs(projwidth->at(i) - drift.x()/drift.z());
136          projlength->at(i)   = tan(localtheta->at(i))*cos(localphi->at(i)) ;        
137          rhlocalx->at(i)     = hit->localPosition().x();
138          rhlocaly->at(i)     = hit->localPosition().y();
# Line 147 | Line 143 | produce(edm::Event& iEvent, const edm::E
143          rhglobalz->at(i)    = theStripDet->toGlobal(hit->localPosition()).z();
144          rhstrip->at(i)      = theStripDet->specificTopology().strip(hit->localPosition());
145          rhmerr->at(i)       = sqrt(theStripDet->specificTopology().measurementError(hit->localPosition(), hit->localPositionError()).uu());
146 <        driftx->push_back(driftx_);
147 <        drifty->push_back(drifty_);
148 <        driftz->push_back(driftz_);
146 >        driftx->push_back(drift.x());
147 >        drifty->push_back(drift.y());
148 >        driftz->push_back(drift.z());
149        }
150      }
151    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines