CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/SimDataFormats/SimHitMaker/src/TrackingSlaveSD.cc

Go to the documentation of this file.
00001 #include "SimDataFormats/SimHitMaker/interface/TrackingSlaveSD.h"
00002 //#include "SimG4Core/Application/interface/SimTrackManager.h"
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 
00005 #include <iostream>
00006 //#define DEBUG
00007 
00008 using std::cout;
00009 using std::endl;
00010 
00011 TrackingSlaveSD::TrackingSlaveSD(std::string myName) : name_(myName){
00012 
00013  LogDebug("HitBuildInfo")<< " TrackingSlaveSD " << name_; 
00014 
00015 }
00016 
00017 TrackingSlaveSD::~TrackingSlaveSD()
00018 {}
00019 
00020 void TrackingSlaveSD::Initialize(){
00021 
00022 
00023   LogDebug("HitBuildInfo")<< " initialize TrackingSlaveSD "<< name_;
00024 
00025   hits_.clear(); 
00026 }
00027 /*
00028 void TrackingSlaveSD::renumbering(const SimTrackManager* tkManager){
00029   //
00030   // Now renumber the Hits
00031   //
00032   edm::LogInfo("TrackRenumberingInfo")<< " TrackingSlaveSD "<<name()<<" renumbering " << hits_.size() <<" hits.";
00033   //
00034   // now I loop over PSimHits and change the id inside
00035   //
00036   for(TrackingSlaveSD::Collection::const_iterator it = begin(); it!= end(); it++){
00037     PSimHit& temp = const_cast<PSimHit&>(*it);
00038     unsigned int nt = tkManager->g4ToSim(temp.trackId());
00039 
00040     LogDebug("TrackRenumberingInfo")<<" Studying PSimHit " << temp 
00041                                     <<" Changing TrackID from " << temp.trackId()
00042                                     <<" with " << nt;
00043 
00044     setTrackId( temp, nt);
00045   }
00046 
00047 }
00048 */
00049 bool TrackingSlaveSD::format()
00050 {
00051 
00052   LogDebug("HitBuildInfo")<< " TrackingSlaveSD " << name_<< " formatting " << hits_.size() << " hits.";
00053 
00054   return true;
00055 }
00056 
00057 bool TrackingSlaveSD::processHits(const PSimHit & ps)
00058 {
00059 
00060   LogDebug("HitBuildInfo")<<" Sent Hit " << ps << " to ROU " << name_;
00061 
00062   hits_.push_back(ps);
00063   return true;
00064 } 
00065 
00066 void TrackingSlaveSD::setTrackId(PSimHit & hit, unsigned int k)
00067 { hit.theTrackId = k; }
00068 
00069