21 #include <ktracker/SRecEvent.h>
51 #include <gsl/gsl_randist.h>
52 #include <gsl/gsl_rng.h>
54 #include <boost/lexical_cast.hpp>
60 _hit_container_type(
"Vector"),
65 _in_name(
"digit_016070_R007.root"),
66 _in_tree_name(
"save"),
70 _out_name(
"SRawEventEmbedEval.root")
85 int ret = GetNodes(topNode);
88 _fin = TFile::Open(_in_name.c_str(),
"READ");
94 _tin = (TTree*) _fin->Get(_in_tree_name.c_str());
101 _tin->SetBranchAddress(
"rawEvent", &_srawevent);
109 std::cout <<
"Entering SRawEventEmbed::process_event: " << _event << std::endl;
113 if(!_hit_vector and _hit_container_type.find(
"Vector") == std::string::npos) {
114 LogInfo(
"!_hit_vector and _hit_container_type.find(\"Vector\") == std::string::npos");
122 _tin->GetEntry(_tree_entry);
125 LogInfo(
"FAIL: _tin->GetEntry(_tree_entry);");
130 LogInfo(
"_tree_entry: " << _tree_entry);
138 if(_tree_entry >= _tin->GetEntries()) _tree_entry=0;
148 auto up_digiHit = std::unique_ptr<SQMCHit_v1> (
new SQMCHit_v1());
149 auto digiHit = up_digiHit.get();
166 digiHit->
set_truth_x(std::numeric_limits<float>::max());
167 digiHit->
set_truth_y(std::numeric_limits<float>::max());
168 digiHit->
set_truth_z(std::numeric_limits<float>::max());
181 std::cout <<
"Leaving SRawEventEmbed::process_event: " << _event << std::endl;
189 std::cout <<
"SRawEventEmbed::End" << std::endl;
200 _tout =
new TTree(
"T",
"SRawEventEmbed");
211 if(_hit_container_type.find(
"Map") != std::string::npos) {
212 _hit_map = findNode::getClass<SQHitMap>(topNode,
"SQHitMap");
219 if(_hit_container_type.find(
"Vector") != std::string::npos) {
220 _hit_vector = findNode::getClass<SQHitVector>(topNode,
"SQHitVector");
int End(PHCompositeNode *topNode)
Called at the end of all processing.
virtual void set_element_id(const short id)
Int_t getTriggerBits()
Set/get the trigger types.
virtual short get_element_id() const
Return the element ID of this hit.
int InitRun(PHCompositeNode *topNode)
std::vector< Hit > & getAllHits()
int Init(PHCompositeNode *topNode)
virtual void set_detector_id(const short a)
virtual void set_hit_id(const int a)
virtual void set_g4hit_id(const PHG4HitDefs::keytype a)
static PHTFileServer & get(void)
return reference to class singleton
Definition of hit structure.
virtual void set_truth_x(const float a)
virtual short get_detector_id() const
Return the detector ID of this hit.
virtual void set_truth_y(const float a)
virtual int Verbosity() const
Gets the verbosity of this module.
virtual void push_back(const SQHit *hit)
Output a lot of messages.
virtual void set_pos(const float a)
virtual void set_drift_distance(const float a)
bool cd(const std::string &filename)
change to directory of TFile matching filename
Output some useful messages during manual command line running.
static GeomSvc * instance()
singlton instance
virtual size_t size() const
virtual void set_hodo_mask(const bool a)
virtual void set_truth_z(const float a)
int process_event(PHCompositeNode *topNode)
void getMeasurement(int detectorID, int elementID, double &measurement, double &dmeasurement)
Convert the detectorID and elementID to the actual hit position.
SRawEventEmbed(const std::string &name="SRawEventEmbed")
virtual void set_in_time(const bool a)
virtual void set_track_id(const int a)
void open(const std::string &filename, const std::string &type="RECREATE")
open a SafeTFile. If filename is not found in the map, create a new TFile and append to the map; incr...