GeSpectrum Class Reference
[Modules]

This produces the height spectrum of the germanium based on timing cuts. More...

#include <GeSpectrum.h>

Inheritance diagram for GeSpectrum:
BaseModule

List of all members.

Public Member Functions

 GeSpectrum (modules::options *opts)
 Constructor description. If necessary, add a details tag like above.
 ~GeSpectrum ()
 Is anything done in the destructor?
int ProcessGenericEntry (TGlobalData *gData, const TSetupData *gSetup)
int Preprocess (TGlobalData *gData, const TSetupData *gSetup)
 Method called by the main pre-process loop.
int Postprocess (TGlobalData *gData, const TSetupData *gSetup)
 Method called by the main pre-process loop.
void SetAlias (const std::string &alias)
std::string GetAlias () const
const char * GetName () const
 Get the name of this module as given to the constructor of the base class.

Protected Member Functions

bool Debug () const
TDirectory * GetDirectory () const
 Get the TDirectory for this module.
TDirectory * GetDirectory (const std::string &name="")

Protected Attributes

TDirectory * dir

Private Member Functions

virtual int ProcessEntry (TGlobalData *gData, const TSetupData *gSetup)
 Histograms the heights in the germanium with time cuts relative to muSc.
virtual int BeforeFirstEntry (TGlobalData *gData, const TSetupData *setup)
 Does nothing.
virtual int AfterLastEntry (TGlobalData *gData, const TSetupData *setup)
 Does nothing.
std::vector< double > CalculateTimes (const IDs::channel &chan, const std::vector< TPulseIsland * > &tpis)
 Takes a vector of TPIs and calculates all of their times.
std::vector< double > CalculateEnergies (const IDs::channel &chan, const std::vector< TPulseIsland * > &tpis)
 Takes a vector of TPIs and calculates all of their energies.
void ThrowIfInputsInsane (const modules::options *)
void ThrowIfGeInsane (const std::vector< TPulseIsland * > &ge_fasts, const std::vector< TPulseIsland * > &ge_slows)
void RemovePileupMuScPulses (std::vector< double > &time, std::vector< double > &energy)

Private Attributes

TH1 * fHist_ADC
TH1 * fHist_Energy
TH1 * fHist_Time
TH1 * fHist_MoreTime
TH1 * fHist_ADCOOT
TH1 * fHist_EnergyOOT
TH1 * fHist_ADCFarOOT
TH1 * fHist_EnergyFarOOT
TH1 * fHist_TimeOOT
TH1 * fHist_TimeFarOOT
TH2 * fHist_TimeADC
TH2 * fHist_TimeEnergy
TH1 * fHist_MeanTOffset
const Algorithm::MaxBinAmplitude fMBAmpGe
const Algorithm::MaxBinAmplitude fMBAmpMuSc
const
Algorithm::ConstantFractionTime 
fCFTimeGe
const
Algorithm::ConstantFractionTime 
fCFTimeMuSc
TF1 * fADC2Energy
const double fTimeWindow_Small
const double fTimeWindow_Big
const double fPileupProtectionWindow

Static Private Attributes

static const IDs::channel fGeS
static const IDs::channel fGeF
static const IDs::channel fMuSc

Detailed Description

This produces the height spectrum of the germanium based on timing cuts.

Author:
John R Quirk

We look near muon entrances for the xrays and several microseconds away for longer lived nuclear decays. We also look at medium time distances for captures. These refer to the "Energy", "EnergyFarOOT" and "EnergyOOT" histograms respectively. Also plots time vs energy in tight window in TimeEnergy histogram, and looks for timing correlations with muSc in MeanTOffset within a MIDAS event (as each event might have a slightly different offset due to clock reset).

Definition at line 34 of file GeSpectrum.h.


Constructor & Destructor Documentation

GeSpectrum::GeSpectrum ( modules::options opts  ) 

Constructor description. If necessary, add a details tag like above.

Parameters:
[in] opts Describe the options this module takes.

Definition at line 30 of file GeSpectrum.cpp.

References BaseModule::dir, fADC2Energy, fHist_ADC, fHist_ADCFarOOT, fHist_ADCOOT, fHist_Energy, fHist_EnergyFarOOT, fHist_EnergyOOT, fHist_MeanTOffset, fHist_MoreTime, fHist_Time, fHist_TimeADC, fHist_TimeEnergy, fHist_TimeFarOOT, fHist_TimeOOT, fTimeWindow_Big, fTimeWindow_Small, SetupNavigator::GetEnergyCalibrationConstants(), SetupNavigator::Instance(), and ThrowIfInputsInsane().

