CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PrintoutHelper.cc
Go to the documentation of this file.
2 
7 
8 
15 
19 
21 
22 std::string PrintoutHelper::dumpMeasurements(const std::vector<TrajectoryMeasurement> & v)
23 {
24  std::stringstream buffer;
25  buffer<<v.size()<<" total measurements\n";
26  std::vector<TrajectoryMeasurement>::const_iterator it=v.begin();
27  for (; it!=v.end();++it){
28  buffer<<dumpMeasurement(*it);
29  buffer<<"\n";}
30  return buffer.str();
31 }
33 {
34  std::stringstream buffer;
35  buffer<<v.size()<<" total measurements\n";
37  for (; it!=v.rend();--it){
38  buffer<<dumpMeasurement(*it);
39  buffer<<"\n";}
40  return buffer.str();
41 }
43 {
44  std::stringstream buffer;
45  buffer
46  <<"layer pointer: "<<tm.layer()<<"\n"
47  <<"estimate: "<<tm.estimate()<<"\n";
48  if (tm.updatedState().isValid())
49  buffer<<"updated state: \n"
50  <<"x: "<<tm.updatedState().globalPosition()<<"\n"
51  <<"p: "<<tm.updatedState().globalMomentum()<<"\n";
52  else if (tm.forwardPredictedState().isValid())
53  buffer<<"forward predicted state: \n"
54  <<"x: "<<tm.forwardPredictedState().globalPosition()<<"\n"
55  <<"p: "<<tm.forwardPredictedState().globalMomentum()<<"\n";
56  else if(tm.predictedState().isValid())
57  buffer<<"predicted state: \n"
58  <<"x: "<<tm.predictedState().globalPosition()<<"\n"
59  <<"p: "<<tm.predictedState().globalMomentum()<<"\n";
60  else buffer<<"no valid state\n";
61  buffer
62  // <<"geomdet pointer from rechit: "<<tm.recHit()->det()<<"\n"
63  <<"detId: "<<tm.recHit()->geographicalId().rawId();
64  if (tm.recHit()->isValid()){
65  buffer<<"\n hit global x: "<<tm.recHit()->globalPosition()
66  <<"\n hit global error: "<<tm.recHit()->globalPositionError().matrix()
67  <<"\n hit local x:"<<tm.recHit()->localPosition()
68  <<"\n hit local error"<<tm.recHit()->localPositionError();
69  }else buffer<<"\n (-,-,-)";
70  buffer<<"\n fwdPred " << tm.forwardPredictedState().isValid()
71  <<"\n bwdPred " << tm.backwardPredictedState().isValid()
72  <<"\n upPred " << tm.updatedState().isValid();
73  //SimIdPrinter()(tm.recHit());
74  return buffer.str();
75 }
76 
77 
79  std::vector<Trajectory> & unsmoothedResult
80  ){
81  std::stringstream buffer;
82 
83  /*
84  for(iseed=theSeedColl.begin();iseed!=theSeedColl.end();iseed++){
85  DetId tmpId = DetId( iseed->startingState().detId());
86  const GeomDet* tmpDet = tracker->idToDet( tmpId );
87  GlobalVector gv = tmpDet->surface().toGlobal( iseed->startingState().parameters().momentum() );
88 
89  LogTrace("TrackingRegressionTest") << "seed perp,phi,eta : "
90  << gv.perp() << " , "
91  << gv.phi() << " , "
92  << gv.eta() ;
93  }
94  */
95 
96  buffer<< "number of finalTrajectories: " << unsmoothedResult.size()<<std::endl;
97  for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin();
98  it != unsmoothedResult.end(); it++) {
99  if (it->lastMeasurement().updatedState().isValid()) {
100  buffer<< "candidate's n valid and invalid hit, chi2, pt, eta : "
101  << it->foundHits() << " , "
102  << it->lostHits() <<" , "
103  << it->chiSquared() << " , "
104  << it->lastMeasurement().updatedState().globalMomentum().perp() << " , "
105  << it->lastMeasurement().updatedState().globalMomentum().eta()<<std::endl;
106  } else if (it->lastMeasurement().predictedState().isValid()) {
107  buffer<< "candidate's n valid and invalid hit, chi2, pt, eta : "
108  << it->foundHits() << " , "
109  << it->lostHits() <<" , "
110  << it->chiSquared() << " , "
111  << it->lastMeasurement().predictedState().globalMomentum().perp() << " , "
112  << it->lastMeasurement().predictedState().globalMomentum().eta()<<std::endl;
113  } else buffer<< "candidate with invalid last measurement state!"<<std::endl;
114  }
115  buffer<<"=================================================";
116  return buffer.str();
117 }
const_iterator rend() const
Definition: bqueue.h:164
TrajectoryStateOnSurface const & predictedState() const
ConstRecHitPointer const & recHit() const
GlobalPoint globalPosition() const
static std::string dumpMeasurement(const TrajectoryMeasurement &tm)
static std::string dumpMeasurements(const std::vector< TrajectoryMeasurement > &v)
static std::string regressionTest(const TrackerGeometry &tracker, std::vector< Trajectory > &unsmoothedResult)
const DetLayer * layer() const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
const_iterator rbegin() const
Definition: bqueue.h:163
GlobalVector globalMomentum() const
TrajectoryStateOnSurface const & updatedState() const
size_type size() const
Definition: bqueue.h:167
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)