20 , m_start_time(0.0*units::
ns)
21 , m_readout_time(5.0*units::
ms)
22 , m_tick(0.5*units::
us)
23 , m_pitch_range(20*3*units::
mm)
24 , m_drift_speed(1.0*units::mm/units::us)
30 , m_truth_type("Bare")
31 , m_num_ind_wire(2400.0)
32 , m_num_col_wire(3456.0)
33 , m_ind_sigma(1./std::sqrt(3.1415926)*1.4)
34 , m_col_sigma(1./std::sqrt(3.1415926)*3.0)
38 , m_max_wire_freq(1.0)
39 , m_max_time_freq(1.0*units::megahertz)
77 cerr <<
"Gen::Truth: failed to get anode: \"" <<
m_anode_tn <<
"\"\n";
86 m_rng = Factory::find_tn<IRandom>(
m_rng_tn);
117 auto indTruth = hf_ind.
generate(indBins);
121 auto colTruth = hf_col.
generate(colBins);
125 for(
auto face :
m_anode->faces()){
126 for(
auto plane : face->planes()){
137 auto timeTruth = hf_time.generate(timeBins);
143 bindiff.
add(depo, depo->extent_long() /
m_drift_speed, depo->extent_tran());
145 auto& wires = plane->wires();
147 for(
int iwire=0; iwire<numwires; iwire++){
150 const double wire_pos = rbins.
center(iwire);
152 const int min_impact = ibins.edge_index(wire_pos - 0.5*
m_pitch_range);
153 const int max_impact = ibins.edge_index(wire_pos + 0.5*
m_pitch_range);
154 const int nsamples = tbins.
nbins();
157 for(
int imp = min_impact; imp<=max_impact; imp++){
164 std::cout<<
"Truth: charge spectrum extracted." << imp <<
std::endl;
168 if(charge_spectrum.empty()){
175 if(charge_spectrum.empty()){
180 for(
int ind=0; ind<nsamples; ind++){
181 if(wires[iwire]->
channel()<4800){
182 conv_spectrum[ind] = charge_gain*charge_spectrum[ind]*timeTruth[ind]*indTruth[iwire];
185 conv_spectrum[ind] = charge_gain*charge_spectrum[ind]*timeTruth[ind]*colTruth[iwire];
191 bindiff.
erase(0,min_impact);
196 if(
mm.first == (
int)wave.size()){
201 int chid = wires[iwire]->channel();
203 wave.begin()+
mm.second);
204 auto trace = make_shared<SimpleTrace>(chid,
mm.first, charge);
205 traces.push_back(trace);
213 frames.push_back(frame);
231 if(!depo || depo->time() > target_time){
void process(output_queue &frame)
double center(int ind) const
bool add(IDepo::pointer deposition, double sigma_time, double sigma_pitch)
const Binning & region_binning() const
void put(Configuration &cfg, const std::string &dotpath, const T &val)
Put value in configuration at the dotted path.
std::vector< pointer > vector
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
void erase(int begin_impact_index, int end_impact_index)
std::deque< output_pointer > output_queue
Binning tbins(nticks, t0, t0+readout_time)
const Binning & impact_binning() const
WireCell::Waveform::realseq_t generate(const WireCell::Waveform::Domain &domain, int nsamples)
FIXME: eradicate Domain in favor of Binning.
megahertz_as<> megahertz
Type of frequency stored in megahertz, in double precision.
ImpactData::pointer impact_data(int bin) const
virtual bool operator()(const input_pointer &depo, output_queue &frames)
The calling signature:
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)
Json::Value Configuration
std::shared_ptr< const IDepo > input_pointer
WIRECELL_FACTORY(TruthTraceID, WireCell::Gen::TruthTraceID, WireCell::IDuctor, WireCell::IConfigurable) using namespace std
IAnodePlane::pointer m_anode
std::vector< float > ChargeSequence
Sequential collection of charge.
QTextStream & endl(QTextStream &s)