00030                                            :
00031   BaseModule("GeSpectrum",opts),
00032   fHist_Energy(NULL), fHist_Time(NULL), fHist_MoreTime(NULL),
00033   fHist_EnergyOOT(NULL), fHist_EnergyFarOOT(NULL), fHist_TimeEnergy(NULL), fHist_MeanTOffset(NULL),
00034   fMBAmpGe(SetupNavigator::Instance()->GetPedestal(fGeS), TSetupData::Instance()->GetTriggerPolarity(TSetupData::Instance()->GetBankName(fGeS.str()))),
00035   fMBAmpMuSc(SetupNavigator::Instance()->GetPedestal(fMuSc), TSetupData::Instance()->GetTriggerPolarity(TSetupData::Instance()->GetBankName(fMuSc.str()))),
00036   fCFTimeGe(SetupNavigator::Instance()->GetPedestal(fGeF),
00037             TSetupData::Instance()->GetTriggerPolarity(TSetupData::Instance()->GetBankName(fGeF.str())),
00038             TSetupData::Instance()->GetClockTick(TSetupData::Instance()->GetBankName(fGeF.str())),
00039             SetupNavigator::Instance()->GetCoarseTimeOffset(IDs::source(fGeF, IDs::generator(opts->GetString("gef_gen"), opts->GetString("gef_cfg")))),
00040             opts->GetDouble("gef_cf")),
00041   fCFTimeMuSc(SetupNavigator::Instance()->GetPedestal(fMuSc),
00042               TSetupData::Instance()->GetTriggerPolarity(TSetupData::Instance()->GetBankName(fMuSc.str())),
00043               TSetupData::Instance()->GetClockTick(TSetupData::Instance()->GetBankName(fMuSc.str())),
00044               0.,
00045               opts->GetDouble("musc_cf")),
00046   fADC2Energy(new TF1("adc2energy","[0]*x+[1]")),
00047   fTimeWindow_Small(1000.), fTimeWindow_Big(5000.), fPileupProtectionWindow(15000.) {
00048   const static int nbins = std::pow(2.,14);
00049   const std::pair<double,double> adc2energy_par = SetupNavigator::Instance()->GetEnergyCalibrationConstants(IDs::channel("Ge-S"));
00050   fADC2Energy->SetParameters(adc2energy_par.first, adc2energy_par.second);
00051   TDirectory* cwd = TDirectory::CurrentDirectory();
00052   dir->cd();
00053   fHist_ADC          = new TH1D("hADC", "Energy of Gammas;Energy (ADC);Counts", nbins, 0., nbins);
00054 
00055   double energy_bin_width = 0.1; // keV
00056   double min_energy = 0;
00057   double max_energy = 2000;
00058   int n_energy_bins = (max_energy - min_energy) / energy_bin_width;
00059   fHist_Energy       = new TH1D("hEnergy", "Energy of Gammas;Energy (keV);Counts", n_energy_bins, min_energy, max_energy);
00060   fHist_Time         = new TH1D("hTime", "Time of Gammas within Energy Window", 1000, -10000., 10000.);
00061   fHist_MoreTime     = new TH1D("hMoreTime", "Time of Gammas within Energy Window (Wide)", 1000, -100000., 100000.);
00062   fHist_ADCOOT       = new TH1D("hADCOOT", "Energy of Gammas outside of Time Window;Energy (ADC);Counts", nbins, 0., nbins);
00063   fHist_EnergyOOT    = new TH1D("hEnergyOOT", "Energy of Gammas outside of Time Window;Energy (keV);Counts", n_energy_bins, min_energy, max_energy);
00064   fHist_ADCFarOOT    = new TH1D("hADCFarOOT", "Energy of Gammas far from Muons;Energy (ADC);Counts", nbins, 0., nbins);
00065   fHist_EnergyFarOOT = new TH1D("hEnergyFarOOT", "Energy of Gammas far from Muons;Energy (keV);Counts", n_energy_bins, min_energy, max_energy);
00066   fHist_TimeOOT      = new TH1D("hTimeOOT", "Time of Gammas outside of Time Window", 1000., -2.*fTimeWindow_Small, 2.*fTimeWindow_Small);
00067   fHist_TimeFarOOT   = new TH1D("hTimeFarOOT", "Time of Gammas far from Muons", 1000., -100.*fTimeWindow_Big, 100.*fTimeWindow_Big);
00068   fHist_TimeADC      = new TH2D("hTimeADC", "Energy of Gammas within Time Window;Energy (ADC);Time (ns);Counts", 100, -fTimeWindow_Small, fTimeWindow_Small, nbins, 0., nbins);
00069   fHist_TimeEnergy   = new TH2D("hTimeEnergy", "Energy of Gammas within Time Window;Energy (keV);Time (ns);Counts", 100, -fTimeWindow_Small, fTimeWindow_Small, n_energy_bins, min_energy, max_energy);
00070   fHist_MeanTOffset  = new TH1D("hMeanTOffset", "Mean offset from nearest muon taken over MIDAS event", 4000, -4.*fTimeWindow_Big, 4.*fTimeWindow_Big);
00071   cwd->cd();
00072   ThrowIfInputsInsane(opts);
00073 }

