CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PrintRecoObjects.cc
Go to the documentation of this file.
1 #include "PrintRecoObjects.h"
4 
6 print(std::stringstream& ss, const SiStripCluster& clus){
7  ss << "\n\t"
8  << " firstStrip " << clus.firstStrip()
9  << " size " << clus.amplitudes().size();
10  float charge=0;
11  size_t idx=0;
12  for (auto adc : clus.amplitudes()){
13  charge+=adc;
14  ss << "\n\t\t strip " << ++idx << " adc " << (size_t) adc;
15  }
16  ss << "\n\t\t charge " << charge
17  << " barycenter " << clus.barycenter()
18  << std::endl;
19 }
20 
21 void
22 PrintRecoObjects::print(std::stringstream& ss, const TrajectorySeed& tjS){
23 
24  ss << "\n\t nHits "<< tjS.nHits()
25  << "\n\t PTrajectoryStateOnDet: detid " << tjS.startingState().detId()
26  << " tsos momentum" << tjS.startingState().parameters().momentum()
28  << " charge " << tjS.startingState().parameters().charge()
29  << "\n\t error ";
30  for(size_t ie=0;ie<15;++ie)
31  ss << "\t " << tjS.startingState().error(ie);
32  for(TrajectorySeed::const_iterator iter=tjS.recHits().first;iter!=tjS.recHits().second;++iter)
33  ss << "\n\t TrackingRecHit on detid " << iter->geographicalId().rawId() << " \t localPos " << iter->localPosition();
34 
35 }
36 
38 print(std::stringstream& ss, const uint32_t& detid, const TrackerTopology *tTopo) const{
39  ss<< getString(detid,tTopo);
40 }
41 
43 getString(uint32_t detid, const TrackerTopology *tTopo) const{
44  std::string append=" ";
45  char cindex[128];
46  SiStripDetId a(detid);
47  if ( a.subdetId() == 3 ){
48  append+="_TIB_L";
49  sprintf(cindex,"%d",tTopo->tibLayer(detid));
50  } else if ( a.subdetId() == 4 ) {
51  if(tTopo->tidSide(detid)==1){
52  append+="_M_D";
53  }else{
54  append+="_M_P";
55  }
56  sprintf(cindex,"%d",tTopo->tidWheel(detid));
57  } else if ( a.subdetId() == 5 ) {
58  append+="_TOB_L";
59  sprintf(cindex,"%d",tTopo->tobLayer(detid));
60  } else if ( a.subdetId() == 6 ) {
61  if(tTopo->tecSide(detid)==1){
62  append+="_TEC_M";
63  }else{
64  append+="_TEC_P";
65  }
66  sprintf(cindex,"%d",tTopo->tecWheel(detid));
67  }
68 
69  append+=std::string(cindex);
70  return append;
71 }
72 
74 print(std::stringstream& ss, const reco::Track* track, const math::XYZPoint& vx){
75 
76  ss
77  << "[PrintObject] "
78  << "\n\tcharge \t" << track->charge()
79  << "\talgo \t" << track->algo()
80  << "\n\treferencePoint \t" << track->referencePoint() << " \t r: " << track->referencePoint().rho()
81  << "\n\tinnerpos \t" << track->innerPosition() << " \t r: " << track->innerPosition().rho();
82 
83 
84  ss
85  << "\n\tmomentum \t" << track->momentum() << " pt " << track->momentum().rho()
86  << "\n\tinnerMom \t" << track->innerMomentum() << " pt " << track->innerMomentum().rho();
87 
88 
89  ss
90  << "\n\tinnerok \t" << track->innerOk()
91  << "\n\tinnerdetid \t" << track->innerDetId()
92  << "\n\tdxy \t" << track->dxy()
93  << "\n\tdxy(vx) \t" << track->dxy(vx)
94  << "\t where vx \t" << vx
95  << std::endl;
96 
97 }
int adc(sample_type sample)
get the ADC sample (12 bits)
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:676
T mag2() const
Definition: PV3DBase.h:66
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 ...
std::string getString(uint32_t detid, const TrackerTopology *tTopo) const
T y() const
Definition: PV3DBase.h:63
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:50
unsigned int tidWheel(const DetId &id) const
uint16_t firstStrip() const
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:670
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
TrackAlgorithm algo() const
Definition: TrackBase.h:492
unsigned int tidSide(const DetId &id) const
recHitContainer::const_iterator const_iterator
T sqrt(T t)
Definition: SSEVec.h:18
float barycenter() const
unsigned int detId() const
void print(std::stringstream &ss, const SiStripCluster &clus)
LocalVector momentum() const
Momentum vector in the local frame.
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
PTrajectoryStateOnDet const & startingState() const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
range recHits() const
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:60
double a
Definition: hdecay.h:121
int charge() const
track electric charge
Definition: TrackBase.h:562
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:586
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:99
const std::vector< uint8_t > & amplitudes() const
const LocalTrajectoryParameters & parameters() const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const