Public Member Functions | Public Attributes | List of all members
evgen::NuMISpillTimeStructure Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/EventGenerator/GENIE/NuMISpillTimeStructure.h"

Public Member Functions

 NuMISpillTimeStructure ()
 
void NewSpill ()
 
double GetTime () const
 
double BinToT (unsigned int i) const
 

Public Attributes

unsigned int fNbatch
 Number of proton batches. More...
 
unsigned int fNbucketPerBatch
 Number of RF buckets per batch. More...
 
unsigned int fNfilledBucket
 Number of buckets that are filled. More...
 
double fTbucket
 How many ns are there per bucket? More...
 
double fBucketSigmaT
 Width of protons inside an RF time bucket (ns) More...
 
double fBucketSigmaPOT
 bucket-to-bucket variation in POT (fractional) More...
 
unsigned int fNbinPerBucket
 Number of time bins to use per bucket. More...
 
unsigned int fNbin
 Total number of bins in time profile. More...
 
std::vector< double > fPOTbyBatch
 Relative number of POT in a batch (arb.) More...
 
std::vector< double > fSpillPOT
 POT/bin. More...
 
std::vector< double > fSpillPOTI
 Integrated POT. More...
 

Detailed Description

Definition at line 5 of file NuMISpillTimeStructure.h.

Constructor & Destructor Documentation

NuMISpillTimeStructure::NuMISpillTimeStructure ( )

Definition at line 9 of file NuMISpillTimeStructure.cxx.

References fPOTbyBatch, fSpillPOT, fSpillPOTI, MECModelEnuComparisons::i, and gen_flatrecord::size.

9  :
10  //
11  // These numbers specify the spill structure for NuMI
12  //
13  // * There are 84 RF buckets in a single batch
14  // * There are 6 filled buckets in a single spill
15  // * Within a batch, the first 81 buckets are filled
16  //
17  // * 53.103 MHz is the RF frequency of Main Injector at 120 GeV
18  //
19  // * The RF sine wave localizes the protons to the center of the
20  // bucket with a ~gaussian time profile of width ~750 ps (e-mail
21  // from Phil Adamson (May 28, 2015)
22  //
23  // * There is some variation bucket-to-bucket in the number of
24  // protons. This is estimated to be about +/- 15% with a gasussian
25  // spread based on a quick look at some of the data from the
26  // resistive wall monitors on the fast NuMI DAQ
27  //
28  // messier@indiana.edu (June 1, 2015)
29  //
30  fNbatch (6),
31  fNbucketPerBatch(84),
32  fNfilledBucket (81),
33  fTbucket (1e9/53.103E6),
34  fBucketSigmaT (0.750),
35  fBucketSigmaPOT (0.15),
36  fNbinPerBucket (50),
39  fSpillPOT (fNbin),
41 {
42  fPOTbyBatch[0] = 1.9;
43  fPOTbyBatch[1] = 1.9;
44  fPOTbyBatch[2] = 1.0;
45  fPOTbyBatch[3] = 1.0;
46  fPOTbyBatch[4] = 1.0;
47  fPOTbyBatch[5] = 1.0;
48 
49  for (unsigned int i=0; i<fSpillPOT. size(); ++i) fSpillPOT[i] = 0;
50  for (unsigned int i=0; i<fSpillPOTI.size(); ++i) fSpillPOTI[i] = 0;
51 }
unsigned int fNfilledBucket
Number of buckets that are filled.
std::vector< double > fSpillPOT
POT/bin.
unsigned int fNbucketPerBatch
Number of RF buckets per batch.
std::vector< double > fSpillPOTI
Integrated POT.
unsigned int fNbatch
Number of proton batches.
std::vector< double > fPOTbyBatch
Relative number of POT in a batch (arb.)
unsigned int fNbinPerBucket
Number of time bins to use per bucket.
unsigned int fNbin
Total number of bins in time profile.
double fBucketSigmaT
Width of protons inside an RF time bucket (ns)
double fBucketSigmaPOT
bucket-to-bucket variation in POT (fractional)
double fTbucket
How many ns are there per bucket?

Member Function Documentation

double NuMISpillTimeStructure::BinToT ( unsigned int  i) const

Convert a bin number to a time in nanoseconds

Definition at line 55 of file NuMISpillTimeStructure.cxx.

References check_time_usage::float, fNbinPerBucket, and fTbucket.

Referenced by GetTime(), and NewSpill().

56 {
57  return fTbucket*((float)i-(float)fNbinPerBucket+0.5)/(float)fNbinPerBucket;
58 }
unsigned int fNbinPerBucket
Number of time bins to use per bucket.
double fTbucket
How many ns are there per bucket?
double NuMISpillTimeStructure::GetTime ( ) const

Sample a random time from the spill time structure

Returns
time in units of nanoseconds

Definition at line 108 of file NuMISpillTimeStructure.cxx.

References BinToT(), fSpillPOTI, MECModelEnuComparisons::i, and r().

109 {
110  unsigned int i;
111  double r;
112  r = gRandom->Uniform();
113  for (i=0; i<fSpillPOTI.size(); ++i) {
114  if (fSpillPOTI[i]>r) return this->BinToT(i);
115  }
116  return 0.0;
117 }
std::vector< double > fSpillPOTI
Integrated POT.
TRandom3 r(0)
double BinToT(unsigned int i) const
void NuMISpillTimeStructure::NewSpill ( )

