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