|
ATLAS Offline Software
|
Go to the documentation of this file.
41 #include <CLHEP/Random/Randomize.h>
42 #include <CLHEP/Units/SystemOfUnits.h>
55 using CLHEP::RandGaussQ;
56 using CLHEP::RandFlat;
175 ATH_MSG_FATAL(
"Could not find input file Distributions_small_h2000_177531_JetTauEtmiss.root");
176 return StatusCode::FAILURE;
180 return StatusCode::FAILURE;
191 ATH_MSG_FATAL(
"Could not find input file Distributions_MB_minbias_inelastic_lowjetphoton_e8314_e7400_s3508.root");
192 return StatusCode::FAILURE;
197 return StatusCode::FAILURE;
198 ATH_MSG_DEBUG(
"Made PU amp distributions for each partition and channel");
206 ATH_MSG_FATAL(
"Could not find input file Distributions_small_h2000_177531_ZeroBias.root");
207 return StatusCode::FAILURE;
211 return StatusCode::FAILURE;
234 ATH_MSG_FATAL(
"Could not initialize find Random Number Service.");
235 return StatusCode::FAILURE;
242 return StatusCode::SUCCESS;
252 const EventContext& ctx = Gaudi::Hive::currentContext();
259 auto digitsContainer = std::make_unique<TileMutableDigitsContainer>(
true,
272 TRandom3 *random =
new TRandom3(
m_seed);
273 double tFit = 0,
ped = 100;
276 TF1 *
pdf =
new TF1();
277 TF1 *pdf_PhaseI =
new TF1();
278 TF1 *pdf_lo =
new TF1();
279 TF1 *pdf_hi =
new TF1();
284 Double_t sigma_lo = 1;
285 pdf_lo =
new TF1(
"pdf_lo",
"(1/(sqrt(2*pi)*[0])) * (exp(-0.5*(x/[0])**2)/(sqrt(2*pi)*[0]))", -100, 100);
286 pdf_lo->SetParameter(0,sigma_lo);
288 Double_t sigma_hi = 2.5;
289 pdf_hi =
new TF1(
"pdf_hi",
"(1/(sqrt(2*pi)*[0])) * (exp(-0.5*(x/[0])**2)/(sqrt(2*pi)*[0]))", -100, 100);
290 pdf_hi->SetParameter(0,sigma_hi);
296 pdf_PhaseI =
new TF1(
"pdf_PhaseI",
"[0] * (exp(-0.5*(x/[1])**2)/(sqrt(2*pi)*[1]) + [2] *exp(-0.5*(x/[3])**2)/(sqrt(2*pi)*[3]))", -100., 100.);
311 double n_inTimeAmp = 0.0;
328 bool isHGSaturated =
false;
358 for (
int imu = 0; imu<
mu; imu++){
363 ATH_MSG_VERBOSE(
"Random amplitudes for PU: " << amp_1 <<
" " << amp_2);
416 pdf = (
gain==1) ? pdf_hi : pdf_lo;
433 RandGaussQ::shootArray(*rngWrapper,
samples.size(), Rndm, 0.0, 1.0);
434 RandFlat::shootArray(*rngWrapper, 1, Rndm_dG, 0.0, 1.0);
435 for (
unsigned int js = 0; js <
samples.size(); ++js) {
437 if (Rndm_dG[0] <
Norm)
444 for (
unsigned int i = 0;
i <
samples.size(); ++
i) {
446 isHGSaturated =
true;
466 auto rawChannel = std::make_unique<TileRawChannel>(
digit->adc_HWID(),
491 for (
int i = 0;
i < 7;
i++)
520 auto rawChannel = std::make_unique<TileRawChannel>(
digit->adc_HWID(),
548 return StatusCode::SUCCESS;
564 return StatusCode::SUCCESS;
569 if (
file->IsZombie()) {
580 hist->SetBinContent(
i, 0.);
592 if (
file->IsZombie()) {
599 hists.push_back(std::vector<TH1F*>());
613 hist->SetBinContent(
i, 0.);
double m_ped_LG
Pedestal value for LG if specific channel pedestal is not used.
def retrieve(aClass, aKey=None)
bool makeDist(TFile *&file, TH1F *&hist, const std::string &fileName, const std::string &histName="h_Eopt_hi")
Method to read distribution from file.
virtual StatusCode finalize() override
finalize method
TileSampleBuffer * m_buf
Buffer class to hold generated pulses.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
double m_GNSigmaOne
Standard deviation of first gaussian of double gaussian noise.
void fillNSamples(double t0, double pedestal, double amp_it, const std::vector< float > &_pu, TF1 *pdf, bool addNoise, double itOffset=0, int nSamples=7, int nPul=21)
TileSampleGenerator * m_tsg
Pulse generating class.
const std::vector< double > & digitsFullShapeLo() const
Return shape vector with full binning to produce the TileDigits from sub-hits.
int m_nPul
number of pileup pulses
TilePulseShape * m_ps[2]
Class for defining pulse.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
std::vector< std::vector< TH1F * > > m_pileup_AmpDists
Matrix of PU amplitude distribution histograms (PU per partition and channel)
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const TileHWID * m_tileHWID
bool m_simQIE
Raw PMT pulses are generated if the option is set to true.
void getValueVector(std::vector< float > &vec)
TFile * m_pileup_AmpDistFile
File containing amplitude histograms for PU pulses.
std::string m_itADistHistName
Name of histogram for in-time amplitude distribution.
double m_ootOffset
Out-of-time pulse offset from nominal time.
bool m_useOffsetHisto
Internally used to keep track of wether a histogram has been opened or not.
std::vector< float > m_PUAmp
double m_imperfectionRms
RMS of pulse shape broadening.
bool m_chanPed
Use channel specific pedestal value if true.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
std::string m_ootOffsetHistName
Name of the histogram for timing offset distribution.
void fill7SamplesQIE(float amp_it, float *amp_pu)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
double m_ootAmp
Amplitude of out-of-time pulse.
int m_nSamples
number of read out samples
bool m_useItADist
Set to TRUE in order to use a distribution for the in-time amplitude instead of a constant value.
bool m_chanNoise
Add channel specific noise.
msgSvc
Provide convenience handles for various services.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_itADistFileName
Filename of file to use for amplitude distribution of in-time pulses.
const std::vector< double > & digitsFullShapeHi() const
Return shape vector with full binning to produce the TileDigits from sub-hits.
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainerKey
std::string m_pileupAmpDistFileName
Filename for PU amplitude distribution histograms.
Point Norm(const Point &a)
Helper for holding non-const raw data prior to recording in SG.
TH1F * m_ootDist
Histogram to hold the distribution of out-of-time amplitudes.
size_type adc_hash_max(void) const
ADC hash table max size.
std::string m_ootOffsetFileName
File name for offset timing distribution histogram.
const TileInfo * m_tileInfo
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service to use.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
double m_itOffset
In-time pulse offset from nominal time.
int scalePulse(double leftSF=1., double rightSF=1.)
double m_imperfectionMean
Mean value of pulse shape broadening.
bool m_useOotADist
Set to TRUE in order to use a distribution for the out-of-time amplitude instead of a constant value.
virtual StatusCode initialize() override
initialize method
int m_BunchSpacing
Time between pulses in ms 25, 50 or 75.
double m_GNAmpTwo
Amplitude of second gaussian of double gaussian noise.
A wrapper class for event-slot-local random engines.
std::string to_string(const DetectorType &type)
TH1F * m_ootOffsetDist
Histogram to hold the distribution of out-of-time timing offsets.
std::string m_ootADistHistName
Name of histogram for out-of-time amplitude distribution.
std::string m_ootADistFileName
Filename of file to use for amplitude distribution of out-of-time pulses.
HWIdentifier adc_id(int ros, int drawer, int channel, int adc) const
adc HWIdentifer
bool m_gaussNoise
Set to TRUE in order to create noise from double gaussian.
double m_GNSigmaTwo
Standard deviation of second gaussian of double gaussian noise.
TileDigitsFromPulse(const std::string &name, ISvcLocator *pSvcLocator)
Helper for holding non-const raw data prior to recording in SG.
double m_ped_HG
Pedestal value for HG if specific channel pedestal is not used.
int m_AmpDistLowLim
Set all bins to the left of this bin to 0 in the amplitude distribution histograms.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
virtual ~TileDigitsFromPulse()
float m_gausC2C
RMS for the in-time pulse offset (channel-to-channel phase variation)
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
TFile * m_itFile
File that holds the distribution of in-time amplitudes.
float m_pileUpFraction
Probability that an out-of-time component will be added.
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
void setPulseShape(TilePulseShape *ps)
TH1F * m_itDist
Histogram to hold the distribution of in-time amplitudes.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
double m_GNAmpOne
Amplitude of first gaussian of double gaussian noise.
TileRawChannelUnit::UNIT m_rChUnit
Units used for the TileRawChannels (ADC, pCb, etc.)(see TileInfo.h)
TileFragHash::TYPE m_rChType
Type of TileRawChannels (Digitizar, OF1, OF2, Fit, etc.)(see TileFragHash.h)
TFile * m_ootFile
File that holds the distribution of out-of-time amplitudes.
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
double m_inTimeAmp
Amplitude of in-time pulse.
void setPulseShape(const std::vector< double > &shapevec)
int ADCmax() const
Returns the maximum ADC output (10 bits --> 1023)
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
virtual StatusCode execute() override
execute method
TFile * m_ootOffsetFile
File that holds the distribution of out-of-time timing offsets.