GeSpectrum::~GeSpectrum (  ) 

Is anything done in the destructor?

Definition at line 75 of file GeSpectrum.cpp.

00075                        {
00076 }


Member Function Documentation

int GeSpectrum::AfterLastEntry ( TGlobalData gData,
const TSetupData setup 
) [private, virtual]

Does nothing.

Parameters:
[in] gData See BaseModule::AfterLastEntry
[in] setup See BaseModule::AfterLastEntry
Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 225 of file GeSpectrum.cpp.

00225                                                                          {
00226   return 0;
00227 }

int GeSpectrum::BeforeFirstEntry ( TGlobalData gData,
const TSetupData setup 
) [private, virtual]

Does nothing.

Parameters:
[in] gData See BaseModule::BeforeFirstEntry
[in] setup See BaseModule::BeforeFirstEntry
Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 81 of file GeSpectrum.cpp.

00081                                                                            {
00082   return 0;
00083 }

std::vector< double > GeSpectrum::CalculateEnergies ( const IDs::channel chan,
const std::vector< TPulseIsland * > &  tpis 
) [private]

Takes a vector of TPIs and calculates all of their energies.

Definition at line 244 of file GeSpectrum.cpp.

References fGeS, fMBAmpGe, fMBAmpMuSc, and fMuSc.

Referenced by ProcessEntry().

00244                                                                                                           {
00245   std::vector<double> e;
00246   if (ch == fGeS)
00247     for (unsigned int i = 0; i < tpis.size(); ++i)
00248       e.push_back(fMBAmpGe(tpis[i]));
00249   else if (ch == fMuSc)
00250     for (unsigned int i = 0; i < tpis.size(); ++i)
00251       e.push_back(fMBAmpMuSc(tpis[i]));
00252   else
00253     throw std::logic_error("GeSpectrum: Invalid channel to calculate energies for.");
00254   return e;
00255 }

std::vector< double > GeSpectrum::CalculateTimes ( const IDs::channel chan,
const std::vector< TPulseIsland * > &  tpis 
) [private]

Takes a vector of TPIs and calculates all of their times.

Since we'll be using the std::upper_bound/stdlower_bound methods, this makes it possible to use the times of the TPIs without writing some hacky compare function (that would use the TAPAlgorithms).

Definition at line 230 of file GeSpectrum.cpp.

References fCFTimeGe, fCFTimeMuSc, fGeF, and fMuSc.

Referenced by ProcessEntry().

00230                                                                                                        {
00231   std::vector<double> t;
00232   if (ch == fMuSc)
00233     for (unsigned int i = 0; i < tpis.size(); ++i)
00234       t.push_back(fCFTimeMuSc(tpis[i]));
00235   else if (ch == fGeF)
00236     for (unsigned int i = 0; i < tpis.size(); ++i)
00237       t.push_back(fCFTimeGe(tpis[i]));
00238   else
00239     throw std::logic_error("GeSpectrum: Invalid channel to calculate times for.");
00240   return t;
00241 }

bool BaseModule::Debug (  )  const [inline, protected, inherited]
std::string BaseModule::GetAlias (  )  const [inline, inherited]

