CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 (TrajectorySeed::const_iterator iter = tjS.recHits().first; iter != tjS.recHits().second; ++iter)
26  ss << "\n\t TrackingRecHit on detid " << iter->geographicalId().rawId() << " \t localPos " << iter->localPosition();
27 }
28 
29 void PrintRecoObjects::print(std::stringstream& ss, const uint32_t& detid, const TrackerTopology* tTopo) const {
30  ss << getString(detid, tTopo);
31 }
32 
33 std::string PrintRecoObjects::getString(uint32_t detid, const TrackerTopology* tTopo) const {
34  std::string append = " ";
35  char cindex[128];
36  SiStripDetId a(detid);
37  if (a.subdetId() == 3) {
38  append += "_TIB_L";
39  sprintf(cindex, "%d", tTopo->tibLayer(detid));
40  } else if (a.subdetId() == 4) {
41  if (tTopo->tidSide(detid) == 1) {
42  append += "_M_D";
43  } else {
44  append += "_M_P";
45  }
46  sprintf(cindex, "%d", tTopo->tidWheel(detid));
47  } else if (a.subdetId() == 5) {
48  append += "_TOB_L";
49  sprintf(cindex, "%d", tTopo->tobLayer(detid));
50  } else if (a.subdetId() == 6) {
51  if (tTopo->tecSide(detid) == 1) {
52  append += "_TEC_M";
53  } else {
54  append += "_TEC_P";
55  }
56  sprintf(cindex, "%d", tTopo->tecWheel(detid));
57  }
58 
59  append += std::string(cindex);
60  return append;
61 }
62 
63 void PrintRecoObjects::print(std::stringstream& ss, const reco::Track* track, const math::XYZPoint& vx) {
64  ss << "[PrintObject] "
65  << "\n\tcharge \t" << track->charge() << "\talgo \t" << track->algo() << "\n\treferencePoint \t"
66  << track->referencePoint() << " \t r: " << track->referencePoint().rho() << "\n\tinnerpos \t"
67  << track->innerPosition() << " \t r: " << track->innerPosition().rho();
68 
69  ss << "\n\tmomentum \t" << track->momentum() << " pt " << track->momentum().rho() << "\n\tinnerMom \t"
70  << track->innerMomentum() << " pt " << track->innerMomentum().rho();
71 
72  ss << "\n\tinnerok \t" << track->innerOk() << "\n\tinnerdetid \t" << track->innerDetId() << "\n\tdxy \t"
73  << track->dxy() << "\n\tdxy(vx) \t" << track->dxy(vx) << "\t where vx \t" << vx << std::endl;
74 }
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
SiStripCluster::barycenter
float barycenter() const
Definition: SiStripCluster.cc:23
PTrajectoryStateOnDet::error
float & error(int i)
Definition: PTrajectoryStateOnDet.h:63
PrintRecoObjects::print
void print(std::stringstream &ss, const SiStripCluster &clus)
Definition: PrintRecoObjects.cc:5
TrajectorySeed::nHits
unsigned int nHits() const
Definition: TrajectorySeed.h:53
TrackerTopology
Definition: TrackerTopology.h:16
TrajectorySeed::const_iterator
recHitContainer::const_iterator const_iterator
Definition: TrajectorySeed.h:20
SiStripDetId.h
PV3DBase::mag2
T mag2() const
Definition: PV3DBase.h:63
training_settings.idx
idx
Definition: training_settings.py:16
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
SiStripCluster::firstStrip
uint16_t firstStrip() const
Definition: SiStripCluster.h:38
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
TrackerTopology.h
PTrajectoryStateOnDet::detId
unsigned int detId() const
Definition: PTrajectoryStateOnDet.h:65
PrintRecoObjects::getString
std::string getString(uint32_t detid, const TrackerTopology *tTopo) const
Definition: PrintRecoObjects.cc:33
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::Track
Definition: Track.h:27
PrintRecoObjects.h
LocalTrajectoryParameters::charge
TrackCharge charge() const
Charge (-1, 0 or 1)
Definition: LocalTrajectoryParameters.h:110
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
a
double a
Definition: hdecay.h:119
mps_setup.append
append
Definition: mps_setup.py:85
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
SiStripCluster::amplitudes
const std::vector< uint8_t > & amplitudes() const
Definition: SiStripCluster.h:51
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
PTrajectoryStateOnDet::parameters
const LocalTrajectoryParameters & parameters() const
Definition: PTrajectoryStateOnDet.h:60
LocalTrajectoryParameters::momentum
LocalVector momentum() const
Momentum vector in the local frame.
Definition: LocalTrajectoryParameters.h:88
TrajectorySeed::recHits
range recHits() const
Definition: TrajectorySeed.h:52
TrajectorySeed
Definition: TrajectorySeed.h:17
TrajectorySeed::startingState
PTrajectoryStateOnDet const & startingState() const
Definition: TrajectorySeed.h:55
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
SiStripCluster
Definition: SiStripCluster.h:9
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184