LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
larg4::OpDetPhotonTable Class Reference

#include "OpDetPhotonTable.h"

Public Member Functions

 ~OpDetPhotonTable ()
 
void AddPhoton (size_t opchannel, sim::OnePhoton &&photon)
 
void AddPhoton (std::map< int, std::map< int, int >> *StepPhoton)
 
std::vector< sim::SimPhotons > & GetPhotons ()
 
sim::SimPhotonsGetPhotonsForOpChannel (size_t opchannel)
 
std::map< int, std::map< int, int > > GetLitePhotons ()
 
std::map< int, int > & GetLitePhotonsForOpChannel (int opchannel)
 
void ClearTable (size_t nch=0)
 
void AddOpDetBacktrackerRecord (sim::OpDetBacktrackerRecord soc)
 
std::vector< sim::OpDetBacktrackerRecordYieldOpDetBacktrackerRecords ()
 
void ClearEnergyDeposits ()
 
void AddEnergyDeposit (int n_elec, int n_photon, double energy, float start_x, float start_y, float start_z, float end_x, float end_y, float end_z, double start_time, double end_time, int trackid, int pdgcode, std::string vol="EMPTY")
 
std::unordered_map< std::string, std::vector< sim::SimEnergyDeposit > > & GetSimEnergyDeposits ()
 

Static Public Member Functions

static OpDetPhotonTableInstance (bool LitePhotons=false)
 

Protected Member Functions

 OpDetPhotonTable ()
 

Private Attributes

std::map< int, std::map< int, int > > fLitePhotons
 
std::vector< sim::OpDetBacktrackerRecordcOpDetBacktrackerRecordsCol
 
std::map< int, int > cOpChannelToSOCMap
 
std::vector< sim::SimPhotonsfDetectedPhotons
 
std::unordered_map< std::string, std::vector< sim::SimEnergyDeposit > > fSimEDepCol
 

Detailed Description

Definition at line 57 of file OpDetPhotonTable.h.

Constructor & Destructor Documentation

larg4::OpDetPhotonTable::~OpDetPhotonTable ( )

Definition at line 32 of file OpDetPhotonTable.cxx.

32 {}
larg4::OpDetPhotonTable::OpDetPhotonTable ( )
protected

Definition at line 28 of file OpDetPhotonTable.cxx.

References fDetectedPhotons.

Referenced by Instance().

29  {
30  fDetectedPhotons.clear();
31  }
std::vector< sim::SimPhotons > fDetectedPhotons

Member Function Documentation

void larg4::OpDetPhotonTable::AddEnergyDeposit ( int  n_elec,
int  n_photon,
double  energy,
float  start_x,
float  start_y,
float  start_z,
float  end_x,
float  end_y,
float  end_z,
double  start_time,
double  end_time,
int  trackid,
int  pdgcode,
std::string  vol = "EMPTY" 
)

Definition at line 154 of file OpDetPhotonTable.cxx.

References fSimEDepCol.

Referenced by larg4::OpFastScintillation::ProcessStep().

161  {
162  fSimEDepCol[vol].emplace_back(n_elec,n_photon,
163  energy,
164  sim::SimEnergyDeposit::Point_t{start_x,start_y,start_z},
165  sim::SimEnergyDeposit::Point_t{end_x,end_y,end_z},
166  start_time,end_time,
167  trackid,pdgcode);
168  }
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Length_t > > Point_t
double energy
Definition: plottest35.C:25
std::unordered_map< std::string, std::vector< sim::SimEnergyDeposit > > fSimEDepCol
void larg4::OpDetPhotonTable::AddOpDetBacktrackerRecord ( sim::OpDetBacktrackerRecord  soc)

Definition at line 73 of file OpDetPhotonTable.cxx.

References cOpChannelToSOCMap, cOpDetBacktrackerRecordsCol, sim::OpDetBacktrackerRecord::OpDetNum(), and sim::OpDetBacktrackerRecord::timePDclockSDPsMap().

Referenced by larg4::OpFastScintillation::RecordPhotonsProduced().