Returns a string for the alias of this module. May be empty if no alias was given in the modules file.

Definition at line 63 of file BaseModule.h.

References BaseModule::fAlias.

Referenced by BaseModule::BaseModule().

00063 {return fAlias;};

TDirectory * BaseModule::GetDirectory ( const std::string &  name = ""  )  [protected, inherited]

Definition at line 77 of file BaseModule.cpp.

References BaseModule::dir, and BaseModule::fDirectory.

00077                                                          {
00078   if(name.empty()) return fDirectory;
00079   TDirectory* dir=fDirectory->GetDirectory(name.c_str());
00080   if(dir) return dir;
00081   return fDirectory->mkdir(name.c_str());
00082 }

TDirectory* BaseModule::GetDirectory (  )  const [inline, protected, inherited]
const char* BaseModule::GetName (  )  const [inline, inherited]

Get the name of this module as given to the constructor of the base class.

Definition at line 66 of file BaseModule.h.

References BaseModule::fName.

Referenced by SavePulses::BeforeFirstEntry(), PlotTDPs::BeforeFirstEntry(), PlotTDP_TDiff::BeforeFirstEntry(), PlotTAP_Time::ProcessEntry(), PlotTAP_Energy::ProcessEntry(), PlotTAP_Amplitude::ProcessEntry(), and LoopSequence::Run().

00066 {return fName.c_str();};

int BaseModule::Postprocess ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main pre-process loop.

Does some simple work, then hooks into the derived class through AfterLastEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 66 of file BaseModule.cpp.

References BaseModule::AfterLastEntry(), and BaseModule::fDirectory.

Referenced by LoopSequence::Postprocess().

00066                                                                        {
00067   // This is called by our main routine and would allow later to split into different 
00068   // process routines if we have more than one Tree and hence different tpyes of data input.
00069 
00070   if(fDirectory) fDirectory->cd();
00071   int ret = AfterLastEntry(gData, gSetup);
00072   gDirectory->cd("/");
00073 
00074   return ret;
00075 }

int BaseModule::Preprocess ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main pre-process loop.

Does some simple work, then hooks into the derived class through BeforeFirstEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 55 of file BaseModule.cpp.

References BaseModule::BeforeFirstEntry(), and BaseModule::fDirectory.

Referenced by LoopSequence::Preprocess().

00055                                                                       {
00056   // This is called by our main routine and would allow later to split into different 
00057   // process routines if we have more than one Tree and hence different tpyes of data input.
00058 
00059   if(fDirectory) fDirectory->cd();
00060   int ret = BeforeFirstEntry(gData, gSetup);
00061   gDirectory->cd("/");
00062 
00063   return ret;
00064 }

int GeSpectrum::ProcessEntry ( TGlobalData gData,
const TSetupData gSetup 
) [private, virtual]

Histograms the heights in the germanium with time cuts relative to muSc.

Parameters:
[in] gData See BaseModule::ProcessEntry
[in] gSetup See BaseModule::ProcessEntry
Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 87 of file GeSpectrum.cpp.

References CalculateEnergies(), CalculateTimes(), fADC2Energy, fGeF, fGeS, fHist_ADC, fHist_ADCFarOOT, fHist_ADCOOT, fHist_Energy, fHist_EnergyFarOOT, fHist_EnergyOOT, fHist_MeanTOffset, fHist_TimeADC, fHist_TimeEnergy, fHist_TimeFarOOT, fHist_TimeOOT, fMuSc, TGlobalData::fPulseIslandToChannelMap, fTimeWindow_Big, fTimeWindow_Small, TSetupData::GetBankName(), TSetupData::Instance(), RemovePileupMuScPulses(), IDs::channel::str(), and ThrowIfGeInsane().

