207 double freq = ((double)itr->second) / deltaTus * 1000.;
229 for (
int i = 0; i < 100; ++i ) {
246 for (
int i = 0; i < 100; ++i ) {
254 std::vector<float> peakVec;
255 for (
int p = 0;
p < nPeaks; ++
p ) peakVec.push_back(peaks[
p]);
256 std::sort(peakVec.begin(),peakVec.end());
257 for (
int p = 1; p < nPeaks-1; ++
p ) {
258 double diff = peakVec.at(p+1) - peakVec.at(p);
259 if ( diff > 20 || diff < 10 ) {
266 ADCperPE /= double(nDiffs);
272 std::vector<float> peakVec;
273 for (
int p = 0; p < nPeaks; ++
p ) peakVec.push_back(peaks[p]);
274 std::sort(peakVec.begin(),peakVec.end());
275 for (
int p = 1; p < nPeaks-1; ++
p ) {
276 double diff = peakVec.at(p+1) - peakVec.at(p);
277 if ( diff > 1800 || diff < 1000 ) {
284 INTperPE /= double(nDiffs);
286 std::cout <<
"OpDet Channel " << i <<
" :\t LE " << ADCperPE <<
" ADC/PE" <<
"\t IC " << INTperPE <<
" charge/PE" <<
std::endl;
291 art::TFileDirectory RunDir = tfs->mkdir(
TString::Format(
"r%03i",
run.run()).
Data(),
"SSP Diagnostics by Run" );
292 for (
int i = 0; i < 100; ++i ) {
298 TString histTitle =
TString::Format(
"Average Waveform FFT for OP Channel %03i;f (MHz);power", i);
300 double Fmax = 1. / (2*dt);
311 for (
int i = 0; i < 100; ++i ) {
316 TString histName =
TString::Format(
"PulseAmpDistVsRun_channel_%03i", i);
317 TString histTitle =
TString::Format(
"Pulse Amplitude Distribution vs Run Number for OP Channel %03i;run number;leading-edge amplitude [ADC]", i);
318 PulseAmpVsRun[i] =
new TH2D( histName, histTitle, 1,
run.run(),
run.run()+1, 125, -20, 230 );
322 int firstRun = (
int)
std::min(
double(
run.run()), oldHist->GetXaxis()->GetBinLowEdge(1) );
323 int lastRun = (
int)
std::max(
double(
run.run()), oldHist->GetXaxis()->GetBinLowEdge( oldHist->GetNbinsX() ) );
324 PulseAmpVsRun[i] =
new TH2D( oldHist->GetName(), oldHist->GetTitle(), lastRun-firstRun+1, firstRun, lastRun+1, 125, -20, 230 );
325 for (
int binX = 0; binX <= oldHist->GetNbinsX(); ++binX ) {
326 for (
int binY = 0; binY <= oldHist->GetNbinsY(); ++binY ) {
327 double oldVal = oldHist->GetBinContent( binX, binY );
328 int runNum = oldHist->GetXaxis()->GetBinLowEdge( binX );
329 int targBin =
PulseAmpVsRun[i]->GetXaxis()->FindBin( runNum );
330 std::cout <<
"Transferring into new histogram: " << targBin <<
" " << binY <<
" " << oldVal <<
std::endl;
340 std::cout <<
"Filling histogram with " <<
run.run() <<
" " << amp <<
" " << val <<
"( PulseAmplitudePerChannel bin " << binY <<
" )" <<
std::endl;
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::map< int, TH1D * > waveformFFTs
std::map< int, TH1D * > PulseAmplitudePerChannel
unsigned long int lastTime
std::map< int, long int > triggerCount
std::map< int, TH1D * > IntegratedChargePerChannel
static int max(int a, int b)
Q_EXPORT QTSManip setw(int w)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
std::map< int, TH2D * > PulseAmpVsRun
std::map< int, TH2D * > PulseAmplitudeVsIntegratedChargePerChannel
std::map< int, TH2D * > averageWaveforms
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
unsigned long int firstTime
QTextStream & endl(QTextStream &s)
SSPReformatterAlgs sspReform