73  {
74  int iChan = soc.OpDetNum();
75  //std::map<int,int> cOpChannelToSOCMap;
76  std::map<int, int>::iterator channelPosition = cOpChannelToSOCMap.find(iChan);
77  if (channelPosition == cOpChannelToSOCMap.end() ){
79  cOpDetBacktrackerRecordsCol.emplace_back(std::move(soc));
80  }else{
81  unsigned int idtest = channelPosition->second;
82  auto const& timePDclockSDPsMap = soc.timePDclockSDPsMap();
83  for(auto const& timePDclockSDP : timePDclockSDPsMap){
84  for(auto const& sdp : timePDclockSDP.second){
85  double xyz[3] = {sdp.x, sdp.y, sdp.z};
86  cOpDetBacktrackerRecordsCol.at(idtest).AddScintillationPhotons(
87  sdp.trackID,
88  timePDclockSDP.first,
89  sdp.numPhotons,
90  xyz,
91  sdp.energy);
92  }//end sdp : timesdp.second
93  }//end const timesdp : timeSDPMap
94  }// if chanPos == cOpChan else
95 
96 
97 
98  }//END void OpDetPhotonTable::AdOpDetBacktrackerRecords
intermediate_table::iterator iterator
int OpDetNum() const
Returns the readout Optical Detector this object describes.
std::vector< sim::OpDetBacktrackerRecord > cOpDetBacktrackerRecordsCol
timePDclockSDPs_t const & timePDclockSDPsMap() const
Returns all the deposited energy information as stored.
std::map< int, int > cOpChannelToSOCMap
void larg4::OpDetPhotonTable::AddPhoton ( size_t  opchannel,
sim::OnePhoton &&  photon 
)

Definition at line 46 of file OpDetPhotonTable.cxx.

References fDetectedPhotons.

Referenced by larg4::OpDetSensitiveDetector::ProcessHits(), and larg4::OpFastScintillation::RecordPhotonsProduced().

47  {
48  if( opchannel >= fDetectedPhotons.size() ) {
49 
50  std::cerr << "<<" << __PRETTY_FUNCTION__ << ">>"
51  << "\033[93m"
52  << "Invalid channel: " << opchannel
53  << "\033[00m"
54  << std::endl;
55  throw std::exception();
56  }
57  fDetectedPhotons.at(opchannel).push_back(photon);
58  }
std::vector< sim::SimPhotons > fDetectedPhotons
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void larg4::OpDetPhotonTable::AddPhoton ( std::map< int, std::map< int, int >> *  StepPhoton)

Definition at line 60 of file OpDetPhotonTable.cxx.

References fLitePhotons.

61  {
62  for(auto it = StepPhotonTable->begin(); it!=StepPhotonTable->end(); it++)
63  {
64  for(auto in_it = it->second.begin(); in_it!=it->second.end(); in_it++)
65  {
66  fLitePhotons[it->first][in_it->first]+= in_it->second;
67  }
68  }
69  }
std::map< int, std::map< int, int > > fLitePhotons
void larg4::OpDetPhotonTable::ClearEnergyDeposits ( )

Definition at line 171 of file OpDetPhotonTable.cxx.

References fSimEDepCol.

Referenced by larg4::LArG4::produce().

172  { fSimEDepCol.clear(); }
std::unordered_map< std::string, std::vector< sim::SimEnergyDeposit > > fSimEDepCol
void larg4::OpDetPhotonTable::ClearTable ( size_t  nch = 0)

Definition at line 113 of file OpDetPhotonTable.cxx.

References fDetectedPhotons, and fLitePhotons.

Referenced by larg4::LArG4::produce().

114  {
115  if(fDetectedPhotons.size() != nch) fDetectedPhotons.resize(nch);
116  for(size_t i=0; i<fDetectedPhotons.size(); ++i) {
117  fDetectedPhotons.at(i).clear();
118  fDetectedPhotons.at(i).SetChannel(i);
119  //fDetectedPhotons.at(i).reserve(10000); // Just a guess on minimum # photons
120  }
121 
122  for(std::map<int,std::map<int, int>>::iterator it=fLitePhotons.begin(); it!=fLitePhotons.end(); ++it)
123  (it->second).clear();
124  fLitePhotons.clear();
125  }
std::map< int, std::map< int, int > > fLitePhotons
std::vector< sim::SimPhotons > fDetectedPhotons
std::map< int, std::map< int, int > > larg4::OpDetPhotonTable::GetLitePhotons ( )

