Public Member Functions | Private Member Functions | Private Attributes | List of all members
detsim::SimWireDUNE35t Class Reference
Inheritance diagram for detsim::SimWireDUNE35t:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 SimWireDUNE35t (fhicl::ParameterSet const &pset)
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
void reconfigure (fhicl::ParameterSet const &p)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void GenNoise (std::vector< float > &array)
 
GapType_t combtest35t (double x, double y, double z)
 
int GapHasDeflector (double x, double y, double z)
 

Private Attributes

std::string fDriftEModuleLabel
 module making the ionization electrons More...
 
raw::Compress_t fCompression
 compression type to use More...
 
unsigned int fNoiseOn
 noise turned on or off for debugging; default is on More...
 
unsigned int fNoiseModel
 noise model> More...
 
float fNoiseFact
 noise scale factor More...
 
float fNoiseWidth
 exponential noise width (kHz) More...
 
float fLowCutoff
 low frequency filter cutoff (kHz) More...
 
float fNoiseFactZ
 noise scale factor for Z (collection) plane More...
 
float fNoiseWidthZ
 exponential noise width (kHz) for Z (collection) plane More...
 
float fLowCutoffZ
 low frequency filter cutoff (kHz) for Z (collection) plane More...
 
float fNoiseFactU
 noise scale factor for U plane More...
 
float fNoiseWidthU
 exponential noise width (kHz) for U plane More...
 
float fLowCutoffU
 low frequency filter cutoff (kHz) for U plane More...
 
float fNoiseFactV
 noise scale factor for V plane More...
 
float fNoiseWidthV
 exponential noise width (kHz) for V plane More...
 
float fLowCutoffV
 low frequency filter cutoff (kHz) for V plane More...
 
unsigned int fZeroThreshold
 Zero suppression threshold. More...
 
int fNearestNeighbor
 Maximum distance between hits above threshold before they are separated into different blocks. More...
 
unsigned int fNeighboringChannels
 Number of neighboring channels on either side allowed to influence zero suppression. More...
 
int fNTicks
 number of ticks of the clock More...
 
double fSampleRate
 sampling rate in ns More...
 
unsigned int fNSamplesReadout
 number of ADC readout samples in 1 readout frame More...
 
unsigned int fNTimeSamples
 number of ADC readout samples in all readout frames (per event) More...
 
unsigned int fNoiseArrayPoints
 number of points in randomly generated noise array More...
 
std::vector< double > fChargeWork
 
std::vector< std::vector< float > > fNoiseZ
 noise on each channel for each time for Z (collection) plane More...
 
std::vector< std::vector< float > > fNoiseU
 noise on each channel for each time for U plane More...
 
std::vector< std::vector< float > > fNoiseV
 noise on each channel for each time for V plane More...
 
TH1D * fNoiseDist
 distribution of noise counts More...
 
uint32_t fFirstCollectionChannel
 
std::vector< uint32_t > fFirstChannelsInPlane
 
std::vector< uint32_t > fLastChannelsInPlane
 
const float adcsaturation = 4095
 
float fCollectionPed
 ADC value of baseline for collection plane. More...
 
float fCollectionPedRMS
 ADC value of baseline RMS for collection plane. More...
 
float fInductionPed
 ADC value of baseline for induction plane. More...
 
float fInductionPedRMS
 ADC value of baseline RMS for induction plane. More...
 
float fCollectionCalibPed
 Assumed measured value for coll plane pedestal. More...
 
float fCollectionCalibPedRMS
 Assumed measured value for coll plane pedestal RMS. More...
 
float fInductionCalibPed
 Assumed measured value for ind plane pedestal. More...
 
float fInductionCalibPedRMS
 Assumed measured value for ind plane pedestal RMS. More...
 
bool fPedestalOn
 switch for simulation of nonzero pedestals More...
 
bool fSimCombs
 switch for simulation of the combs More...
 
bool fSimStuckBits
 switch for simulation of stuck bits More...
 
std::string fStuckBitsProbabilitiesFname
 file holding ADC stuck code overflow and underflow probabilities More...
 
std::string fStuckBitsOverflowProbHistoName
 Name of histogram holding ADC stuck code overflow probabilities. More...
 
std::string fStuckBitsUnderflowProbHistoName
 Name of histogram holding ADC stuck code underflow probabilities. More...
 
bool fSaveEmptyChannel
 
std::vector< float > fFractUUCollect
 
std::vector< float > fFractUVCollect
 
std::vector< float > fFractVUCollect
 
std::vector< float > fFractVVCollect
 
std::vector< float > fFractUUMiss
 
std::vector< float > fFractUVMiss
 
std::vector< float > fFractVUMiss
 
std::vector< float > fFractVVMiss
 
std::vector< float > fFractZUMiss
 
std::vector< float > fFractZVMiss
 
std::vector< float > fFractHorizGapUMiss
 
std::vector< float > fFractVertGapUMiss
 
std::vector< float > fFractHorizGapVMiss
 
std::vector< float > fFractVertGapVMiss
 
std::vector< float > fFractHorizGapZMiss
 
std::vector< float > fFractVertGapZMiss
 
std::vector< float > fFractHorizGapUCollect
 
std::vector< float > fFractVertGapUCollect
 
std::vector< float > fFractHorizGapVCollect
 
std::vector< float > fFractVertGapVCollect
 
double zcomb1
 
double zcomb2
 
double zcomb3
 
double zcomb4
 
double zcomb5
 
double zcomb6
 
double zcomb7
 
double zcomb8
 
double zcomb9
 
double zcomb10
 
double zcomb11
 
double zcomb12
 
double zcomb13
 
double zcomb14
 
double zcomb15
 
double zcomb16
 
double zcomb17
 
double zcomb18
 
double ycomb1
 
double ycomb2
 
double ycomb3
 
double ycomb4
 
double ycomb5
 
double ycomb6
 
double ycomb7
 
double ycomb8
 
double ycomb9
 
double ycomb10
 
double ycomb11
 
double ycomb12
 
double ycomb13
 
double ycomb14
 
double ycomb15
 
double ycomb16
 
double ycomb17
 
double ycomb18
 
double fOverflowProbs [64]
 array of probabilities of 6 LSF bits getting stuck at 000000 More...
 
double fUnderflowProbs [64]
 array of probabilities of 6 LSF bits getting stuck at 111111 More...
 
CLHEP::HepRandomEngine & fEngine
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 69 of file SimWireDUNE35t_module.cc.

Constructor & Destructor Documentation

detsim::SimWireDUNE35t::SimWireDUNE35t ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 191 of file SimWireDUNE35t_module.cc.

192  : EDProducer{pset}
193  // create a default random engine; obtain the random seed from NuRandomService,
194  // unless overridden in configuration with key "Seed"
196  {
197 
198  this->reconfigure(pset);
199 
200  produces< std::vector<raw::RawDigit> >();
201 
203  TString compression(pset.get< std::string >("CompressionType"));
204  if(compression.Contains("Huffman",TString::kIgnoreCase)) fCompression = raw::kHuffman;
205  if(compression.Contains("ZeroSuppression",TString::kIgnoreCase)) fCompression = raw::kZeroSuppression;
206 
207  }
base_engine_t & createEngine(seed_t seed)
Huffman Encoding.
Definition: RawTypes.h:10
void reconfigure(fhicl::ParameterSet const &p)
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
no compression
Definition: RawTypes.h:9
Zero Suppression algorithm.
Definition: RawTypes.h:11
raw::Compress_t fCompression
compression type to use
CLHEP::HepRandomEngine & fEngine

Member Function Documentation

void detsim::SimWireDUNE35t::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 278 of file SimWireDUNE35t_module.cc.

