138 fPlane = pset.get<
size_t >(
"Plane");
152 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
153 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clockData);
157 std::string fullFileName;
158 std::string corrAmpFileName;
160 cet::search_path searchPath(
"FW_SEARCH_PATH");
163 TFile inputFile(fullFileName.c_str(),
"READ");
165 if (!inputFile.IsOpen())
166 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to open input file: " <<
fInputNoiseHistFileName << std::endl;
170 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " <<
fCorrelatedHistogramName << std::endl;
174 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " <<
fUncorrelatedHistogramName << std::endl;
178 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " <<
fCorrelatedRMSHistoName << std::endl;
182 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " <<
fUncorrelatedRMSHistoName << std::endl;
186 throw cet::exception(
"NoiseFromHist::configure") <<
"Unable to recover desired histogram: " <<
fTotalRMSHistoName << std::endl;
190 std::cout <<
" corr nbins " << corrHistPtr->GetNbinsX() << std::endl;
191 std::cout <<
" uncorr nbins " << uncorrHistPtr->GetNbinsX() << std::endl;
195 for(
size_t histIdx = 0; histIdx < size_t(corrHistPtr->GetNbinsX()); histIdx++)
200 for(
size_t histIdx = 0; histIdx < size_t(uncorrHistPtr->GetNbinsX()); histIdx++)
204 std::cout <<
" after filling vectors " << std::endl;
208 art::ServiceHandle<art::TFileService>
tfs;
210 art::TFileDirectory* histDirectory = tfs.get();
213 art::TFileDirectory
dir = histDirectory->mkdir(Form(
"CorNoisePlane%1zu",
fPlane));
216 float readOutSize =
detProp.ReadOutWindowSize();
217 float maxFreq = 1.e6 / (2. * sampleRate);
218 float minFreq = 1.e6 / (2. * sampleRate * readOutSize);
219 int numSamples = readOutSize / 2;
221 fInputNoiseHist = dir.make<TProfile>(
"InNoise",
";freq(kHz)", numSamples, minFreq, maxFreq);
222 fMedianNoiseHist = dir.make<TProfile>(
"MedNoise",
";freq(kHz)", numSamples, minFreq, maxFreq);;
223 fPeakNoiseHist = dir.make<TProfile>(
"PeakNoise",
";freq(kHz)", numSamples, minFreq, maxFreq);;
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