00087                                                                        {
00088 
00089   static const std::string bank_musc = TSetupData::Instance()->GetBankName(fMuSc.str());
00090   static const std::string bank_ges  = TSetupData::Instance()->GetBankName(fGeS.str());
00091   static const std::string bank_gef  = TSetupData::Instance()->GetBankName(fGeF.str());
00092 
00093   const std::map< std::string, std::vector<TPulseIsland*> >& TPIMap = gData->fPulseIslandToChannelMap;
00094   ThrowIfGeInsane(TPIMap.at(bank_ges), TPIMap.at(bank_gef));
00095   if (!(TPIMap.count(bank_musc) && TPIMap.count(bank_ges) && TPIMap.count(bank_gef)))
00096     return 0;
00097   else if (TPIMap.at(bank_musc).size() == 0 || TPIMap.at(bank_ges).size() == 0 || TPIMap.at(bank_gef).size() == 0)
00098     return 0;
00099 
00100   const std::vector<double> muScTimes  = CalculateTimes(fMuSc,   TPIMap.at(bank_musc));
00101   const std::vector<double> muScEnergies  = CalculateEnergies(fMuSc,   TPIMap.at(bank_musc));
00102   const std::vector<double> geTimes    = CalculateTimes(fGeF,    TPIMap.at(bank_gef));
00103   const std::vector<double> geEnergies = CalculateEnergies(fGeS, TPIMap.at(bank_ges));
00104   
00105   std::vector<double> muScTimesPP(muScTimes), muScEnergiesPP(muScEnergies);
00106   RemovePileupMuScPulses(muScTimesPP, muScEnergiesPP);
00107 
00108   //************************************//
00109   //***** First get average offset *****//
00110   //************************************//
00111   TH1I hTOff("hTOff", "Time Offset", 4000, -20000., 20000.);
00112   for (std::vector<double>::const_iterator geT = geTimes.begin(), prev = muScTimesPP.begin(), next;
00113        geT != geTimes.end();
00114        ++geT) {
00115     static const double unfound = 1e9;
00116     double dt[2] = {unfound, unfound}, &dt_prev = dt[0], &dt_next = dt[1];
00117     std::vector<double>::const_iterator end = muScTimesPP.end();
00118     next = std::upper_bound(prev, end, *geT);
00119     prev = next - 1;
00120     if (next == muScTimesPP.end())
00121       dt_prev = *geT - *prev;
00122     else if (next == muScTimesPP.begin()) {
00123       dt_next = *geT - *next;
00124       prev = next;
00125     } else {
00126       dt_prev = *geT - *prev;
00127       dt_next = *geT - *next;
00128     }
00129     
00130     for (unsigned int it = 0; it < 2; ++it)
00131       if (std::abs(dt[it]) < 20000.)
00132         hTOff.Fill(dt[it]);
00133 
00134   }
00135   double tOff = 0.;
00136   if (hTOff.Integral() > 1) {
00137     tOff = hTOff.GetMean();
00138     fHist_MeanTOffset->Fill(tOff);
00139   }
00140 
00141 
00142   //**************************//
00143   //***** Now make plots *****//
00144   //**************************//
00145   for (std::vector<double>::const_iterator geT = geTimes.begin(), geE = geEnergies.begin(), prev = muScTimesPP.begin(), next;
00146        geT != geTimes.end() && geE != geEnergies.end();
00147        ++geT, ++geE) {
00148     bool prev_found = false, next_found = false;
00149     double dt_prev, dt_next;
00150   
00151     // Find the time difference with the most recent muon
00152     // both before and after.
00153     std::vector<double>::const_iterator end = muScTimesPP.end();
00154     next = std::upper_bound(prev, end, *geT);
00155     prev = next - 1;
00156     if (next == muScTimesPP.end()) {
00157       dt_prev = *geT - *prev;
00158       prev_found = true;
00159     } else if (next == muScTimesPP.begin()) {
00160       dt_next = *geT - *next;
00161       next_found = true;
00162     } else {
00163       // The vast majority of cases are here
00164       dt_prev = *geT - *prev;
00165       dt_next = *geT - *next;
00166       prev_found = next_found = true;
00167     }
00168 
00169     // Plot energy
00170     if (( !prev_found || dt_prev > fTimeWindow_Big) && ( !next_found || dt_next < -fTimeWindow_Big) ) {
00171       fHist_ADCFarOOT->Fill(*geE);
00172       fHist_EnergyFarOOT->Fill(fADC2Energy->Eval(*geE));
00173     } else if ( (!prev_found || dt_prev > fTimeWindow_Small) && (!next_found || dt_next < -fTimeWindow_Small) ) {
00174       fHist_ADCOOT->Fill(*geE);
00175       fHist_EnergyOOT->Fill(fADC2Energy->Eval(*geE));
00176     } else {
00177       if (prev_found && dt_prev <= fTimeWindow_Small) {
00178         fHist_TimeADC->Fill(dt_prev, *geE);
00179         fHist_TimeEnergy->Fill(dt_prev, fADC2Energy->Eval(*geE));
00180       } else if (next_found && dt_next >= -fTimeWindow_Small) {
00181         fHist_TimeADC->Fill(dt_next, *geE);
00182         fHist_TimeEnergy->Fill(dt_next, fADC2Energy->Eval(*geE));
00183       } else {
00184         std::cout << "WARNING: Unexpected branch! Prev: (" << prev_found << ", " << dt_prev << "), Next: (" << next_found << ", " << dt_next << ")" << std::endl;
00185       }
00186     }
00187     fHist_ADC->Fill(*geE);
00188     fHist_Energy->Fill(fADC2Energy->Eval(*geE));
00189     // Plot time
00190     if (prev_found) {
00191       if (dt_prev > fTimeWindow_Big)
00192         fHist_TimeFarOOT->Fill(dt_prev);
00193       else if (dt_prev > fTimeWindow_Small)
00194         fHist_TimeOOT->Fill(dt_prev);
00195     }
00196     if (next_found) {
00197       if (dt_next < -fTimeWindow_Big)
00198         fHist_TimeFarOOT->Fill(dt_next);
00199       else if (dt_next < -fTimeWindow_Small)
00200         fHist_TimeOOT->Fill(dt_next);
00201     }
00202 
00203     // Silicon XRay
00204     //if (ge_energy >= 3260 && energy_ge <= 3290)
00205     // Aluminium XRay
00206     //if (*geE >= 340 && *geE <= 350) {
00207     // Mg27 Gamma
00208     // if (*geE >= 838 && *geE <= 848) {
00209     //   if (dt_prev != unfound) {
00210     //  fHist_Time->Fill(dt_prev);
00211     //  fHist_MoreTime->Fill(dt_prev);
00212     //   }
00213     //   if (dt_next != unfound) {
00214     //  fHist_Time->Fill(dt_next);
00215     //  fHist_MoreTime->Fill(dt_next);
00216     //   }
00217     // }
00218   }
00219   return 0;
00220 }