Definition at line 128 of file OpDetPhotonTable.cxx.

References fLitePhotons.

Referenced by larg4::LArG4::produce().

129  {
130  return fLitePhotons;
131  }
std::map< int, std::map< int, int > > fLitePhotons
std::map< int, int > & larg4::OpDetPhotonTable::GetLitePhotonsForOpChannel ( int  opchannel)

Definition at line 147 of file OpDetPhotonTable.cxx.

References fLitePhotons.

148  {
149  return fLitePhotons[opchannel];
150  }
std::map< int, std::map< int, int > > fLitePhotons
std::vector< sim::SimPhotons > & larg4::OpDetPhotonTable::GetPhotons ( )

Definition at line 133 of file OpDetPhotonTable.cxx.

References fDetectedPhotons.

Referenced by larg4::LArG4::produce().

134  { return fDetectedPhotons; }
std::vector< sim::SimPhotons > fDetectedPhotons
sim::SimPhotons & larg4::OpDetPhotonTable::GetPhotonsForOpChannel ( size_t  opchannel)

Definition at line 137 of file OpDetPhotonTable.cxx.

References fDetectedPhotons.

138  {
139  if(opchannel >= fDetectedPhotons.size()) {
140  std::cerr << "<<" << __PRETTY_FUNCTION__ << ">>"
141  << "Invalid channel Number: " << opchannel
142  << std::endl;
143  }
144  return fDetectedPhotons.at(opchannel);
145  }
std::vector< sim::SimPhotons > fDetectedPhotons
std::unordered_map< std::string, std::vector< sim::SimEnergyDeposit > > & larg4::OpDetPhotonTable::GetSimEnergyDeposits ( )

Definition at line 176 of file OpDetPhotonTable.cxx.

References fSimEDepCol.

Referenced by larg4::LArG4::produce().

177  { return fSimEDepCol; }
std::unordered_map< std::string, std::vector< sim::SimEnergyDeposit > > fSimEDepCol
OpDetPhotonTable * larg4::OpDetPhotonTable::Instance ( bool  LitePhotons = false)
static
std::vector< sim::OpDetBacktrackerRecord > larg4::OpDetPhotonTable::YieldOpDetBacktrackerRecords ( )

Definition at line 101 of file OpDetPhotonTable.cxx.

References cOpChannelToSOCMap, and cOpDetBacktrackerRecordsCol.

Referenced by larg4::LArG4::produce().

101  {
102  // we give the result to the caller, and don't retain it
103  std::vector<sim::OpDetBacktrackerRecord> result;
105  cOpChannelToSOCMap.clear();
106  return result;
107  } // OpDetPhotonTable::YieldOpDetBacktrackerRecords()
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
std::vector< sim::OpDetBacktrackerRecord > cOpDetBacktrackerRecordsCol
std::map< int, int > cOpChannelToSOCMap

Member Data Documentation

std::map<int, int> larg4::OpDetPhotonTable::cOpChannelToSOCMap
private

Definition at line 95 of file OpDetPhotonTable.h.

Referenced by AddOpDetBacktrackerRecord(), and YieldOpDetBacktrackerRecords().

std::vector< sim::OpDetBacktrackerRecord > larg4::OpDetPhotonTable::cOpDetBacktrackerRecordsCol
private

Definition at line 94 of file OpDetPhotonTable.h.

Referenced by AddOpDetBacktrackerRecord(), and YieldOpDetBacktrackerRecords().

std::vector<sim::SimPhotons> larg4::OpDetPhotonTable::fDetectedPhotons
private
std::map<int, std::map<int,int> > larg4::OpDetPhotonTable::fLitePhotons
private
std::unordered_map<std::string, std::vector<sim::SimEnergyDeposit> > larg4::OpDetPhotonTable::fSimEDepCol
private

Definition at line 99 of file OpDetPhotonTable.h.

Referenced by AddEnergyDeposit(), ClearEnergyDeposits(), and GetSimEnergyDeposits().


The documentation for this class was generated from the following files: