147 fPlane = pset.get<
size_t >(
"Plane");
152 std::vector<float> noiseFracVec = pset.get< std::vector<float> >(
"IncoherentNoiseFraction", std::vector<float>());
153 for(
auto& noiseFrac : noiseFracVec) {
159 std::vector<std::string> noiseToolParamSetVec = pset.get< std::vector<std::string> >(
"NoiseHistFileName", std::vector<std::string>());
160 for(
auto& noiseToolParams : noiseToolParamSetVec) {
170 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
171 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clockData);
176 std::string fullFileName;
178 cet::search_path searchPath(
"FW_SEARCH_PATH");
180 searchPath.find_file(
filename, fullFileName);
182 std::cout <<
" fullfilename;" << fullFileName << std::endl;
184 std::cout <<
"uncorrelated histo name: " << fUncorrelatedHistogramName << std::endl;
185 TFile inputFile(fullFileName.c_str(),
"READ");
187 if (!inputFile.IsOpen())
188 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to open input file: " <<
filename << std::endl;
192 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " <<
fCorrelatedHistogramName << std::endl;
194 TH1D* uncorrHistPtr = (TH1D*)inputFile.Get(fUncorrelatedHistogramName.c_str());
195 if (!inputFile.Get(fUncorrelatedHistogramName.c_str()))
196 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " << fUncorrelatedHistogramName << std::endl;
198 corrRMSHistPtr.push_back((TH1D*)inputFile.Get(fCorrelatedRMSHistoName.c_str()));
199 if (!inputFile.Get(fCorrelatedRMSHistoName.c_str()))
200 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " << fCorrelatedRMSHistoName << std::endl;
202 uncorrRMSHistPtr.push_back((TH1D*)inputFile.Get(fUncorrelatedRMSHistoName.c_str()));
203 if (!inputFile.Get(fUncorrelatedRMSHistoName.c_str()))
204 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " << fUncorrelatedRMSHistoName << std::endl;
206 totalRMSHistPtr.push_back((TH1D*)inputFile.Get(fTotalRMSHistoName.c_str()));
207 if (!inputFile.Get(fTotalRMSHistoName.c_str()))
208 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " << fTotalRMSHistoName << std::endl;
213 std::cout <<
" corr hist nbins " << corrHistPtr->GetNbinsX() << std::endl;
214 std::cout <<
" uncorr hist nbins " << uncorrHistPtr->GetNbinsX() << std::endl;
216 corvec.resize(corrHistPtr->GetNbinsX(), 0.);
219 for(
size_t histIdx = 0; histIdx < size_t(corrHistPtr->GetNbinsX()); histIdx++)
220 corvec[histIdx] = corrHistPtr->GetBinContent(histIdx+1);
223 incvec.resize(uncorrHistPtr->GetNbinsX(), 0.);
226 for(
size_t histIdx = 0; histIdx < size_t(uncorrHistPtr->GetNbinsX()); histIdx++)
227 incvec[histIdx] = uncorrHistPtr->GetBinContent(histIdx+1);
232 std::cout <<
" after filling vectors " << std::endl;
236 art::ServiceHandle<art::TFileService>
tfs;
238 art::TFileDirectory* histDirectory = tfs.get();
241 art::TFileDirectory
dir = histDirectory->mkdir(Form(
"CorNoisePlane%1zu",
fPlane));
244 float readOutSize =
detProp.ReadOutWindowSize();
245 float maxFreq = 1.e6 / (2. * sampleRate);
246 float minFreq = 1.e6 / (2. * sampleRate * readOutSize);
247 int numSamples = readOutSize / 2;
249 fInputNoiseHist = dir.make<TProfile>(
"InNoise",
";freq(kHz)", numSamples, minFreq, maxFreq);
250 fMediaNoiseHist = dir.make<TH1D>(
"MedNoise",
";ADC", 100, -10., -10.);;
251 fPeakNoiseHist = dir.make<TProfile>(
"PeakNoise",
";freq(kHz)", numSamples, minFreq, maxFreq);;
256 const auto& channelMap = art::ServiceHandle<icarusDB::IICARUSChannelMap const>{}.get();
260 for(
const auto& boardPair : readoutBoardToChannelMap)
BEGIN_PROLOG could also be dds filename
std::vector< SigProcPrecision > TimeVec
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap
art::ServiceHandle< art::TFileService > tfs
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
BEGIN_PROLOG could also be cout