279  {
280 
281  // get access to the TFile service
283 
284  fNoiseDist = tfs->make<TH1D>("Noise", ";Noise (ADC);", 1000, -10., 10.);
285 
286 
288  fNTicks = fFFT->FFTSize();
289 
290  if ( fNTicks%2 != 0 )
291  MF_LOG_DEBUG("SimWireDUNE35t") << "Warning: FFTSize not a power of 2. "
292  << "May cause issues in (de)convolution.\n";
293 
294  if ( (int)fNSamplesReadout > fNTicks )
295  mf::LogError("SimWireDUNE35t") << "Cannot have number of readout samples "
296  << "greater than FFTSize!";
297 
298  fChargeWork.resize(fNTicks, 0.);
300 
301  bool foundfirstcollectionchannel = false;
302  fFirstChannelsInPlane.push_back(0);
303  unsigned int currentPlaneNumber = geo->ChannelToWire(0).at(0).Plane; // ID of current wire plane
304  unsigned int currentTPCNumber = geo->ChannelToWire(0).at(0).TPC; // ID of current wire plane
305 
306  for (uint32_t ichan=0;ichan<geo->Nchannels();ichan++)
307  {
308 
309  if(!foundfirstcollectionchannel)
310  {
311  const geo::View_t view = geo->View(ichan);
312  if (view == geo::kZ)
313  {
314  foundfirstcollectionchannel = true;
315  fFirstCollectionChannel = ichan;
316  //break;
317  }
318  }
319 
320  const unsigned int thisPlaneNumber = geo->ChannelToWire(ichan).at(0).Plane;
321  const unsigned int thisTPCNumber = geo->ChannelToWire(ichan).at(0).TPC;
322 
323  if(thisPlaneNumber != currentPlaneNumber || (thisPlaneNumber == geo::kZ && thisTPCNumber != currentTPCNumber))
324  {
325  fLastChannelsInPlane.push_back(ichan-1);
326  fFirstChannelsInPlane.push_back(ichan);
327  currentPlaneNumber = thisPlaneNumber;
328  currentTPCNumber = thisTPCNumber;
329  }
330 
331  }
332  if (!foundfirstcollectionchannel)
333  {
334  throw cet::exception("SimWireDUNE35t BeginJob") << " Could not find any collection channels\n";
335  }
336 
337  fLastChannelsInPlane.push_back(geo->Nchannels()-1);
338 
339 
340  // //Check starting and ending channels for each wire plane
341  // for(size_t ip = 0; ip < fFirstChannelsInPlane.size(); ++ip){
342  // std::cout << "First channel in plane " << ip << " is " << fFirstChannelsInPlane.at(ip) << std::endl;
343  // }
344 
345  // for(size_t ip = 0; ip < fLastChannelsInPlane.size(); ++ip){
346  // std::cout << "Last channel in plane " << ip << " is " << fLastChannelsInPlane.at(ip) << std::endl;
347  // }
348 
349  //Generate noise if selected to be on
350  if(fNoiseOn && fNoiseModel==1){
351 
352  //fNoise.resize(geo->Nchannels());
353  fNoiseZ.resize(fNoiseArrayPoints);
354  fNoiseU.resize(fNoiseArrayPoints);
355  fNoiseV.resize(fNoiseArrayPoints);
356 
357  // GenNoise() will further resize each channel's
358  // fNoise vector to fNoiseArrayPoints long.
359 
360  for(unsigned int p = 0; p < fNoiseArrayPoints; ++p){
361 
365 
366  GenNoise(fNoiseZ[p]);
367  for(int i = 0; i < fNTicks; ++i)
368  fNoiseDist->Fill(fNoiseZ[p][i]);
369 
373 
374  GenNoise(fNoiseU[p]);
375  for(int i = 0; i < fNTicks; ++i)
376  fNoiseDist->Fill(fNoiseU[p][i]);
377 
378 
382 
383 
384  GenNoise(fNoiseV[p]);
385  for(int i = 0; i < fNTicks; ++i)
386  fNoiseDist->Fill(fNoiseV[p][i]);
387 
388  }// end loop over wires
389  }
390 
391  // initialize the comb test positions. This is clumsy here mainly due to the irregular geometry
392  // should write something more systematic for the FD. There is also some duplication as the
393  // vertical positions of APA's 0 and 3 are assumed to be the same. Could think about either adding
394  // an exception if they're not, or defining more y positions to hold different APA positions if we want
395  // them to be different at a later time. Simulation may always be perfect though.
396 
397  // WireEndPoints takes cryostat, tpc, plane, wire, as ints and returns endpoints
398  //geo->WireEndPoints(c,t,p,w,xyzbeg,xyzend);
399 
400  // wire endpoints are at the places where the wire hits the comb that supports it. Bits of
401  // wire running over the comb are beyond the endpoints. So we need to extrapolate.
402 
403  double xyzbeg[3],xyzend[3];
404  int lastwire = 0;
405 
406  // Numbers in comments are from Geometry V3 for debugging purposes.
407 
408  // APA 0
409 
410  geo->WireEndPoints(0,0,0,0,xyzbeg,xyzend); // first U wire in TPC 0.
411  zcomb2 = xyzbeg[2]; // 0.0
412  ycomb5 = xyzend[1]; // 113.142
413 
414  lastwire = geo->Nwires(0,0,0)-1; // 358 in v3
415  geo->WireEndPoints(0,0,0,lastwire,xyzbeg,xyzend); // last U wire in TPC 0.
416  zcomb5 = xyzend[2]; // 50.8929
417  ycomb2 = xyzbeg[1]; // -82.9389
418 
419  geo->WireEndPoints(0,0,1,0,xyzbeg,xyzend); // first V wire in TPC 0.
420  zcomb4 = xyzend[2]; // 50.5774
421  ycomb4 = xyzbeg[1]; // 113.142
422 
423  lastwire = geo->Nwires(1,0,0)-1; // 344 in v3
424  geo->WireEndPoints(0,0,1,lastwire,xyzbeg,xyzend); // last V wire in TPC 0.
425  zcomb3 = xyzbeg[2]; // 0.3155
426  ycomb3 = xyzend[1]; // -82.6234
427 
428  // the collection wires appear to end where they meet their comb.
429  //geo->WireEndPoints(0,0,2,0,xyzbeg,xyzend); // first collection wire in TPC 0
430  //ycomb3 = xyzbeg[2]; // -82.308
431  //ycomb4 = xyzend[2]; // 113.142
432 
433  // need to get zcomb1, zcomb6, ycomb1, and ycomb6 -- extrapolate
434 
435  zcomb1 = zcomb2 - (zcomb3 - zcomb2);
436  zcomb6 = zcomb5 + (zcomb5 - zcomb4);
437  ycomb1 = ycomb2 - (ycomb3 - ycomb2);
438  ycomb6 = ycomb5 + (ycomb5 - ycomb4);
439 
440 
441  // APA 1
442 
443  geo->WireEndPoints(0,2,0,0,xyzbeg,xyzend); // first U wire in TPC 2.
444  zcomb11 = xyzend[2]; // 102.817
445  ycomb8 = xyzbeg[1]; // -85.221
446 
447  lastwire = geo->Nwires(0,2,0)-1; // 194 in v3
448  geo->WireEndPoints(0,2,0,lastwire,xyzbeg,xyzend); // last U wire in TPC 2.
449  zcomb8 = xyzbeg[2]; // 51.924
450  ycomb11 = xyzend[1]; // -0.831
451 
452  geo->WireEndPoints(0,2,1,0,xyzbeg,xyzend); // first V wire in TPC 2.
453  zcomb9 = xyzbeg[2]; // 52.2395
454  ycomb9 = xyzend[1]; // -85.222
455 
456  lastwire = geo->Nwires(1,2,0)-1; // 188 in v3
457  geo->WireEndPoints(0,2,1,lastwire,xyzbeg,xyzend); // last V wire in TPC 2.
458  zcomb10 = xyzend[2]; // 102.501
459  ycomb10 = xyzbeg[1]; // -1.14655
460 
461  //geo->WireEndPoints(0,2,2,0,xyzbeg,xyzend); // first collection wire in TPC 2
462  //ycombx = xyzbeg[2]; // -85.222 edges of the combs
463  //ycombx = xyzend[2]; // -1.46205
464 
465  // need to get zcomb7, zcomb12, ycomb7, and ycomb12 -- extrapolate
466 
467  zcomb7 = zcomb8 - (zcomb9 - zcomb8);
468  zcomb12 = zcomb11 + (zcomb11 - zcomb10);
469  ycomb7 = ycomb8 - (ycomb9 - ycomb8);
470  ycomb12 = ycomb11 + (ycomb11 - ycomb10);
471 
472  // APA 2
473 
474  geo->WireEndPoints(0,4,0,0,xyzbeg,xyzend); // first U wire in TPC 4.
475  zcomb8 = xyzbeg[2]; // 51.924 -- same as above
476  ycomb17 = xyzend[1]; // 113.142 -- same as above
477 
478  lastwire = geo->Nwires(0,4,0)-1; // 235 in v3
479  geo->WireEndPoints(0,4,0,lastwire,xyzbeg,xyzend); // last U wire in TPC 4.
480  zcomb11 = xyzend[2]; // 102.817 -- same as above
481  ycomb14 = xyzbeg[1]; // 0.83105
482 
483  geo->WireEndPoints(0,4,1,0,xyzbeg,xyzend); // first V wire in TPC 4.
484  zcomb10 = xyzend[2]; // 102.501 -- same as above
485  ycomb16 = xyzbeg[1]; // 113.142 -- everything ends here in y
486 
487  lastwire = geo->Nwires(1,4,0)-1; // 227 in v3
488  geo->WireEndPoints(0,4,1,lastwire,xyzbeg,xyzend); // last V wire in TPC 4.
489  zcomb9 = xyzbeg[2]; // 52.2395 -- same as above
490  ycomb15 = xyzend[1]; // 1.14655
491 
492  //geo->WireEndPoints(0,4,2,0,xyzbeg,xyzend); // first collection wire in TPC 1
493  //ycombx = xyzbeg[2]; // 52.2234 edges of the combs -- not what we want
494  //ycombx = xyzend[2]; // 113.142 for this
495 
496  // need to get zcomb7, zcomb12, ycomb13, and ycomb18 -- extrapolate
497  // the z's are just recalculations of the numbers above
498 
499  zcomb7 = zcomb8 - (zcomb9 - zcomb8);
500  zcomb12 = zcomb11 + (zcomb11 - zcomb10);
501  ycomb13 = ycomb14 - (ycomb15 - ycomb14);
502  ycomb18 = ycomb17 + (ycomb17 - ycomb16);
503 
504  // APA 3 -- a lot like APA 0
505 
506  geo->WireEndPoints(0,6,0,0,xyzbeg,xyzend); // first U wire in TPC 6.
507  zcomb14 = xyzbeg[2]; // 103.84
508  ycomb5 = xyzend[1]; // 113.142 -- same as above
509 
510  lastwire = geo->Nwires(0,6,0)-1; // 358 in v3
511  geo->WireEndPoints(0,6,0,lastwire,xyzbeg,xyzend); // last U wire in TPC 6.
512  zcomb17 = xyzend[2]; // 154.741
513  ycomb2 = xyzbeg[1]; // -82.9389 -- same as above
514 
515  geo->WireEndPoints(0,6,1,0,xyzbeg,xyzend); // first V wire in TPC 6.
516  zcomb16 = xyzend[2]; // 154.425
517  ycomb4 = xyzbeg[1]; // 113.142 -- same as above
518 
519  lastwire = geo->Nwires(1,6,0)-1; // 344 in v3
520  geo->WireEndPoints(0,6,1,lastwire,xyzbeg,xyzend); // last V wire in TPC 6.
521  zcomb15 = xyzbeg[2]; // 104.164
522  ycomb3 = xyzend[1]; // -82.6234 -- same as above
523 
524  // the collection wires appear to end where they meet their comb.
525  //geo->WireEndPoints(0,6,2,0,xyzbeg,xyzend); // first collection wire in TPC 0
526  //ycomb3 = xyzbeg[2]; // -82.308
527  //ycomb4 = xyzend[2]; // 113.142
528 
529  // need to get zcomb13, zcomb18, ycomb1, and ycomb6 -- extrapolate
530  // the ycomb1 and ycomb6 are just copies.
531 
532  zcomb13 = zcomb14 - (zcomb15 - zcomb14);
533  zcomb18 = zcomb17 + (zcomb17 - zcomb16);
534  ycomb1 = ycomb2 - (ycomb3 - ycomb2);
535  ycomb6 = ycomb5 + (ycomb5 - ycomb4);
536 
537  if(fSimStuckBits){
538 
539  mf::LogInfo("SimWireDUNE35t") << " using ADC stuck code probabilities from .root file " ;
540 
541  // constructor decides if initialized value is a path or an environment variable
543  cet::search_path sp("FW_SEARCH_PATH");
544  sp.find_file( fStuckBitsProbabilitiesFname, fname );
545 
546  std::unique_ptr<TFile> fin(new TFile(fname.c_str(), "READ"));
547  if ( !fin->IsOpen() ) throw art::Exception( art::errors::NotFound ) << "Could not find the ADC stuck code probabilities file " << fname << "!" << std::endl;
548 
549  TString iOverflowHistoName = Form( "%s", fStuckBitsOverflowProbHistoName.c_str());
550  TProfile *overflowtemp = (TProfile*) fin->Get( iOverflowHistoName );
551  if ( !overflowtemp ) throw art::Exception( art::errors::NotFound ) << "Could not find the ADC code overflow probabilities histogram " << fStuckBitsOverflowProbHistoName << "!" << std::endl;
552 
553  if ( overflowtemp->GetNbinsX() != 64 ) throw art::Exception( art::errors::InvalidNumber ) << "Overflow ADC stuck code probability histograms should always have 64 bins corresponding to each of 64 LSB cells!" << std::endl;
554 
555  TString iUnderflowHistoName = Form( "%s", fStuckBitsUnderflowProbHistoName.c_str());
556  TProfile *underflowtemp = (TProfile*) fin->Get( iUnderflowHistoName );
557  if ( !underflowtemp ) throw art::Exception( art::errors::NotFound ) << "Could not find the ADC code underflow probabilities histogram " << fStuckBitsUnderflowProbHistoName << "!" << std::endl;
558 
559  if ( underflowtemp->GetNbinsX() != 64 ) throw art::Exception( art::errors::InvalidNumber ) << "Underflow ADC stuck code probability histograms should always have 64 bins corresponding to each of 64 LSB cells!" << std::endl;
560 
561 
562  for(unsigned int cellnumber=0; cellnumber < 64; ++cellnumber){
563  fOverflowProbs[cellnumber] = overflowtemp->GetBinContent(cellnumber+1);
564  fUnderflowProbs[cellnumber] = underflowtemp->GetBinContent(cellnumber+1);
565  }
566 
567  fin->Close();
568  }
569  return;
570 
571  }
void GenNoise(std::vector< float > &array)
int fNTicks
number of ticks of the clock
std::vector< std::vector< float > > fNoiseU
noise on each channel for each time for U plane
float fNoiseWidthZ
exponential noise width (kHz) for Z (collection) plane
float fNoiseWidth
exponential noise width (kHz)
float fLowCutoffZ
low frequency filter cutoff (kHz) for Z (collection) plane
std::vector< uint32_t > fFirstChannelsInPlane
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
float fNoiseWidthU
exponential noise width (kHz) for U plane
TH1D * fNoiseDist
distribution of noise counts
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
Planes which measure Z direction.
Definition: geo_types.h:132
unsigned int fNoiseModel
noise model>
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int fNSamplesReadout
number of ADC readout samples in 1 readout frame
float fNoiseFact
noise scale factor
float fLowCutoffU
low frequency filter cutoff (kHz) for U plane
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
std::string fStuckBitsUnderflowProbHistoName
Name of histogram holding ADC stuck code underflow probabilities.
int FFTSize() const
Definition: LArFFT.h:69
float fNoiseFactU
noise scale factor for U plane
unsigned int fNoiseOn
noise turned on or off for debugging; default is on
double fUnderflowProbs[64]
array of probabilities of 6 LSF bits getting stuck at 111111
std::vector< double > fChargeWork
float fNoiseWidthV
exponential noise width (kHz) for V plane
float fNoiseFactZ
noise scale factor for Z (collection) plane
p
Definition: test.py:223
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< std::vector< float > > fNoiseZ
noise on each channel for each time for Z (collection) plane
std::string fStuckBitsProbabilitiesFname
file holding ADC stuck code overflow and underflow probabilities
#define MF_LOG_DEBUG(id)
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
bool fSimStuckBits
switch for simulation of stuck bits
double fOverflowProbs[64]
array of probabilities of 6 LSF bits getting stuck at 000000
std::vector< std::vector< float > > fNoiseV
noise on each channel for each time for V plane
float fLowCutoffV
low frequency filter cutoff (kHz) for V plane
std::vector< uint32_t > fLastChannelsInPlane
float fNoiseFactV
noise scale factor for V plane
LArSoft geometry interface.
Definition: ChannelGeo.h:16
float fLowCutoff
low frequency filter cutoff (kHz)
std::string fStuckBitsOverflowProbHistoName
Name of histogram holding ADC stuck code overflow probabilities.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
GapType_t detsim::SimWireDUNE35t::combtest35t ( double  x,
double  y,
double  z 
)
private