Generate a new random spill time profile

Definition at line 62 of file NuMISpillTimeStructure.cxx.

References ana::assert(), BinToT(), fBucketSigmaPOT, fBucketSigmaT, fNbatch, fNbin, fNbinPerBucket, fNbucketPerBatch, fNfilledBucket, fPOTbyBatch, fSpillPOT, fSpillPOTI, Gaus(), MECModelEnuComparisons::i, it, calib::j, pot, confusionMatrixTree::t, and getGoodRuns4SAM::t0.

63 {
64  unsigned int i, j, k;
65  unsigned int it, it0;
66  double t, t0;
67  double pot, fpot;
68 
69  //
70  // Figure out the relative number of protons in each time bin
71  //
72  it = fNbinPerBucket;
73  for (i=0; i<fNbatch; ++i) {
74  pot = fPOTbyBatch[i];
75  for (j=0; j<fNbucketPerBatch; ++j) {
76  it0 = it+fNbinPerBucket/2;
77  t0 = this->BinToT(it0);
78  fpot = gRandom->Gaus(1.0, fBucketSigmaPOT);
79  for (k=0; k<fNbinPerBucket; ++k) {
80  if (j>fNfilledBucket) {
81  fSpillPOT[it] = 0.0;
82  }
83  else {
84  t = this->BinToT(it);
85  fSpillPOT[it] = pot*fpot*TMath::Gaus(t-t0,0,fBucketSigmaT);
86  }
87  ++it;
88  assert(it<=fNbin);
89  }
90  }
91  }
92 
93  //
94  // Now compute the integral and normalize it to 1 so we can sample
95  // the timing distribution
96  //
97  fSpillPOTI[0] = fSpillPOT[i];
98  for (i=1; i<fSpillPOTI.size(); ++i) {
99  fSpillPOTI[i] = fSpillPOTI[i-1] + fSpillPOT[i];
100  }
101  for (i=0; i<fSpillPOTI.size(); ++i) {
102  fSpillPOTI[i] /= fSpillPOTI[fSpillPOTI.size()-1];
103  }
104 }
unsigned int fNfilledBucket
Number of buckets that are filled.
std::vector< double > fSpillPOT
POT/bin.
set< int >::iterator it
unsigned int fNbucketPerBatch
Number of RF buckets per batch.
std::vector< double > fSpillPOTI
Integrated POT.
unsigned int fNbatch
Number of proton batches.
std::vector< double > fPOTbyBatch
Relative number of POT in a batch (arb.)
unsigned int fNbinPerBucket
Number of time bins to use per bucket.
unsigned int fNbin
Total number of bins in time profile.
#define pot
double Gaus(TH1D *h, double &err, bool isTruth)
Definition: absCal.cxx:489
const double j
Definition: BetheBloch.cxx:29
double fBucketSigmaT
Width of protons inside an RF time bucket (ns)
double fBucketSigmaPOT
bucket-to-bucket variation in POT (fractional)
assert(nhit_max >=nhit_nbins)
double BinToT(unsigned int i) const

Member Data Documentation

double evgen::NuMISpillTimeStructure::fBucketSigmaPOT

bucket-to-bucket variation in POT (fractional)

Definition at line 30 of file NuMISpillTimeStructure.h.

Referenced by NewSpill().

double evgen::NuMISpillTimeStructure::fBucketSigmaT

Width of protons inside an RF time bucket (ns)

Definition at line 29 of file NuMISpillTimeStructure.h.

Referenced by NewSpill().

unsigned int evgen::NuMISpillTimeStructure::fNbatch

Number of proton batches.

Definition at line 25 of file NuMISpillTimeStructure.h.

Referenced by NewSpill().

unsigned int evgen::NuMISpillTimeStructure::fNbin

Total number of bins in time profile.

Definition at line 32 of file NuMISpillTimeStructure.h.

Referenced by NewSpill().

unsigned int evgen::NuMISpillTimeStructure::fNbinPerBucket

Number of time bins to use per bucket.

Definition at line 31 of file NuMISpillTimeStructure.h.

Referenced by BinToT(), and NewSpill().

unsigned int evgen::NuMISpillTimeStructure::fNbucketPerBatch

Number of RF buckets per batch.

Definition at line 26 of file NuMISpillTimeStructure.h.

Referenced by NewSpill().

unsigned int evgen::NuMISpillTimeStructure::fNfilledBucket

Number of buckets that are filled.

Definition at line 27 of file NuMISpillTimeStructure.h.

Referenced by NewSpill().

std::vector<double> evgen::NuMISpillTimeStructure::fPOTbyBatch

Relative number of POT in a batch (arb.)

Definition at line 33 of file NuMISpillTimeStructure.h.

Referenced by NewSpill(), and NuMISpillTimeStructure().

std::vector<double> evgen::NuMISpillTimeStructure::fSpillPOT

POT/bin.

Definition at line 34 of file NuMISpillTimeStructure.h.

Referenced by NewSpill(), and NuMISpillTimeStructure().

std::vector<double> evgen::NuMISpillTimeStructure::fSpillPOTI

Integrated POT.

Definition at line 35 of file NuMISpillTimeStructure.h.

Referenced by GetTime(), NewSpill(), and NuMISpillTimeStructure().

double evgen::NuMISpillTimeStructure::fTbucket

How many ns are there per bucket?

Definition at line 28 of file NuMISpillTimeStructure.h.

Referenced by BinToT().


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