Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:14

0001 /*
0002  * SvtxTrack_FastSim_v3.C
0003  *
0004  *  Created on: Jul 28, 2016
0005  *      Author: yuhw
0006  */
0007 
0008 #include "SvtxTrack_FastSim_v3.h"
0009 
0010 #include "SvtxTrack.h"  // for SvtxTrack::ConstClusterIter, SvtxTrack
0011 
0012 #include <map>      // for _Rb_tree_const_iterator
0013 #include <ostream>  // for operator<<, basic_ostream, basic_ostream<>::_...
0014 
0015 SvtxTrack_FastSim_v3::SvtxTrack_FastSim_v3(const SvtxTrack& source)
0016 {
0017   SvtxTrack_FastSim_v3::CopyFrom(source);
0018 }
0019 
0020 void SvtxTrack_FastSim_v3::CopyFrom(const SvtxTrack& source)
0021 {
0022   // do nothing if copying onto oneself
0023   if (this == &source)
0024   {
0025     return;
0026   }
0027 
0028   // parent class method
0029   SvtxTrack_v3::CopyFrom(source);
0030 
0031   // additional members
0032   _truth_track_id = source.get_truth_track_id();
0033   _nmeas = source.get_num_measurements();
0034   _g4hit_ids = source.g4hit_ids();
0035 }
0036 
0037 void SvtxTrack_FastSim_v3::identify(std::ostream& os) const
0038 {
0039   SvtxTrack_v3::identify(os);
0040 
0041   os << "SvtxTrack_FastSim_v3 Object ";
0042   os << "_truth_Track_id: " << _truth_track_id << std::endl;
0043   os << "_nmeas: " << _nmeas << std::endl;
0044 
0045   os << "G4Hit IDs:" << std::endl;
0046   for (const auto& pair : _g4hit_ids)
0047   {
0048     os << "\thit container ID" << pair.first << " with hits: ";
0049     for (const auto& hitid : pair.second)
0050     {
0051       os << hitid << " ";
0052     }
0053     os << std::endl;
0054   }
0055   return;
0056 }
0057 
0058 int SvtxTrack_FastSim_v3::isValid() const
0059 {
0060   return 1;
0061 }