Definition at line 1276 of file SimWireDUNE35t_module.cc.

1277  {
1278 
1279  if (z<zcomb1) return VERTGAP; // off to the side of the first APA -- kind of like being in a vertical gap
1280  if (z<zcomb2) return UCOMB; // over U comb
1281  if (z<zcomb3) return VCOMB; // over V comb
1282  if (z<zcomb4)
1283  {
1284  if (y<ycomb1) return HORIZGAP; // below the bottom
1285  if (y<ycomb2) return UCOMB; // over U comb
1286  if (y<ycomb3) return VCOMB; // over V comb
1287  if (y<ycomb4) return ACTIVE; // active volume
1288  if (y<ycomb5) return VCOMB; // over V comb
1289  if (y<ycomb6) return UCOMB; // over U comb
1290  return HORIZGAP; // outside top edge
1291 
1292  }
1293  if (z<zcomb5) return VCOMB; // over V comb
1294  if (z<zcomb6) return UCOMB; // over U comb
1295 
1296  if (z<zcomb7) return VERTGAP; // in gap
1297  if (z<zcomb8) return UCOMB; // over U comb
1298  if (z<zcomb9) return VCOMB; // over V comb
1299  if (z<zcomb10)
1300  {
1301  if (y<ycomb7) return HORIZGAP; // off the bottom
1302  if (y<ycomb8) return UCOMB; // over U comb
1303  if (y<ycomb9) return VCOMB; // over V comb
1304  if (y<ycomb10) return ACTIVE; // active
1305  if (y<ycomb11) return VCOMB; // over V comb
1306  if (y<ycomb12) return UCOMB; // over U comb
1307  if (y<ycomb13) return HORIZGAP; // over gap
1308  if (y<ycomb14) return UCOMB; // over U comb
1309  if (y<ycomb15) return VCOMB; // over V comb
1310  if (y<ycomb16) return ACTIVE; // active volume
1311  if (y<ycomb17) return VCOMB; // over V comb
1312  if (y<ycomb18) return UCOMB; // over U comb
1313  return HORIZGAP; // above the top edge
1314  }
1315  if (z<zcomb11) return VCOMB; // over V comb
1316  if (z<zcomb12) return UCOMB; // over U comb
1317 
1318  if (z<zcomb13) return VERTGAP; // outside first APA
1319  if (z<zcomb14) return UCOMB; // over U comb
1320  if (z<zcomb15) return VCOMB; // over V comb
1321  if (z<zcomb16)
1322  {
1323  if (y<ycomb1) return HORIZGAP; // below the bottom
1324  if (y<ycomb2) return UCOMB; // over U comb
1325  if (y<ycomb3) return VCOMB; // over V comb
1326  if (y<ycomb4) return ACTIVE; // active volume
1327  if (y<ycomb5) return VCOMB; // over V comb
1328  if (y<ycomb6) return UCOMB; // over U comb
1329  return HORIZGAP; // outside top edge
1330  }
1331  if (z<zcomb17) return VCOMB; // over V comb
1332  if (z<zcomb18) return UCOMB; // over U comb
1333  return VERTGAP; // off the end in Z.
1334 
1335  }
void detsim::SimWireDUNE35t::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 574 of file SimWireDUNE35t_module.cc.

575  {
576  }
int detsim::SimWireDUNE35t::GapHasDeflector ( double  x,
double  y,
double  z 
)
private

Definition at line 1337 of file SimWireDUNE35t_module.cc.

1338  {
1339  if ( y < ycomb12 && y > ycomb7 && x > 0 && z < zcomb9 && z > zcomb4 ) return 1;
1340  return 0;
1341  }
list x
Definition: train.py:276
void detsim::SimWireDUNE35t::GenNoise ( std::vector< float > &  array)
private

Definition at line 1222 of file SimWireDUNE35t_module.cc.

