Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:52

0001 #include "SimDataFormats/SimHitMaker/interface/TrackingSlaveSD.h"
0002 //#include "SimG4Core/Application/interface/SimTrackManager.h"
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 
0005 #include <iostream>
0006 //#define DEBUG
0007 
0008 using std::cout;
0009 using std::endl;
0010 
0011 TrackingSlaveSD::TrackingSlaveSD(std::string myName) : name_(myName) {
0012   LogDebug("HitBuildInfo") << " TrackingSlaveSD " << name_;
0013 }
0014 
0015 TrackingSlaveSD::~TrackingSlaveSD() {}
0016 
0017 void TrackingSlaveSD::Initialize() {
0018   LogDebug("HitBuildInfo") << " initialize TrackingSlaveSD " << name_;
0019 
0020   hits_.clear();
0021 }
0022 /*
0023 void TrackingSlaveSD::renumbering(const SimTrackManager* tkManager){
0024   //
0025   // Now renumber the Hits
0026   //
0027   edm::LogInfo("TrackRenumberingInfo")<< " TrackingSlaveSD "<<name()<<"
0028 renumbering " << hits_.size() <<" hits.";
0029   //
0030   // now I loop over PSimHits and change the id inside
0031   //
0032   for(TrackingSlaveSD::Collection::const_iterator it = begin(); it!= end();
0033 it++){ PSimHit& temp = const_cast<PSimHit&>(*it); unsigned int nt =
0034 tkManager->g4ToSim(temp.trackId());
0035 
0036     LogDebug("TrackRenumberingInfo")<<" Studying PSimHit " << temp
0037                                     <<" Changing TrackID from " <<
0038 temp.trackId()
0039                                     <<" with " << nt;
0040 
0041     setTrackId( temp, nt);
0042   }
0043 
0044 }
0045 */
0046 bool TrackingSlaveSD::format() {
0047   LogDebug("HitBuildInfo") << " TrackingSlaveSD " << name_ << " formatting " << hits_.size() << " hits.";
0048 
0049   return true;
0050 }
0051 
0052 bool TrackingSlaveSD::processHits(const PSimHit &ps) {
0053   LogDebug("HitBuildInfo") << " Sent Hit " << ps << " to ROU " << name_;
0054 
0055   hits_.push_back(ps);
0056   return true;
0057 }
0058 
0059 void TrackingSlaveSD::setTrackId(PSimHit &hit, unsigned int k) { hit.theTrackId = k; }