CMS 3D CMS Logo

HitInfo.cc

Go to the documentation of this file.
00001 #include "RecoPixelVertexing/PixelLowPtUtilities/interface/HitInfo.h"
00002 
00003 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
00004 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00005 
00006 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00007 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00008 
00009 #include <sstream>
00010 using namespace std;
00011 
00012 /*****************************************************************************/
00013 HitInfo::HitInfo()
00014 {
00015 }
00016 
00017 /*****************************************************************************/
00018 HitInfo::~HitInfo()
00019 {
00020 }
00021 
00022 /*****************************************************************************/
00023 string HitInfo::getInfo(const DetId & id)
00024 {
00025   string info;
00026 
00027   if(id.subdetId() == int(PixelSubdetector::PixelBarrel))
00028   {
00029     // 0 + (layer-1)<<1 + (ladder-1)%2 : 0-5
00030     PXBDetId pid(id);
00031     ostringstream o;
00032     o << " (" << pid.layer()  << "|" << pid.ladder()
00033       <<  "|" << pid.module() << ")";
00034     info += o.str();
00035   }
00036   else
00037   {
00038     // 6 + (disk-1)<<1 + (panel-1)%2
00039     PXFDetId pid(id);
00040     ostringstream o;
00041     o << " (" << pid.side()   << "|" << pid.disk()
00042       <<  "|" << pid.blade()  << "|" << pid.panel()
00043       <<  "|" << pid.module() << ")";
00044     info += o.str();
00045   }
00046 
00047   return info;
00048 }
00049 
00050 /*****************************************************************************/
00051 string HitInfo::getInfo(const TrackingRecHit & recHit)
00052 {
00053   DetId id(recHit.geographicalId());
00054 
00055   return getInfo(id);
00056 }
00057 
00058 /*****************************************************************************/
00059 string HitInfo::getInfo(vector<const TrackingRecHit *> recHits)
00060 {
00061   string info;
00062 
00063   for(vector<const TrackingRecHit *>::const_iterator
00064         recHit = recHits.begin();
00065         recHit!= recHits.end(); recHit++)
00066      info += getInfo(**recHit);
00067 
00068   return info;
00069 }
00070 
00071 /*****************************************************************************/
00072 string HitInfo::getInfo(const PSimHit & simHit)
00073 {
00074   string info;
00075 
00076   DetId id = DetId(simHit.detUnitId());
00077 
00078   {
00079     ostringstream o;
00080     o << simHit.particleType();
00081 
00082     info += " | pid=" + o.str();
00083   }
00084 
00085   {
00086     ostringstream o;
00087 //    o << theTracker->idToDet(id)->subDetector();
00088     o << id.subdetId();
00089 
00090     info += " | " + o.str();
00091   }
00092 
00093   return info + getInfo(id);;
00094 }
00095 

Generated on Tue Jun 9 17:44:51 2009 for CMSSW by  doxygen 1.5.4