49 ofstream& file_) : es(es_), trackProducer(trackProducer_),
file(file_)
54 theTracker = trackerHandle.
product();
59 theMagField = magField.
product();
65 thePropagator = thePropagatorHandle.
product();
92 std::vector<SiPixelCluster::Pixel> pixels = cluster->pixels();
94 std::vector<PSimHit>
simHits = theHitAssociator->associateHit(*recHit);
96 std::string
info =
", Text[StyleForm[\"" + o.str() +
"\", URL->\"Track " + o.str()
101 o <<
"simTrack (trackId=" << simHits[0].trackId()
102 <<
" pid=" << simHits[0].particleType()
103 <<
" proc=" << simHits[0].processType() <<
")";
105 info +=
" | " + o.str();
110 o << theTracker->idToDet(
id)->subDetector();
112 info +=
" | " + o.str();
121 o <<
", {" << p.
x() <<
"," << p.
y() <<
",(" << p.
z() <<
"-zs)*mz},"
122 <<
" {" << 0 <<
"," << -1 <<
"}]";
136 GlobalPoint p = theTracker->idToDet(
id)->toGlobal(lpos);
138 std::vector<PSimHit>
simHits = theHitAssociator->associateHit(*recHit);
140 std::string
info =
", Text[StyleForm[\"" + o.str() +
"\", URL->\"Track " + o.str() + d.str();
150 o <<
"simTrackId=" << simHits[0].trackId() ;
152 info +=
" | " + o.str();
157 o << theTracker->idToDet(
id)->subDetector();
159 info +=
" | " + o.str();
164 if(stripMatchedRecHit != 0) info +=
" matched";
165 if(stripProjectedRecHit != 0) info +=
" projected";
166 if(stripRecHit != 0) info +=
" single";
173 o <<
", {" << p.
x() <<
"," << p.
y() <<
",(" << p.
z() <<
"-zs)*mz},"
174 <<
" {" << 0 <<
"," << -1 <<
"}]";
195 track.
charge(),theMagField);
207 file <<
", If[rt, {AbsolutePointSize[6]";
213 ev.
getByLabel(trackProducer, trajectoryHandle);
216 const std::vector<Trajectory>* trajectories = trajectoryHandle.
product();
219 <<
" [EventPlotter] recTracks (" << trackProducer <<
") "
220 << recTracks->size();
224 file <<
", RGBColor[0,0,0.4]";
225 reco::TrackCollection::const_iterator recTrack = recTracks->begin();
228 for(std::vector<Trajectory>::const_iterator it = trajectories->begin();
229 it!= trajectories->end();
230 it++, i++, recTrack++)
239 switch(recTrack->algo())
247 ostringstream
o; o <<
i;
249 ostringstream d; d << fixed << std::setprecision(2)
250 <<
" | d0=" << recTrack->d0() <<
" cm"
251 <<
" | z0=" << recTrack->dz() <<
" cm"
252 <<
" | pt=" << recTrack->pt() <<
" GeV/c";
256 for(std::vector<TrajectoryMeasurement>::const_reverse_iterator
266 GlobalPoint p = theTracker->idToDet(
id)->toGlobal(lpos);
268 if(theTracker->idToDet(
id)->subDetector() ==
270 theTracker->idToDet(
id)->subDetector() ==
280 file << getPixelInfo(recHit, o,d);
293 if(stripMatchedRecHit != 0)
300 GlobalPoint p = theTracker->idToDet(
id)->toGlobal(lpos);
302 file <<
", Point[{"<< p.
x()<<
","<<p.
y()<<
",("<<p.
z()<<
"-zs)*mz}]" << std::endl;
305 if(stripProjectedRecHit != 0)
311 if(stripMatchedRecHit != 0 ||
312 stripProjectedRecHit != 0 ||
314 file << getStripInfo(recHit, o,d);
323 recTrack = recTracks->begin();
325 for(std::vector<Trajectory>::const_iterator it = trajectories->begin();
326 it!= trajectories->end();
330 switch(recTrack->algo())
338 if(algo == 0)
file <<
", RGBColor[1,0,0]";
339 if(algo == 1)
file <<
", RGBColor[0.2,0.6,0.2]";
340 if(algo == 2)
file <<
", RGBColor[0.2,0.2,0.6]";
342 std::vector<TrajectoryMeasurement> meas = it->measurements();
344 for(std::vector<TrajectoryMeasurement>::reverse_iterator im = meas.rbegin();
345 im!= meas.rend(); im++)
347 if(im == meas.rbegin())
350 GlobalVector v2 = (*(im )).updatedState().globalDirection();
352 recTrack->vertex().y(),
353 recTrack->vertex().z());
358 if(im+1 != meas.rend())
362 GlobalVector v2 = (*(im+1)).updatedState().globalDirection();
369 GlobalPoint p1 = (*(meas.rend()-1)).forwardPredictedState().globalPosition();
377 tsos = thePropagator->propagate(fts,*theCylinder);
391 tsos = thePropagator->propagate(fts,*thePlanePos);
404 tsos = thePropagator->propagate(fts,*thePlaneNeg);
418 delete theHitAssociator;
PlotRecTracks(const edm::EventSetup &es_, std::string trackProducer_, std::ofstream &file_)
static std::string getInfo(const DetId &id)
void printHelix(const GlobalPoint &p1, const GlobalPoint &p2, const GlobalVector &n2, std::ofstream &outFile, int charge)
std::string getPixelInfo(const TrackingRecHit *recHit, const std::ostringstream &o, const std::ostringstream &d)
void printRecTracks(const edm::Event &ev)
double outerPy() const
y coordinate of momentum vector at the outermost hit position
const SiStripRecHit2D * stereoHit() const
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
GlobalPoint globalPosition() const
static PlanePointer build(const PositionType &pos, const RotationType &rot, MediumProperties *mp=0)
static int position[TOTALCHAMBERS][3]
virtual LocalPoint localPosition() const
double outerZ() const
z coordinate of the outermost hit position
DataContainer const & measurements() const
void printPixelRecHit(const SiPixelRecHit *recHit)
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
double outerX() const
x coordinate of the outermost hit position
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double outerPz() const
z coordinate of momentum vector at the outermost hit position
void printStripRecHit(const SiStripRecHit2D *recHit)
T const * product() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)
T const * product() const
std::string getStripInfo(const TrackingRecHit *recHit, const std::ostringstream &o, const std::ostringstream &d)
double outerY() const
y coordinate of the outermost hit position
int charge() const
track electric charge
FreeTrajectoryState getTrajectoryAtOuterPoint(const reco::Track &track)
DetId geographicalId() const
const SiStripRecHit2D * monoHit() const
virtual LocalPoint localPosition() const =0
ClusterRef const & cluster() const
const SiStripRecHit2D & originalHit() const
double outerPx() const
x coordinate of momentum vector at the outermost hit position
GlobalVector globalDirection() const