int BaseModule::ProcessGenericEntry ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main event loop for each entry in the input root tree. Does some simple work, then hooks into the derived class through ProcessEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 44 of file BaseModule.cpp.

References BaseModule::fDirectory, and BaseModule::ProcessEntry().

Referenced by LoopSequence::Process().

00044                                                                                {
00045   // This is called by our main routine and would allow later to split into different 
00046   // process routines if we have more than one Tree and hence different tpyes of data input.
00047 
00048   if(fDirectory) fDirectory->cd();
00049   int ret = ProcessEntry(gData, gSetup);
00050   gDirectory->cd("/");
00051 
00052   return ret;
00053 }

void GeSpectrum::RemovePileupMuScPulses ( std::vector< double > &  time,
std::vector< double > &  energy 
) [private]

Definition at line 280 of file GeSpectrum.cpp.

References fPileupProtectionWindow.

Referenced by ProcessEntry().

00280                                                                                   {
00281   if (t.empty()) return;
00282   std::vector<bool> rm(t.size(), false);
00283   if (t.front() < fPileupProtectionWindow) rm.front() = true;
00284   for (unsigned int i = 1; i < t.size(); ++i)
00285     if (t[i] - t[i-1] < fPileupProtectionWindow)
00286       rm[i] = rm[i-1] = true;
00287   rm.back() = true;
00288   for (unsigned int i = 0; i < t.size(); ++i) {
00289     if (rm[i]) {
00290       t.erase(t.begin()+i);
00291       e.erase(e.begin()+i);
00292       rm.erase(rm.begin()+i);
00293       --i;
00294     }
00295   }
00296 }

void BaseModule::SetAlias ( const std::string &  alias  )  [inline, inherited]

Sets the alias for this module, which should be provided in the modules file

Definition at line 59 of file BaseModule.h.

References BaseModule::fAlias.

Referenced by BaseModule::BaseModule().

00059 {fAlias=alias;};

void GeSpectrum::ThrowIfGeInsane ( const std::vector< TPulseIsland * > &  ge_fasts,
const std::vector< TPulseIsland * > &  ge_slows 
) [private]

Definition at line 258 of file GeSpectrum.cpp.

