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 : "
101  << it->foundHits() << " , "
102  << it->lostHits() <<" , "
103  << it->chiSquared() << " , "
104  << it->lastMeasurement().updatedState().globalMomentum().perp()<<std::endl;
105  } else if (it->lastMeasurement().predictedState().isValid()) {
106  buffer<< "candidate's n valid and invalid hit, chi2, pt : "
107  << it->foundHits() << " , "
108  << it->lostHits() <<" , "
109  << it->chiSquared() << " , "
110  << it->lastMeasurement().predictedState().globalMomentum().perp()<<std::endl;
111  } else buffer<< "candidate with invalid last measurement state!"<<std::endl;
112  }
113  buffer<<"=================================================";
114  return buffer.str();
115 }
const_iterator rend() const
Definition: bqueue.h:142
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
GlobalPoint globalPosition() const
ConstRecHitPointer recHit() 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 updatedState() const
TrajectoryStateOnSurface predictedState() const
iterator rbegin()
Definition: bqueue.h:140
GlobalVector globalMomentum() const
size_type size() const
Definition: bqueue.h:143
mathSSE::Vec4< T > v
TrajectoryStateOnSurface backwardPredictedState() const
Access to backward predicted state (from smoother)