CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PrintRecoObjects.cc
Go to the documentation of this file.
1 #include "PrintRecoObjects.h"
4 
5 void PrintRecoObjects::print(std::stringstream& ss, const SiStripCluster& clus) {
6  ss << "\n\t"
7  << " firstStrip " << clus.firstStrip() << " size " << clus.amplitudes().size();
8  float charge = 0;
9  size_t idx = 0;
10  for (auto adc : clus.amplitudes()) {
11  charge += adc;
12  ss << "\n\t\t strip " << ++idx << " adc " << (size_t)adc;
13  }
14  ss << "\n\t\t charge " << charge << " barycenter " << clus.barycenter() << std::endl;
15 }
16 
17 void PrintRecoObjects::print(std::stringstream& ss, const TrajectorySeed& tjS) {
18  ss << "\n\t nHits " << tjS.nHits() << "\n\t PTrajectoryStateOnDet: detid " << tjS.startingState().detId()
19  << " tsos momentum" << tjS.startingState().parameters().momentum() << " pt "
20  << sqrt(tjS.startingState().parameters().momentum().mag2() -
22  << " charge " << tjS.startingState().parameters().charge() << "\n\t error ";
23  for (size_t ie = 0; ie < 15; ++ie)
24  ss << "\t " << tjS.startingState().error(ie);
25  for (auto const& recHit : tjS.recHits()) {
26  ss << "\n\t TrackingRecHit on detid " << recHit.geographicalId().rawId() << " \t localPos "
27  << recHit.localPosition();
28  }
29 }
30 
31 void PrintRecoObjects::print(std::stringstream& ss, const uint32_t& detid, const TrackerTopology* tTopo) const {
32  ss << getString(detid, tTopo);
33 }
34 
35 std::string PrintRecoObjects::getString(uint32_t detid, const TrackerTopology* tTopo) const {
36  std::string append = " ";
37  char cindex[128];
38  SiStripDetId a(detid);
39  if (a.subdetId() == 3) {
40  append += "_TIB_L";
41  sprintf(cindex, "%d", tTopo->tibLayer(detid));
42  } else if (a.subdetId() == 4) {
43  if (tTopo->tidSide(detid) == 1) {
44  append += "_M_D";
45  } else {
46  append += "_M_P";
47  }
48  sprintf(cindex, "%d", tTopo->tidWheel(detid));
49  } else if (a.subdetId() == 5) {
50  append += "_TOB_L";
51  sprintf(cindex, "%d", tTopo->tobLayer(detid));
52  } else if (a.subdetId() == 6) {
53  if (tTopo->tecSide(detid) == 1) {
54  append += "_TEC_M";
55  } else {
56  append += "_TEC_P";
57  }
58  sprintf(cindex, "%d", tTopo->tecWheel(detid));
59  }
60 
61  append += std::string(cindex);
62  return append;
63 }
64 
65 void PrintRecoObjects::print(std::stringstream& ss, const reco::Track* track, const math::XYZPoint& vx) {
66  ss << "[PrintObject] "
67  << "\n\tcharge \t" << track->charge() << "\talgo \t" << track->algo() << "\n\treferencePoint \t"
68  << track->referencePoint() << " \t r: " << track->referencePoint().rho() << "\n\tinnerpos \t"
69  << track->innerPosition() << " \t r: " << track->innerPosition().rho();
70 
71  ss << "\n\tmomentum \t" << track->momentum() << " pt " << track->momentum().rho() << "\n\tinnerMom \t"
72  << track->innerMomentum() << " pt " << track->innerMomentum().rho();
73 
74  ss << "\n\tinnerok \t" << track->innerOk() << "\n\tinnerdetid \t" << track->innerDetId() << "\n\tdxy \t"
75  << track->dxy() << "\n\tdxy(vx) \t" << track->dxy(vx) << "\t where vx \t" << vx << std::endl;
76 }
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:667
T mag2() const
Definition: PV3DBase.h:63
unsigned int tibLayer(const DetId &id) const
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
SiStripCluster const & amplitudes() const
std::string getString(uint32_t detid, const TrackerTopology *tTopo) const
T y() const
Definition: PV3DBase.h:60
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:53
unsigned int tidWheel(const DetId &id) const
uint16_t firstStrip() const
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
TrackAlgorithm algo() const
Definition: TrackBase.h:547
auto size() const
unsigned int tidSide(const DetId &id) const
T sqrt(T t)
Definition: SSEVec.h:19
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
float barycenter() const
unsigned int detId() const
void print(std::stringstream &ss, const SiStripCluster &clus)
LocalVector momentum() const
Momentum vector in the local frame.
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
RecHitRange recHits() const
PTrajectoryStateOnDet const & startingState() const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
TrackCharge charge() const
Charge (-1, 0 or 1)
unsigned int nHits() const
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
double a
Definition: hdecay.h:119
int charge() const
track electric charge
Definition: TrackBase.h:596
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
unsigned int tecWheel(const DetId &id) const
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:82
const LocalTrajectoryParameters & parameters() const
unsigned int tobLayer(const DetId &id) const
uint16_t *__restrict__ uint16_t const *__restrict__ adc
unsigned int tecSide(const DetId &id) const