Referenced by ProcessEntry().

00258                                                                                                            {
00259   if (ge1s.size() != ge2s.size())
00260     throw std::logic_error("Fast and slow vectors are not same size!");
00261   for (std::vector<TPulseIsland*>::const_iterator ge1 = ge1s.begin(), ge2 = ge2s.begin(); ge1 != ge1s.end(); ++ge1, ++ge2)
00262     if ((*ge1)->GetTimeStamp() != (*ge2)->GetTimeStamp())
00263       throw std::logic_error("Fast and slow timestamps don't match up when getting time");
00264 }

void GeSpectrum::ThrowIfInputsInsane ( const modules::options opts  )  [private]

Definition at line 266 of file GeSpectrum.cpp.

References modules::options::GetDouble(), and modules::options::GetString().

Referenced by GeSpectrum().

00266                                                                {
00267   const std::string& gef_cfg = opts->GetString("gef_cfg");
00268   const double       gef_cf  = opts->GetDouble("gef_cf");
00269   const double       musc_cf = opts->GetDouble("musc_cf");
00270   const std::string  cf_str("constant_fraction=");
00271   std::stringstream ss(gef_cfg.substr(gef_cfg.find(cf_str) + cf_str.size()));
00272   double cf;
00273   ss >> cf;
00274   if (cf != gef_cf)
00275     throw std::logic_error("GeSpectrum: GeF CF in options don't match.");
00276   if (gef_cf <= 0. || gef_cf > 1. || musc_cf <= 0. || musc_cf > 1.)
00277     throw std::logic_error("GeSpectrum: CF are out of reasonable bounds (0. to 1.).");
00278 }


Member Data Documentation

TDirectory* BaseModule::dir [protected, inherited]

Many modules use 'dir' still which was the old protected pointer to the modules directory. To prevent things being broken so soon, we keep this pointer available, but be warned that it will be removed shortly...

Definition at line 98 of file BaseModule.h.

Referenced by BaseModule::BaseModule(), FastSlowCompare::FastSlowCompare(), GeSpectrum(), BaseModule::GetDirectory(), MakeMuonEvents::MakeMuonEvents(), and PlotAmpVsTDiff::PlotAmpVsTDiff().

TF1* GeSpectrum::fADC2Energy [private]

Definition at line 56 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 55 of file GeSpectrum.h.

Referenced by CalculateTimes().

Definition at line 55 of file GeSpectrum.h.

Referenced by CalculateTimes().

const IDs::channel GeSpectrum::fGeF [static, private]

Definition at line 64 of file GeSpectrum.h.

Referenced by CalculateTimes(), and ProcessEntry().

const IDs::channel GeSpectrum::fGeS [static, private]

Definition at line 63 of file GeSpectrum.h.

Referenced by CalculateEnergies(), and ProcessEntry().

TH1* GeSpectrum::fHist_ADC [private]

Definition at line 38 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 44 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

TH1* GeSpectrum::fHist_ADCOOT [private]

Definition at line 42 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

TH1* GeSpectrum::fHist_Energy [private]

Definition at line 39 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 45 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 43 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 50 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 41 of file GeSpectrum.h.

Referenced by GeSpectrum().

TH1* GeSpectrum::fHist_Time [private]

Definition at line 40 of file GeSpectrum.h.

Referenced by GeSpectrum().

TH2* GeSpectrum::fHist_TimeADC [private]

Definition at line 48 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 49 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 47 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

TH1* GeSpectrum::fHist_TimeOOT [private]

Definition at line 46 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

Definition at line 53 of file GeSpectrum.h.

Referenced by CalculateEnergies().

Definition at line 54 of file GeSpectrum.h.

Referenced by CalculateEnergies().

const IDs::channel GeSpectrum::fMuSc [static, private]

Definition at line 65 of file GeSpectrum.h.

Referenced by CalculateEnergies(), CalculateTimes(), and ProcessEntry().

const double GeSpectrum::fPileupProtectionWindow [private]

Definition at line 60 of file GeSpectrum.h.

Referenced by RemovePileupMuScPulses().

const double GeSpectrum::fTimeWindow_Big [private]

Definition at line 59 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().

const double GeSpectrum::fTimeWindow_Small [private]

Definition at line 58 of file GeSpectrum.h.

Referenced by GeSpectrum(), and ProcessEntry().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1