1223  {
1224  CLHEP::RandFlat flat(fEngine);
1225 
1226  noise.clear();
1227  noise.resize(fNTicks,0.0);
1228  // noise in frequency space
1229  std::vector<TComplex> noiseFrequency(fNTicks/2+1, 0.);
1230 
1231  double pval = 0.;
1232  double lofilter = 0.;
1233  double phase = 0.;
1234  double rnd[2] = {0.};
1235 
1236  // width of frequencyBin in kHz
1237  double binWidth = 1.0/(fNTicks*fSampleRate*1.0e-6);
1238  for(int i=0; i< fNTicks/2+1; ++i){
1239  // exponential noise spectrum
1240  pval = fNoiseFact*exp(-(double)i*binWidth/fNoiseWidth);
1241  // low frequency cutoff
1242  lofilter = 1.0/(1.0+exp(-(i-fLowCutoff/binWidth)/0.5));
1243  // randomize 10%
1244  flat.fireArray(2,rnd,0,1);
1245  pval *= lofilter*(0.9+0.2*rnd[0]);
1246  // random pahse angle
1247  phase = rnd[1]*2.*TMath::Pi();
1248 
1249  TComplex tc(pval*cos(phase),pval*sin(phase));
1250  noiseFrequency[i] += tc;
1251  }
1252 
1253 
1254  // inverse FFT MCSignal
1256  fFFT->DoInvFFT(noiseFrequency, noise);
1257 
1258  noiseFrequency.clear();
1259 
1260  // multiply each noise value by fNTicks as the InvFFT
1261  // divides each bin by fNTicks assuming that a forward FFT
1262  // has already been done.
1263  for(unsigned int i = 0; i < noise.size(); ++i) noise[i] *= 1.*fNTicks;
1264 
1265  return;
1266  }
int fNTicks
number of ticks of the clock
float fNoiseWidth
exponential noise width (kHz)
float fNoiseFact
noise scale factor
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
Definition: LArFFT.h:120
pval
Definition: tracks.py:168
CLHEP::HepRandomEngine & fEngine
double fSampleRate
sampling rate in ns
float fLowCutoff
low frequency filter cutoff (kHz)
void detsim::SimWireDUNE35t::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 579 of file SimWireDUNE35t_module.cc.

