CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/DataFormats/TrackReco/src/DeDxHit.cc

Go to the documentation of this file.
00001 #include "DataFormats/TrackReco/interface/DeDxHit.h"
00002 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00003 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00004 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
00005 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00006 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00007 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00008 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00009 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00010 using namespace reco;
00011 
00012 DeDxHit::DeDxHit(float ch,float dist,float len,DetId id): m_charge(ch),m_distance(dist),m_pathLength(len)
00013   {
00014         uint32_t subdet = id.subdetId();
00015         m_subDetId = (subdet&0x7)<<5;
00016         uint32_t layer = 0;
00017 
00018           if (subdet == PixelSubdetector::PixelBarrel)
00019               layer = PXBDetId(id).layer();
00020             else if (subdet == PixelSubdetector::PixelEndcap)
00021               layer = PXFDetId(id).disk();
00022             else if (subdet == StripSubdetector::TIB)
00023               layer = TIBDetId(id).layer();
00024             else if (subdet == StripSubdetector::TID)
00025               layer = (TIDDetId(id).wheel() & 0xF ) + ( (TIDDetId(id).side() -1 )<<4 );
00026             else if (subdet == StripSubdetector::TOB)
00027               layer = TOBDetId(id).layer();
00028             else if (subdet == StripSubdetector::TEC)
00029               layer = (TECDetId(id).wheel() & 0xF ) + ( (TECDetId(id).side() -1 )<<4 );
00030       m_subDetId += (layer & 0x1F) ; 
00031   }
00032 
00033