580  {
581  // get the geometry to be able to figure out signal types and chan -> plane mappings
583  unsigned int signalSize = fNTicks;
584 
585  // vectors for working
586  std::vector<short> adcvec(signalSize, 0);
587  std::vector<const sim::SimChannel*> chanHandle;
588  evt.getView(fDriftEModuleLabel,chanHandle);
589 
590  //Get fIndShape and fColShape from SignalShapingService, on the fly
592 
593  // make a vector of const sim::SimChannel* that has same number
594  // of entries as the number of channels in the detector
595  // and set the entries for the channels that have signal on them
596  // using the chanHandle
597  std::vector<const sim::SimChannel*> channels(geo->Nchannels());
598  for(size_t c = 0; c < chanHandle.size(); ++c){
599  channels[chanHandle[c]->Channel()] = chanHandle[c];
600  }
601 
602  // make an unique_ptr of sim::SimDigits that allows ownership of the produced
603  // digits to be transferred to the art::Event after the put statement below
604  std::unique_ptr< std::vector<raw::RawDigit> > digcol(new std::vector<raw::RawDigit>);
605 
606  unsigned int chan = 0;
607  fChargeWork.clear();
608  fChargeWork.resize(fNTicks, 0.);
609 
610 
611  std::vector<double> fChargeWorkCollInd;
612 
614 
615  // Add all channels
616  CLHEP::RandFlat flat(fEngine);
617 
619 
620 
621  // make ring buffer to hold neighboring channels in order to enable nearest neighbor-influenced zero suppression
622 
623  boost::circular_buffer<std::vector<short>> adcvec_neighbors(fNeighboringChannels*2+1);
624 
625  // make vector of adc vectors to hold first channels in induction plane in order to wrap around to the start for nearest neighbor-influenced zero suppression
626 
627  std::vector<std::vector<short>> adcvec_inductionplanestart;
628 
629  unsigned int plane_number = 0;
630 
631  int dflag = 0;
632 
633  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
634 
635  for(chan = 0; chan < geo->Nchannels(); chan++) {
636 
637 
638  fChargeWork.clear();
639  // fChargeWork.resize(fNTicks, 0.);
640  fChargeWork.resize(fNTimeSamples, 0.);
641  if (fSimCombs)
642  {
643  fChargeWorkCollInd.clear();
644  fChargeWorkCollInd.resize(fNTimeSamples, 0.);
645  }
646 
647  // get the sim::SimChannel for this channel
648  const sim::SimChannel* sc = channels[chan];
649  const geo::View_t view = geo->View(chan);
650 
651 
652  if( sc ){
653  // loop over the tdcs and grab the number of electrons for each
654  for(size_t t = 0; t < fChargeWork.size(); ++t)
655  if (fSimCombs)
656  {
657  const std::vector<sim::IDE> ides = sc->TrackIDsAndEnergies(t,t);
658  for (auto const &ide : ides)
659  {
660  GapType_t gaptype = combtest35t(ide.x,ide.y,ide.z);
661  switch (gaptype)
662  {
663  case ACTIVE:
664  {
665  fChargeWork[t] += ide.numElectrons;
666  break;
667  }
668  case UCOMB:
669  {
670  dflag = GapHasDeflector(ide.x,ide.y,ide.z);
671  switch (view)
672  {
673  case geo::kU:
674  {
675  fChargeWork[t] += ide.numElectrons * (1.0 - fFractUUCollect[dflag] - fFractUUMiss[dflag]);
676  fChargeWorkCollInd[t] += ide.numElectrons * fFractUUCollect[dflag];
677  break;
678  }
679  case geo::kV:
680  {
681  fChargeWork[t] += ide.numElectrons * (1.0 - fFractVUCollect[dflag] - fFractUUCollect[dflag] - fFractVUMiss[dflag]);
682  fChargeWorkCollInd[t] += ide.numElectrons * fFractVUCollect[dflag];
683  break;
684  }
685  case geo::kZ:
686  {
687  fChargeWork[t] += ide.numElectrons * (1.0-fFractVUCollect[dflag]-fFractUUCollect[dflag]-fFractZUMiss[dflag]);
688  break;
689  }
690  default:
691  {
692  throw cet::exception("SimWireDUNE35t") << "ILLEGAL VIEW Type: " << view <<"\n";
693  }
694  }
695  break;
696  }
697  case VCOMB:
698  {
699  dflag = GapHasDeflector(ide.x,ide.y,ide.z);
700  switch (view)
701  {
702  case geo::kU:
703  {
704  fChargeWork[t] += ide.numElectrons * (1.0 - fFractUVCollect[dflag] - fFractUVMiss[dflag]);
705  fChargeWorkCollInd[t] += ide.numElectrons * fFractUVCollect[dflag];
706  break;
707  }
708  case geo::kV:
709  {
710  fChargeWork[t] += ide.numElectrons * (1.0 - fFractVVCollect[dflag] - fFractUVCollect[dflag] - fFractVVMiss[dflag]);
711  fChargeWorkCollInd[t] += ide.numElectrons * fFractVVCollect[dflag];
712  break;
713  }
714  case geo::kZ:
715  {
716  fChargeWork[t] += ide.numElectrons * (1.0-fFractVVCollect[dflag]-fFractUVCollect[dflag]-fFractZVMiss[dflag]);
717  break;
718  }
719  default:
720  {
721  throw cet::exception("SimWireDUNE35t") << "ILLEGAL VIEW Type: " << view <<"\n";
722  }
723  }
724  break;
725  }
726  case HORIZGAP:
727  {
728  dflag = GapHasDeflector(ide.x,ide.y,ide.z);
729  switch (view)
730  {
731  case geo::kU:
732  {
733  fChargeWork[t] += ide.numElectrons * (1.0-fFractHorizGapUMiss[dflag]-fFractHorizGapUCollect[dflag]);
734  fChargeWorkCollInd[t] += ide.numElectrons * fFractHorizGapUCollect[dflag];
735  break;
736  }
737  case geo::kV:
738  {
739  fChargeWork[t] += ide.numElectrons * (1.0-fFractHorizGapVMiss[dflag]-fFractHorizGapUCollect[dflag]-fFractHorizGapVCollect[dflag]);
740  fChargeWorkCollInd[t] += ide.numElectrons * fFractHorizGapVCollect[dflag];
741  break;
742  }
743  case geo::kZ:
744  {
745  fChargeWork[t] += ide.numElectrons * (1.0-fFractHorizGapZMiss[dflag]-fFractHorizGapUCollect[dflag]-fFractHorizGapVCollect[dflag]);
746  break;
747  }
748  default:
749  {
750  throw cet::exception("SimWireDUNE35t") << "ILLEGAL VIEW Type: " << view <<"\n";
751  }
752  }
753  break;
754  }
755  case VERTGAP:
756  {
757  dflag = GapHasDeflector(ide.x,ide.y,ide.z);
758  switch (view)
759  {
760  case geo::kU:
761  {
762  fChargeWork[t] += ide.numElectrons * (1.0-fFractVertGapUMiss[dflag]-fFractVertGapUCollect[dflag]);
763  fChargeWorkCollInd[t] += ide.numElectrons * fFractVertGapUCollect[dflag];
764  break;
765  }
766  case geo::kV:
767  {
768  fChargeWork[t] += ide.numElectrons * (1.0-fFractVertGapVMiss[dflag]-fFractVertGapUCollect[dflag]-fFractVertGapVCollect[dflag]);
769  fChargeWorkCollInd[t] += ide.numElectrons * fFractVertGapVCollect[dflag];
770  break;
771  }
772  case geo::kZ:
773  {
774  fChargeWork[t] += ide.numElectrons * (1.0-fFractVertGapZMiss[dflag]-fFractVertGapUCollect[dflag]-fFractVertGapVCollect[dflag]);
775  break;
776  }
777  default:
778  {
779  throw cet::exception("SimWireDUNE35t") << "ILLEGAL VIEW Type: " << view <<"\n";
780  }
781  }
782  break;
783  }
784  case NONACTIVE:
785  {
786  break;
787  }
788  }
789  }
790  // the line all this replaced.
791  // fChargeWork[t] = sc->Charge(t);
792  }
793  else
794  {
795  fChargeWork[t] = sc->Charge(t);
796  //if (chan == 180 ) std::cout << "Xin1: " << t << " " << fChargeWork[t] << std::endl;
797  }
798 
799  // Convolve charge with appropriate response function
800 
801  fChargeWork.resize(fNTicks,0);
802  sss->Convolute(clockData, chan,fChargeWork);
803  // if (chan == 180 ) {
804  // for(size_t t = 0; t < fChargeWork.size(); ++t) {
805  // std::cout << "Xin2: " << t << " " << fChargeWork[t] << std::endl;
806  // }
807  // }
808 
809  fChargeWorkCollInd.resize(fNTicks,0);
810  sss->Convolute(clockData, fFirstCollectionChannel,fChargeWorkCollInd);
811 
812  }
813 
814  float ped_mean = fCollectionPed;
815  float ped_rms = fCollectionPedRMS;
816  geo::SigType_t sigtype = geo->SignalType(chan);
817  if (sigtype == geo::kInduction){
818  ped_mean = fInductionPed;
819  ped_rms = fInductionPedRMS;
820  }
821  else if (sigtype == geo::kCollection){
822  ped_mean = fCollectionPed;
823  ped_rms = fCollectionPedRMS;
824  }
825 
826  // noise was already generated for each wire in the event
827  // raw digit vec is already in channel order
828  // pick a new "noise channel" for every channel - this makes sure
829  // the noise has the right coherent characteristics to be on one channel
830 
831  int noisechan = nearbyint(flat.fire()*(1.*(fNoiseArrayPoints-1)+0.1));
832  // optimize for speed -- access vectors as arrays
833 
834  double *fChargeWork_a=0;
835  double *fChargeWorkCollInd_a=0;
836  short *adcvec_a=0;
837  float *noise_a_U=0;
838  float *noise_a_V=0;
839  float *noise_a_Z=0;
840 
841  if (signalSize>0) {
842  fChargeWork_a = fChargeWork.data();
843  fChargeWorkCollInd_a = fChargeWorkCollInd.data();
844  adcvec_a = adcvec.data();
845  if (fNoiseOn && fNoiseModel==1) {
846  noise_a_U=(fNoiseU[noisechan]).data();
847  noise_a_V=(fNoiseV[noisechan]).data();
848  noise_a_Z=(fNoiseZ[noisechan]).data();
849  }
850  }
851 
852  float tmpfv=0; // this is here so we do our own rounding from floats to short ints (saves CPU time)
853  float tnoise=0;
854 
855  if (view != geo::kU && view != geo::kV && view != geo::kZ) {
856  mf::LogError("SimWireDUNE35t") << "ERROR: CHANNEL NUMBER " << chan << " OUTSIDE OF PLANE";
857  }
858 
859  if(fNoiseOn && fNoiseModel==1) {
860  for(unsigned int i = 0; i < signalSize; ++i){
861  if(view==geo::kU) { tnoise = noise_a_U[i]; }
862  else if (view==geo::kV) { tnoise = noise_a_V[i]; }
863  else { tnoise = noise_a_Z[i]; }
864  tmpfv = tnoise + fChargeWork_a[i] ;
865  if (fSimCombs) tmpfv += fChargeWorkCollInd_a[i];
866  //allow for ADC saturation
867  if ( tmpfv > adcsaturation - ped_mean)
868  tmpfv = adcsaturation- ped_mean;
869  //don't allow for "negative" saturation
870  if ( tmpfv < 0 - ped_mean)
871  tmpfv = 0- ped_mean;
872 
873  adcvec_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
874  }
875  }else if (fNoiseOn && fNoiseModel==2){
876 
877  float fASICGain = sss->GetASICGain(chan);
878 
879  double fShapingTime = sss->GetShapingTime(chan);
880  std::map< double, int > fShapingTimeOrder;
881  fShapingTimeOrder = { {0.5, 0}, {1.0, 1}, {2.0, 2}, {3.0, 3} };
882  DoubleVec fNoiseFactVec;
883 
884  //
885 
886  auto tempNoiseVec = sss->GetNoiseFactVec();
887 
888  if ( fShapingTimeOrder.find( fShapingTime ) != fShapingTimeOrder.end() ){
889  size_t i = 0;
890  fNoiseFactVec.resize(2);
891  for (auto& item : tempNoiseVec) {
892  fNoiseFactVec[i] = item.at( fShapingTimeOrder.find( fShapingTime )->second );
893  fNoiseFactVec[i] *= fASICGain/4.7;
894  ++i;
895  }
896  }
897  else {//Throw exception...
898  throw cet::exception("SimWireDUNE35t")
899  << "\033[93m"
900  << "Shaping Time received from signalservices_dune.fcl is not one of allowed values"
901  << std::endl
902  << "Allowed values: 0.5, 1.0, 2.0, 3.0 usec"
903  << "\033[00m"
904  << std::endl;
905  }
906  //std::cout << "Xin " << fASICGain << " " << fShapingTime << " " << fNoiseFactVec[0] << " " << fNoiseFactVec[1] << std::endl;
907 
908  CLHEP::RandGaussQ rGauss_Ind(fEngine, 0.0, fNoiseFactVec[0]);
909  CLHEP::RandGaussQ rGauss_Col(fEngine, 0.0, fNoiseFactVec[1]);
910 
911 
912  for(unsigned int i = 0; i < signalSize; ++i){
913  if(view==geo::kU) { tnoise = rGauss_Ind.fire(); }
914  else if (view==geo::kV) { tnoise = rGauss_Ind.fire(); }
915  else { tnoise = rGauss_Col.fire(); }
916  tmpfv = tnoise + fChargeWork_a[i] ;
917  if (fSimCombs) tmpfv += fChargeWorkCollInd_a[i];
918  //allow for ADC saturation
919  if ( tmpfv > adcsaturation - ped_mean)
920  tmpfv = adcsaturation- ped_mean;
921  //don't allow for "negative" saturation
922  if ( tmpfv < 0 - ped_mean)
923  tmpfv = 0- ped_mean;
924  adcvec_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
925  }
926  }else { // no noise, so just round the values to nearest short ints and store them
927  for(unsigned int i = 0; i < signalSize; ++i){
928  tmpfv = fChargeWork_a[i];
929  if (fSimCombs) tmpfv += fChargeWorkCollInd_a[i] ;
930  //allow for ADC saturation
931  if ( tmpfv > adcsaturation - ped_mean)
932  tmpfv = adcsaturation- ped_mean;
933  //don't allow for "negative" saturation
934  if ( tmpfv < 0 - ped_mean)
935  tmpfv = 0- ped_mean;
936  adcvec_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
937  }
938  }
939 
940  // resize the adcvec to be the correct number of time samples,
941  // just drop the extra samples
942 
943 
944  adcvec.resize(fNSamplesReadout);
945 
946  float calibrated_pedestal_value = 0; // Estimated calibrated value of pedestal to be passed to RawDigits collection
947  float calibrated_pedestal_rms_value = 0; // Estimated calibrated value of pedestal RMS to be passed to RawDigits collection
948  int calibrated_integer_pedestal_value = 0; // Estimated calibrated value of pedestal to be passed to data compression
949 
950  // add pedestal values
951  if(fPedestalOn)
952  {
953  if(ped_rms>0){
954  CLHEP::RandGaussQ rGauss_Ped(fEngine, 0.0, ped_rms);
955  for(unsigned int i = 0; i < signalSize; ++i){
956  float ped_variation = rGauss_Ped.fire();
957  tmpfv = adcvec_a[i] + ped_mean + ped_variation;
958 
959  adcvec_a[i] = (short) tmpfv;
960 
961  }
962  }
963  else{
964  for(unsigned int i = 0; i < signalSize; ++i){
965  tmpfv = adcvec_a[i] + ped_mean;
966  adcvec_a[i] = (short) tmpfv;
967  }
968 
969  }
970 
971 
972 
973  if (sigtype == geo::kInduction){
974  calibrated_pedestal_value = fInductionCalibPed;
975  calibrated_pedestal_rms_value = fInductionCalibPedRMS;
976  }
977  else if (sigtype == geo::kCollection){
978  calibrated_pedestal_value = fCollectionCalibPed;
979  calibrated_pedestal_rms_value = fCollectionCalibPedRMS;
980  }
981 
982  }
983  else{
984  calibrated_pedestal_value = 0;
985  calibrated_pedestal_rms_value = 0;
986 
987  }
988 
989  calibrated_integer_pedestal_value = (int) calibrated_pedestal_value;
990 
991 
992  if(fSimStuckBits)//
993  {
994 
995  for(size_t i = 0; i < adcvec.size(); ++i){
996  CLHEP::RandFlat flat(fEngine);
997 
998 
999  double rnd = flat.fire(0,1);
1000 
1001 
1002  unsigned int zeromask = 0xffc0;
1003  unsigned int onemask = 0x003f;
1004 
1005  unsigned int sixlsbs = adcvec_a[i] & onemask;
1006 
1007  int probability_index = (int)sixlsbs;
1008 
1009  if(rnd < fUnderflowProbs[probability_index]){
1010  adcvec_a[i] = adcvec_a[i] | onemask; // 6 LSBs are stuck at 3F
1011  adcvec_a[i] -= 64; // correct 1st MSB value by subtracting 64
1012  }
1013  else if(rnd > fUnderflowProbs[probability_index] && rnd < fUnderflowProbs[probability_index] + fOverflowProbs[probability_index]){
1014  adcvec_a[i] = adcvec_a[i] & zeromask; // 6 LSBs are stuck at 0
1015  adcvec_a[i] += 64; // correct 1st MSB value by adding 64
1016  }
1017  //else adcvec value remains unchanged
1018  }
1019 
1020  }
1021 
1022 
1023  if(fNeighboringChannels==0){ // case where neighboring channels are disregarded in zero suppression
1024 
1025 
1026  // compress the adc vector using the desired compression scheme,
1027  // if raw::kNone is selected nothing happens to adcvec
1028  // This shrinks adcvec, if fCompression is not kNone.
1029 
1030  if(!fPedestalOn){
1031  raw::Compress(adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1032  }
1033  else{
1034  raw::Compress(adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1035  }
1036 
1037 
1038  raw::RawDigit rd(chan, fNSamplesReadout, adcvec, fCompression);
1039  rd.SetPedestal(calibrated_pedestal_value,calibrated_pedestal_rms_value);
1040 
1041 
1042  adcvec.resize(signalSize); // Then, resize adcvec back to full length. Do not initialize to zero (slow)
1043  if(fSaveEmptyChannel || adcvec[1]>0)
1044  digcol->push_back(rd); // add this digit to the collection
1045 
1046 
1047  }
1048  else{ //case where contribution of neighboring channels is included in zero suppression
1049 
1050 
1051  if(sigtype == geo::kCollection)
1052  {
1053 
1054 
1055  // push the adc vector to the ring buffer to enable zero suppression with neighboring channel contributions
1056 
1057  adcvec_neighbors.push_back(adcvec);
1058 
1059 
1060  if(!(adcvec_neighbors.full()))
1061  {
1062  if(adcvec_neighbors.size()>fNeighboringChannels){ // apply zero suppression to entries at start of collection plane, once ring buffer is full enough with neighbors
1063 
1064  adcvec = adcvec_neighbors.at(adcvec_neighbors.size()-fNeighboringChannels);
1065  // apply zero suppression to entries at start of collection plane, once ring buffer is full enough with neighbors
1066  if(!fPedestalOn){
1067  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1068  }
1069  else{
1070  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1071  }
1072 
1074  rd.SetPedestal(calibrated_pedestal_value,calibrated_pedestal_rms_value);
1075 
1076  if(fSaveEmptyChannel || adcvec[1]>0)
1077  digcol->push_back(rd); // add this digit to the collection
1078 
1079  }
1080  }
1081  else{ // ring buffer is full
1082 
1083  // compress the adc vector using the desired compression scheme,
1084  // if raw::kNone is selected nothing happens to adcvec
1085  // This shrinks adcvec, if fCompression is not kNone.
1086 
1087  adcvec = adcvec_neighbors.at(fNeighboringChannels);
1088  // apply zero suppression to entry in middle of ring buffer
1089  if(!fPedestalOn){
1090  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1091  }
1092  else{
1093  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1094  }
1096  rd.SetPedestal(calibrated_pedestal_value,calibrated_pedestal_rms_value);
1097 
1098  if(fSaveEmptyChannel || adcvec[1]>0)
1099  digcol->push_back(rd); // add this digit to the collection
1100 
1101  if(chan == fLastChannelsInPlane.at(plane_number)) // End of collection plane is reached, so apply zero suppression to last entries as well
1102  {
1103 
1104 
1105  unsigned int channel_number = chan - fNeighboringChannels;
1106  //std::cout << "We have reached the end of a collection plane!" << std::endl;
1107  for(size_t lastentries = 0; lastentries < fNeighboringChannels; ++lastentries)
1108  {
1109  ++channel_number;
1110 
1111  adcvec_neighbors.pop_front(); // remove first entry from ring buffer, to exclude it from nearest neighboring wire checks in zero
1112 
1113  adcvec = adcvec_neighbors.at(fNeighboringChannels);
1114  // apply zero suppression to entry in middle of ring buffer
1115  if(!fPedestalOn){
1116  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1117  }
1118  else{
1119  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1120  }
1121  raw::RawDigit rd2(channel_number, fNSamplesReadout, adcvec, fCompression);
1122  rd2.SetPedestal(calibrated_pedestal_value,calibrated_pedestal_rms_value);
1123 
1124  if(fSaveEmptyChannel || adcvec[1]>0)
1125  digcol->push_back(rd2); // add this digit to the collection
1126 
1127  }
1128 
1129  adcvec_neighbors.clear(); // clear ring buffer for next wire plane
1130  }
1131  } // ring buffer is full
1132 
1133  } // collection plane
1134  else if(sigtype == geo::kInduction)
1135  {
1136  // push the adc vector to the ring buffer to enable zero suppression with neighboring channel contributions
1137 
1138 
1139  adcvec_neighbors.push_back(adcvec);
1140  if(!(adcvec_neighbors.full()))
1141  {
1142  adcvec_inductionplanestart.push_back(adcvec);
1143 
1144 
1145  }
1146  else //ring buffer is full
1147  {
1148 
1149  // compress the adc vector using the desired compression scheme,
1150  // if raw::kNone is selected nothing happens to adcvec
1151  // This shrinks adcvec, if fCompression is not kNone.
1152 
1153  adcvec = adcvec_neighbors.at(fNeighboringChannels);
1154  // apply zero suppression to entry in middle of ring buffer
1155  if(!fPedestalOn){
1156  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1157  }
1158  else{
1159  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1160  }
1161  raw::RawDigit rd(chan-fNeighboringChannels, fNSamplesReadout, adcvec, fCompression);
1162  rd.SetPedestal(calibrated_pedestal_value,calibrated_pedestal_rms_value);
1163 
1164  if(fSaveEmptyChannel || adcvec[1]>0)
1165  digcol->push_back(rd); // add this digit to the collection
1166 
1167  }
1168  if(chan==fLastChannelsInPlane.at(plane_number)){ // reached the last channel of the induction plane
1169 
1170  unsigned int channel_number = chan-fNeighboringChannels;
1171 
1172  for(size_t lastentries = 0; lastentries < 2*fNeighboringChannels; ++lastentries)
1173  {
1174 
1175  ++channel_number;
1176 
1177  if(channel_number > fLastChannelsInPlane.at(plane_number))
1178  channel_number = fFirstChannelsInPlane.at(plane_number); // set channel number back to start of induction plane after looping around
1179 
1180  //std::cout << "Channel number of looping-around sections of induction plane = " << channel_number << std::endl;
1181 
1182  adcvec_neighbors.push_back(adcvec_inductionplanestart.at(lastentries)); // push channel from start of plane onto ring buffer
1183 
1184  adcvec = adcvec_neighbors.at(fNeighboringChannels);
1185 
1186  // apply zero suppression to entry in middle of ring buffer
1187  if(!fPedestalOn){
1188  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1189  }
1190  else{
1191  raw::Compress(adcvec_neighbors,adcvec, fCompression, fZeroThreshold, calibrated_integer_pedestal_value, fNearestNeighbor, fSimStuckBits);
1192  }
1193  raw::RawDigit rd2(channel_number, fNSamplesReadout, adcvec, fCompression);
1194  rd2.SetPedestal(calibrated_pedestal_value,calibrated_pedestal_rms_value);
1195 
1196  if(fSaveEmptyChannel || adcvec[1]>0)
1197  digcol->push_back(rd2); // add this digit to the collection
1198 
1199  }
1200 
1201  adcvec_neighbors.clear(); // clear ring buffer for next wire plane
1202  adcvec_inductionplanestart.clear(); // clear vector of starting adc vectors for next induction plane
1203  }
1204 
1205  } // induction plane
1206 
1207  } // zero suppression with nearest neighboring wire influence complete
1208 
1209  adcvec.resize(signalSize); // Then, resize adcvec back to full length. Do not initialize to zero (slow)
1210 
1211  if(chan==fLastChannelsInPlane.at(plane_number))
1212  ++plane_number;
1213 
1214  }// end loop over channels
1215 
1216  evt.put(std::move(digcol));
1217 
1218  return;
1219  }
float fInductionCalibPedRMS
Assumed measured value for ind plane pedestal RMS.
intermediate_table::iterator iterator
int fNTicks
number of ticks of the clock
std::vector< float > fFractUVCollect
std::vector< std::vector< float > > fNoiseU
noise on each channel for each time for U plane
double GetShapingTime(Channel channel) const override
std::vector< float > fFractVUCollect
float fInductionPed
ADC value of baseline for induction plane.
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:140
bool fSimCombs
switch for simulation of the combs
std::vector< float > fFractHorizGapVMiss
std::vector< float > fFractHorizGapZMiss
std::vector< uint32_t > fFirstChannelsInPlane
std::vector< float > fFractUUMiss
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:130
std::vector< DoubleVec > GetNoiseFactVec() const override
std::vector< float > fFractUVMiss
const unsigned int onemask
Definition: raw.h:139
std::vector< float > fFractUUCollect
std::vector< float > fFractVUMiss
Planes which measure Z direction.
Definition: geo_types.h:132
unsigned int fNoiseModel
noise model>
int GapHasDeflector(double x, double y, double z)
float fInductionCalibPed
Assumed measured value for ind plane pedestal.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
float fInductionPedRMS
ADC value of baseline RMS for induction plane.
unsigned int fNSamplesReadout
number of ADC readout samples in 1 readout frame
std::vector< float > fFractHorizGapVCollect
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
std::vector< float > fFractHorizGapUMiss
GapType_t combtest35t(double x, double y, double z)
float fCollectionPed
ADC value of baseline for collection plane.
int fNearestNeighbor
Maximum distance between hits above threshold before they are separated into different blocks...
Planes which measure U.
Definition: geo_types.h:129
std::vector< float > fFractVVMiss
unsigned int fNoiseOn
noise turned on or off for debugging; default is on
Signal from induction planes.
Definition: geo_types.h:145
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
Definition: SimChannel.cxx:134
enum geo::_plane_sigtype SigType_t
bool fPedestalOn
switch for simulation of nonzero pedestals
def move(depos, offset)
Definition: depos.py:107
double fUnderflowProbs[64]
array of probabilities of 6 LSF bits getting stuck at 111111
float fCollectionPedRMS
ADC value of baseline RMS for collection plane.
raw::Compress_t fCompression
compression type to use
std::vector< double > fChargeWork
std::vector< float > fFractZVMiss
float fCollectionCalibPed
Assumed measured value for coll plane pedestal.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
unsigned int fNTimeSamples
number of ADC readout samples in all readout frames (per event)
float fCollectionCalibPedRMS
Assumed measured value for coll plane pedestal RMS.
std::vector< float > fFractVertGapVMiss
std::string fDriftEModuleLabel
module making the ionization electrons
void Convolute(detinfo::DetectorClocksData const &clockData, Channel channel, std::vector< T > &func) const
std::vector< float > fFractVertGapVCollect
std::vector< std::vector< float > > fNoiseZ
noise on each channel for each time for Z (collection) plane
std::vector< sim::IDE > TrackIDsAndEnergies(TDC_t startTDC, TDC_t endTDC) const
Return all the recorded energy deposition within a time interval.
Definition: SimChannel.cxx:180
CLHEP::HepRandomEngine & fEngine
std::vector< float > fFractVVCollect
std::vector< float > fFractVertGapUMiss
bool fSimStuckBits
switch for simulation of stuck bits
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
Definition: raw.cxx:19
double fOverflowProbs[64]
array of probabilities of 6 LSF bits getting stuck at 000000
std::vector< std::vector< float > > fNoiseV
noise on each channel for each time for V plane
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
double GetASICGain(Channel channel) const override
std::vector< uint32_t > fLastChannelsInPlane
unsigned int fZeroThreshold
Zero suppression threshold.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
std::vector< float > fFractHorizGapUCollect
std::vector< float > fFractZUMiss
unsigned int fNeighboringChannels
Number of neighboring channels on either side allowed to influence zero suppression.
std::vector< float > fFractVertGapZMiss
std::vector< float > fFractVertGapUCollect
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
Signal from collection planes.
Definition: geo_types.h:146
std::vector< double > DoubleVec
void detsim::SimWireDUNE35t::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 210 of file SimWireDUNE35t_module.cc.

211  {
212  fDriftEModuleLabel= p.get< std::string >("DriftEModuleLabel");
213 
214 
215  fNoiseFactZ = p.get< double >("NoiseFactZ");
216  fNoiseWidthZ = p.get< double >("NoiseWidthZ");
217  fLowCutoffZ = p.get< double >("LowCutoffZ");
218  fNoiseFactU = p.get< double >("NoiseFactU");
219  fNoiseWidthU = p.get< double >("NoiseWidthU");
220  fLowCutoffU = p.get< double >("LowCutoffU");
221  fNoiseFactV = p.get< double >("NoiseFactV");
222  fNoiseWidthV = p.get< double >("NoiseWidthV");
223  fLowCutoffV = p.get< double >("LowCutoffV");
224  fZeroThreshold = p.get< unsigned int >("ZeroThreshold");
225  fNearestNeighbor = p.get< int >("NearestNeighbor");
226  fNeighboringChannels = p.get< unsigned int >("NeighboringChannels");
227  fNoiseArrayPoints = p.get< unsigned int >("NoiseArrayPoints");
228  fNoiseOn = p.get< unsigned int >("NoiseOn");
229  fNoiseModel = p.get< unsigned int >("NoiseModel");
230  fCollectionPed = p.get< float >("CollectionPed");
231  fCollectionPedRMS = p.get< float >("CollectionPedRMS");
232  fInductionPed = p.get< float >("InductionPed");
233  fInductionPedRMS = p.get< float >("InductionPedRMS");
234  fCollectionCalibPed = p.get< float >("CollectionCalibPed");
235  fCollectionCalibPedRMS = p.get< float >("CollectionCalibPedRMS");
236  fInductionCalibPed = p.get< float >("InductionCalibPed");
237  fInductionCalibPedRMS = p.get< float >("InductionCalibPedRMS");
238  fPedestalOn = p.get< bool >("PedestalOn");
239  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
240  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clockData);
241  fSampleRate = sampling_rate(clockData);
242  fNSamplesReadout = detProp.ReadOutWindowSize();
243  fNTimeSamples = detProp.NumberTimeSamples();
244 
245  fSimCombs = p.get< bool >("SimCombs");
246  fSimStuckBits = p.get< bool >("SimStuckBits");
247 
248  fStuckBitsProbabilitiesFname = p.get< std::string >("StuckBitsProbabilitiesFname");
249  fStuckBitsOverflowProbHistoName = p.get< std::string >("StuckBitsOverflowProbHistoName");
250  fStuckBitsUnderflowProbHistoName = p.get< std::string >("StuckBitsUnderflowProbHistoName");
251 
252  fSaveEmptyChannel = p.get< bool >("SaveEmptyChannel");
253  fFractUUCollect = p.get< std::vector<float> >("FractUUCollect");
254  fFractUVCollect = p.get< std::vector<float> >("FractUVCollect");
255  fFractVUCollect = p.get< std::vector<float> >("FractVUCollect");
256  fFractVVCollect = p.get< std::vector<float> >("FractVVCollect");
257  fFractUUMiss = p.get< std::vector<float> >("FractUUMiss");
258  fFractUVMiss = p.get< std::vector<float> >("FractUVMiss");
259  fFractVUMiss = p.get< std::vector<float> >("FractVUMiss");
260  fFractVVMiss = p.get< std::vector<float> >("FractVVMiss");
261  fFractZUMiss = p.get< std::vector<float> >("FractZUMiss");
262  fFractZVMiss = p.get< std::vector<float> >("FractZVMiss");
263  fFractHorizGapUMiss = p.get< std::vector<float> >("FractHorizGapUMiss");
264  fFractVertGapUMiss = p.get< std::vector<float> >("FractVertGapUMiss");
265  fFractHorizGapVMiss = p.get< std::vector<float> >("FractHorizGapVMiss");
266  fFractVertGapVMiss = p.get< std::vector<float> >("FractVertGapVMiss");
267  fFractHorizGapZMiss = p.get< std::vector<float> >("FractHorizGapZMiss");
268  fFractVertGapZMiss = p.get< std::vector<float> >("FractVertGapZMiss");
269  fFractHorizGapUCollect = p.get< std::vector<float> >("FractHorizGapUCollect");
270  fFractVertGapUCollect = p.get< std::vector<float> >("FractVertGapUCollect");
271  fFractHorizGapVCollect = p.get< std::vector<float> >("FractHorizGapVCollect");
272  fFractVertGapVCollect = p.get< std::vector<float> >("FractVertGapVCollect");
273 
274  return;
275  }
float fInductionCalibPedRMS
Assumed measured value for ind plane pedestal RMS.
std::vector< float > fFractUVCollect
std::vector< float > fFractVUCollect
float fNoiseWidthZ
exponential noise width (kHz) for Z (collection) plane
float fInductionPed
ADC value of baseline for induction plane.
bool fSimCombs
switch for simulation of the combs
float fLowCutoffZ
low frequency filter cutoff (kHz) for Z (collection) plane
std::vector< float > fFractHorizGapVMiss
std::vector< float > fFractHorizGapZMiss
std::vector< float > fFractUUMiss
std::string string
Definition: nybbler.cc:12
float fNoiseWidthU
exponential noise width (kHz) for U plane
std::vector< float > fFractUVMiss
std::vector< float > fFractUUCollect
std::vector< float > fFractVUMiss
unsigned int fNoiseModel
noise model>
float fInductionCalibPed
Assumed measured value for ind plane pedestal.
float fInductionPedRMS
ADC value of baseline RMS for induction plane.
unsigned int fNSamplesReadout
number of ADC readout samples in 1 readout frame
float fLowCutoffU
low frequency filter cutoff (kHz) for U plane
std::vector< float > fFractHorizGapVCollect
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
std::vector< float > fFractHorizGapUMiss
float fCollectionPed
ADC value of baseline for collection plane.
int fNearestNeighbor
Maximum distance between hits above threshold before they are separated into different blocks...
std::string fStuckBitsUnderflowProbHistoName
Name of histogram holding ADC stuck code underflow probabilities.
std::vector< float > fFractVVMiss
float fNoiseFactU
noise scale factor for U plane
unsigned int fNoiseOn
noise turned on or off for debugging; default is on
bool fPedestalOn
switch for simulation of nonzero pedestals
float fCollectionPedRMS
ADC value of baseline RMS for collection plane.
std::vector< float > fFractZVMiss
float fNoiseWidthV
exponential noise width (kHz) for V plane
float fNoiseFactZ
noise scale factor for Z (collection) plane
p
Definition: test.py:223
float fCollectionCalibPed
Assumed measured value for coll plane pedestal.
unsigned int fNTimeSamples
number of ADC readout samples in all readout frames (per event)
float fCollectionCalibPedRMS
Assumed measured value for coll plane pedestal RMS.
std::vector< float > fFractVertGapVMiss
std::string fDriftEModuleLabel
module making the ionization electrons
std::vector< float > fFractVertGapVCollect
std::vector< float > fFractVVCollect
std::string fStuckBitsProbabilitiesFname
file holding ADC stuck code overflow and underflow probabilities
double fSampleRate
sampling rate in ns
std::vector< float > fFractVertGapUMiss
bool fSimStuckBits
switch for simulation of stuck bits
float fLowCutoffV
low frequency filter cutoff (kHz) for V plane
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
unsigned int fZeroThreshold
Zero suppression threshold.
float fNoiseFactV
noise scale factor for V plane
std::vector< float > fFractHorizGapUCollect
std::string fStuckBitsOverflowProbHistoName
Name of histogram holding ADC stuck code overflow probabilities.
std::vector< float > fFractZUMiss
unsigned int fNeighboringChannels
Number of neighboring channels on either side allowed to influence zero suppression.
std::vector< float > fFractVertGapZMiss
std::vector< float > fFractVertGapUCollect

Member Data Documentation

const float detsim::SimWireDUNE35t::adcsaturation = 4095
private

Definition at line 130 of file SimWireDUNE35t_module.cc.

std::vector<double> detsim::SimWireDUNE35t::fChargeWork
private

Definition at line 110 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fCollectionCalibPed
private

Assumed measured value for coll plane pedestal.

Definition at line 135 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fCollectionCalibPedRMS
private

Assumed measured value for coll plane pedestal RMS.

Definition at line 136 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fCollectionPed
private

ADC value of baseline for collection plane.

Definition at line 131 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fCollectionPedRMS
private

ADC value of baseline RMS for collection plane.

Definition at line 132 of file SimWireDUNE35t_module.cc.

raw::Compress_t detsim::SimWireDUNE35t::fCompression
private

compression type to use

Definition at line 86 of file SimWireDUNE35t_module.cc.

std::string detsim::SimWireDUNE35t::fDriftEModuleLabel
private

module making the ionization electrons

Definition at line 85 of file SimWireDUNE35t_module.cc.

CLHEP::HepRandomEngine& detsim::SimWireDUNE35t::fEngine
private

Definition at line 186 of file SimWireDUNE35t_module.cc.

std::vector< uint32_t > detsim::SimWireDUNE35t::fFirstChannelsInPlane
private

Definition at line 125 of file SimWireDUNE35t_module.cc.

uint32_t detsim::SimWireDUNE35t::fFirstCollectionChannel
private

Definition at line 121 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractHorizGapUCollect
private

Definition at line 167 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractHorizGapUMiss
private

Definition at line 161 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractHorizGapVCollect
private

Definition at line 169 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractHorizGapVMiss
private

Definition at line 163 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractHorizGapZMiss
private

Definition at line 165 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractUUCollect
private

Definition at line 151 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractUUMiss
private

Definition at line 155 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractUVCollect
private

Definition at line 152 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractUVMiss
private

Definition at line 156 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVertGapUCollect
private

Definition at line 168 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVertGapUMiss
private

Definition at line 162 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVertGapVCollect
private

Definition at line 170 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVertGapVMiss
private

Definition at line 164 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVertGapZMiss
private

Definition at line 166 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVUCollect
private

Definition at line 153 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVUMiss
private

Definition at line 157 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVVCollect
private

Definition at line 154 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractVVMiss
private

Definition at line 158 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractZUMiss
private

Definition at line 159 of file SimWireDUNE35t_module.cc.

std::vector<float> detsim::SimWireDUNE35t::fFractZVMiss
private

Definition at line 160 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fInductionCalibPed
private

Assumed measured value for ind plane pedestal.

Definition at line 137 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fInductionCalibPedRMS
private

Assumed measured value for ind plane pedestal RMS.

Definition at line 138 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fInductionPed
private

ADC value of baseline for induction plane.

Definition at line 133 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fInductionPedRMS
private

ADC value of baseline RMS for induction plane.

Definition at line 134 of file SimWireDUNE35t_module.cc.

std::vector< uint32_t > detsim::SimWireDUNE35t::fLastChannelsInPlane
private

Definition at line 126 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fLowCutoff
private

low frequency filter cutoff (kHz)

Definition at line 91 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fLowCutoffU
private

low frequency filter cutoff (kHz) for U plane

Definition at line 97 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fLowCutoffV
private

low frequency filter cutoff (kHz) for V plane

Definition at line 100 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fLowCutoffZ
private

low frequency filter cutoff (kHz) for Z (collection) plane

Definition at line 94 of file SimWireDUNE35t_module.cc.

int detsim::SimWireDUNE35t::fNearestNeighbor
private

Maximum distance between hits above threshold before they are separated into different blocks.

Definition at line 102 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fNeighboringChannels
private

Number of neighboring channels on either side allowed to influence zero suppression.

Definition at line 103 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fNoiseArrayPoints
private

number of points in randomly generated noise array

Definition at line 108 of file SimWireDUNE35t_module.cc.

TH1D* detsim::SimWireDUNE35t::fNoiseDist
private

distribution of noise counts

Definition at line 116 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseFact
private

noise scale factor

Definition at line 89 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseFactU
private

noise scale factor for U plane

Definition at line 95 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseFactV
private

noise scale factor for V plane

Definition at line 98 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseFactZ
private

noise scale factor for Z (collection) plane

Definition at line 92 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fNoiseModel
private

noise model>

Definition at line 88 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fNoiseOn
private

noise turned on or off for debugging; default is on

Definition at line 87 of file SimWireDUNE35t_module.cc.

std::vector< std::vector<float> > detsim::SimWireDUNE35t::fNoiseU
private

noise on each channel for each time for U plane

Definition at line 113 of file SimWireDUNE35t_module.cc.

std::vector< std::vector<float> > detsim::SimWireDUNE35t::fNoiseV
private

noise on each channel for each time for V plane

Definition at line 114 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseWidth
private

exponential noise width (kHz)

Definition at line 90 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseWidthU
private

exponential noise width (kHz) for U plane

Definition at line 96 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseWidthV
private

exponential noise width (kHz) for V plane

Definition at line 99 of file SimWireDUNE35t_module.cc.

float detsim::SimWireDUNE35t::fNoiseWidthZ
private

exponential noise width (kHz) for Z (collection) plane

Definition at line 93 of file SimWireDUNE35t_module.cc.

std::vector< std::vector<float> > detsim::SimWireDUNE35t::fNoiseZ
private

noise on each channel for each time for Z (collection) plane

Definition at line 112 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fNSamplesReadout
private

number of ADC readout samples in 1 readout frame

Definition at line 106 of file SimWireDUNE35t_module.cc.

int detsim::SimWireDUNE35t::fNTicks
private

number of ticks of the clock

Definition at line 104 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fNTimeSamples
private

number of ADC readout samples in all readout frames (per event)

Definition at line 107 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::fOverflowProbs[64]
private

array of probabilities of 6 LSF bits getting stuck at 000000

Definition at line 184 of file SimWireDUNE35t_module.cc.

bool detsim::SimWireDUNE35t::fPedestalOn
private

switch for simulation of nonzero pedestals

Definition at line 139 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::fSampleRate
private

sampling rate in ns

Definition at line 105 of file SimWireDUNE35t_module.cc.

bool detsim::SimWireDUNE35t::fSaveEmptyChannel
private

Definition at line 150 of file SimWireDUNE35t_module.cc.

bool detsim::SimWireDUNE35t::fSimCombs
private

switch for simulation of the combs

Definition at line 143 of file SimWireDUNE35t_module.cc.

bool detsim::SimWireDUNE35t::fSimStuckBits
private

switch for simulation of stuck bits

Definition at line 144 of file SimWireDUNE35t_module.cc.

std::string detsim::SimWireDUNE35t::fStuckBitsOverflowProbHistoName
private

Name of histogram holding ADC stuck code overflow probabilities.

Definition at line 147 of file SimWireDUNE35t_module.cc.

std::string detsim::SimWireDUNE35t::fStuckBitsProbabilitiesFname
private

file holding ADC stuck code overflow and underflow probabilities

Definition at line 146 of file SimWireDUNE35t_module.cc.

std::string detsim::SimWireDUNE35t::fStuckBitsUnderflowProbHistoName
private

Name of histogram holding ADC stuck code underflow probabilities.

Definition at line 148 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::fUnderflowProbs[64]
private

array of probabilities of 6 LSF bits getting stuck at 111111

Definition at line 185 of file SimWireDUNE35t_module.cc.

unsigned int detsim::SimWireDUNE35t::fZeroThreshold
private

Zero suppression threshold.

Definition at line 101 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb1
private

Definition at line 177 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb10
private

Definition at line 178 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb11
private

Definition at line 178 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb12
private

Definition at line 178 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb13
private

Definition at line 179 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb14
private

Definition at line 179 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb15
private

Definition at line 179 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb16
private

Definition at line 179 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb17
private

Definition at line 179 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb18
private

Definition at line 179 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb2
private

Definition at line 177 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb3
private

Definition at line 177 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb4
private

Definition at line 177 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb5
private

Definition at line 177 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb6
private

Definition at line 177 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb7
private

Definition at line 178 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb8
private

Definition at line 178 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::ycomb9
private

Definition at line 178 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb1
private

Definition at line 174 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb10
private

Definition at line 175 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb11
private

Definition at line 175 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb12
private

Definition at line 175 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb13
private

Definition at line 176 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb14
private

Definition at line 176 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb15
private

Definition at line 176 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb16
private

Definition at line 176 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb17
private

Definition at line 176 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb18
private

Definition at line 176 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb2
private

Definition at line 174 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb3
private

Definition at line 174 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb4
private

Definition at line 174 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb5
private

Definition at line 174 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb6
private

Definition at line 174 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb7
private

Definition at line 175 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb8
private

Definition at line 175 of file SimWireDUNE35t_module.cc.

double detsim::SimWireDUNE35t::zcomb9
private

Definition at line 175 of file SimWireDUNE35t_module.cc.


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