make_uDST.h File Reference

#include "NCUtils/NCType.h"
#include "NCUtils/NCRunUtil.h"
#include "JobControl/JobC.h"
#include "JobControl/JobCModule.h"
#include "Registry/Registry.h"
#include "Conventions/Detector.h"
#include "Conventions/BeamType.h"
#include "Conventions/ReleaseType.h"
#include "MCReweight/MCReweight.h"
#include "MCReweight/NeugenWeightCalculator.h"
#include <iostream>
#include <string>

Go to the source code of this file.

Enumerations

enum  EDataType {
  kUnknown = -1, kMC, kData, kMockData,
  kBlind, kElectron, kTau
}

Functions

void set_month (string m)
void set_detector (Detector::Detector_t _det)
void set_datatype (EDataType t)
void set_runperiod (NC::RunUtil::ERunType r)
string get_designator (Detector::Detector_t d, EDataType t)
void set_dir (string path)
void set_mc_version (ReleaseType::Release_t r)
void set_beamtype (BeamType::BeamType_t b)
void set_output (string path, string tag="")
void set_cuts (NCType::ECuts c)
void do_extractions (string codenames)
void set_file_limit (int limit)
void set_pdf_training_file (TString s)
void set_mda_mc_path (TString s)
void set_ann_use_lowE (bool useLowE)
void run ()

Variables

Registry reg
EDataType datatype = kUnknown
Detector::Detector_t det = Detector::kUnknown
BeamType::BeamType_t beamtype = BeamType::kUnknown
NC::RunUtil::ERunType runPeriod = NC::RunUtil::kRunAll
string month = ""

Enumeration Type Documentation

enum EDataType
Enumerator:
kUnknown 
kMC 
kData 
kMockData 
kBlind 
kElectron 
kTau 

Definition at line 15 of file make_uDST.h.

00015                {
00016   kUnknown=-1, kMC, kData, kMockData, kBlind, kElectron, kTau
00017 };


Function Documentation

void do_extractions ( string  codenames  ) 

Definition at line 197 of file make_uDST.h.

References Registry::Set().

00198 {
00199   reg.Set("ExtractionsList", codenames.c_str());
00200 }

string get_designator ( Detector::Detector_t  d,
EDataType  t 
)

Definition at line 58 of file make_uDST.h.

References datatype, kBlind, kData, kElectron, Detector::kFar, kMC, kMockData, Detector::kNear, and kTau.

Referenced by set_dir().

00059 {
00060   if(d==Detector::kFar){
00061     switch(datatype){
00062     case kMC:       return "f210";
00063     case kData:     // Fallthrough
00064     case kMockData: // Fallthrough
00065     case kBlind:
00066                     return "F";
00067     case kElectron: return "f214";
00068     case kTau:      return "f213";
00069     default: assert(0 && "Something went horribly wrong");
00070     }
00071   } else if(d==Detector::kNear){
00072     if(t==kMC) return "n";
00073     else return "N";
00074   }
00075 
00076   assert(0 && "Something Wrong: unknown detector");
00077 }

void run (  ) 

Definition at line 233 of file make_uDST.h.

References JobCModule::Config(), JobCPathModule::Create(), datatype, det, JobCModule::GetConfig(), jc, kElectron, Detector::kNear, kTau, Registry::LockKeys(), JobC::Msg, JobC::Path, JobCPathModule::Report(), runPeriod, Registry::Set(), JobCMsgModule::SetLevel(), JobCMsgModule::Stats(), and Registry::UnLockValues().

00234 {
00235 
00236   // Check we have a meaningful combination of options
00237   if (det==Detector::kNear && (datatype==kTau || datatype==kElectron)){
00238     assert(0 && "Tau/Electron files don't exist for ND");
00239   }
00240 
00241   reg.Set("UseAll185i", false); //use all -185kA data
00242   reg.Set("ReadPDFs", false);
00243   reg.Set("RunPeriod", (int)runPeriod);
00244 
00245   // According to some error message, this is done somewhere else...
00246   //MCReweight &mcReweight = MCReweight::Instance();
00247   //NeugenWeightCalculator *neugenWeightCal = new NeugenWeightCalculator;
00248   //mcReweight.AddWeightCalculator(neugenWeightCal);
00249 
00250   JobC jc;
00251 
00252   // set message service verbosity levels before creating path
00253   // so that messages from the constructor don't get lost
00254   jc.Msg.SetLevel("MicroDSTMaker","Info");
00255   jc.Msg.SetLevel("NCAnalysisUtils","Info");
00256   jc.Msg.SetLevel("NCAnalysisCuts","Info");
00257   jc.Msg.SetLevel("NCUtils","Info");
00258 
00259   //Create path
00260   jc.Path.Create("Analysis", "MicroDSTMaker::Ana");
00261 
00262   JobCModule& jm=jc.Path("Analysis").Mod("MicroDSTMaker");
00263 
00264   jm.GetConfig().UnLockValues();
00265   jm.GetConfig() = reg;
00266   jm.Config(jm.GetConfig());
00267   jm.GetConfig().LockKeys();
00268 
00269   jc.Path("Analysis").Run();
00270   //Job Report
00271   jc.Path("Analysis").Report();
00272   //Get Message Statistics
00273   jc.Msg.Stats();
00274 }

void set_ann_use_lowE ( bool  useLowE  ) 

Definition at line 226 of file make_uDST.h.

References Registry::Set().

00227 {
00228   reg.Set("RPAnnUseLowETrain", useLowE);
00229 }

void set_beamtype ( BeamType::BeamType_t  b  ) 

Definition at line 129 of file make_uDST.h.

References BeamType::AsString(), beamtype, and Registry::Set().

00130 {
00131   beamtype=b;
00132   reg.Set("BeamType", BeamType::AsString(beamtype));
00133 }

void set_cuts ( NCType::ECuts  c  ) 

Definition at line 190 of file make_uDST.h.

References Registry::Set().

00191 {
00192   reg.Set("CutSuite", int(c));
00193 }

void set_datatype ( EDataType  t  ) 

Definition at line 44 of file make_uDST.h.

References datatype.

00045 {
00046   datatype=t;
00047 }

void set_detector ( Detector::Detector_t  _det  ) 

Definition at line 36 of file make_uDST.h.

References det.

00037 {
00038   det=_det;
00039 }

void set_dir ( string  path  ) 

Definition at line 81 of file make_uDST.h.

References datatype, det, get_designator(), NC::RunUtil::kRunAll, NC::RunUtil::kRunI, NC::RunUtil::kRunII, NC::RunUtil::kRunIII, NC::RunUtil::kRunIV, NC::RunUtil::kRunIX, NC::RunUtil::kRunV, NC::RunUtil::kRunVI, NC::RunUtil::kRunVII, NC::RunUtil::kRunVIII, NC::RunUtil::kRunX, Detector::kUnknown, kUnknown, runPeriod, and Registry::Set().

00082 {
00083   assert(det!=Detector::kUnknown);
00084   assert(datatype!=kUnknown);
00085   string runPeriodStr;
00086   switch(runPeriod){
00087   case NC::RunUtil::kRunI:
00088     runPeriodStr="r1"; break;
00089   case NC::RunUtil::kRunII:
00090     runPeriodStr="r2"; break;
00091   case NC::RunUtil::kRunIII:
00092     runPeriodStr="r3"; break;
00093   case NC::RunUtil::kRunIV:
00094     runPeriodStr="r4"; break;
00095   case NC::RunUtil::kRunV:
00096     runPeriodStr="r5"; break;
00097   case NC::RunUtil::kRunVI:
00098     runPeriodStr="r6"; break;
00099   case NC::RunUtil::kRunVII:
00100     runPeriodStr="r7"; break;
00101   case NC::RunUtil::kRunVIII:
00102     runPeriodStr="r8"; break;
00103   case NC::RunUtil::kRunIX:
00104     runPeriodStr="r9"; break;
00105   case NC::RunUtil::kRunX:
00106     runPeriodStr="r10"; break;
00107   case NC::RunUtil::kRunAll:
00108     // This will happen for data
00109     runPeriodStr=""; break;
00110   default:
00111     assert(0 && "Unknown runPeriod");
00112   }
00113   //  string glob=path+"/"+
00114   //  get_designator(det, datatype)+"*"+runPeriodStr+"*.antp*.root";
00115   string glob=path+"/"+
00116     "antp_"+get_designator(det, datatype)+"*"+"_dogwood5_development.root";
00117   reg.Set("FilePath", glob.c_str());
00118 }

void set_file_limit ( int  limit  ) 

Definition at line 204 of file make_uDST.h.

References Registry::Set().

00205 {
00206   if(limit>0) reg.Set("FileCountLimit", limit);
00207 }

void set_mc_version ( ReleaseType::Release_t  r  ) 

Definition at line 122 of file make_uDST.h.

References Registry::Set().

00123 {
00124   reg.Set("MCVersion", r);
00125 }

void set_mda_mc_path ( TString  s  ) 

Definition at line 220 of file make_uDST.h.

References Registry::Set().

00221 {
00222   reg.Set("MDAMCPath", s.Data());
00223 }

void set_month ( string  m  ) 

Definition at line 29 of file make_uDST.h.

References month.

00030 {
00031   month=m;
00032 }

void set_output ( string  path,
string  tag = "" 
)

Definition at line 137 of file make_uDST.h.

References BeamType::AsString(), beamtype, datatype, det, Form(), kBlind, kData, kElectron, Detector::kFar, kMC, kMockData, Detector::kNear, NC::RunUtil::kRunAll, kTau, Detector::kUnknown, BeamType::kUnknown, kUnknown, month, runPeriod, and Registry::Set().

00138 {
00139   assert(det!=Detector::kUnknown);
00140   assert(datatype!=kUnknown);
00141   assert(beamtype!=BeamType::kUnknown);
00142   // Make sure the run period is set for MC
00143   assert(runPeriod!=NC::RunUtil::kRunAll || datatype==kData);
00144 
00145   string fileName(path+"/");
00146   if (det == Detector::kFar) fileName += "far";
00147   else if (det==Detector::kNear) fileName += "near";
00148   else assert(0 && "Unknown detector. Have you called set_detector?");
00149 
00150   fileName += "_";
00151   fileName += BeamType::AsString(beamtype);
00152   fileName += "_";
00153   // Only add "run<n>" to the filename if we've been given a specific runperiod
00154   // This means that data doesn't get one
00155   if(runPeriod!=NC::RunUtil::kRunAll){
00156     // This relies on NC::RunUtil::kRunI == 1 etc, which is indeed the case
00157     fileName += Form("run%d_", (int)runPeriod);
00158   }
00159 
00160   switch(datatype){
00161   case kMC:
00162     fileName += "mc";
00163     break;
00164   case kElectron:
00165     fileName += "electron";
00166     break;
00167   case kTau:
00168     fileName += "tau";
00169     break;
00170   case kData:
00171     fileName += "data_"+month;
00172     break;
00173   case kMockData: 
00174     fileName += "mock";
00175     break;
00176   case kBlind:
00177     fileName += "blind";
00178     break;
00179   case kUnknown:
00180     assert(0 && "datatype not set");
00181   }
00182 
00183   fileName += tag+".uDST.root";
00184 
00185   reg.Set("FileName", fileName.c_str());
00186 }

void set_pdf_training_file ( TString  s  ) 

Definition at line 213 of file make_uDST.h.

References Registry::Set().

00214 {
00215   reg.Set("ExtractionPDFTrainingFilePath", s.Data());
00216 }

void set_runperiod ( NC::RunUtil::ERunType  r  ) 

Definition at line 51 of file make_uDST.h.

References runPeriod.

00052 {
00053   runPeriod=r;
00054 }


Variable Documentation

BeamType::BeamType_t beamtype = BeamType::kUnknown
EDataType datatype = kUnknown

Definition at line 21 of file make_uDST.h.

Referenced by get_designator(), run(), set_datatype(), set_dir(), and set_output().

Detector::Detector_t det = Detector::kUnknown

Definition at line 22 of file make_uDST.h.

Referenced by ANtpInfoObjectFillerMRCC::ABPID(), NueExtrapolationJB::AddChain(), BDSwicPedAccessor::AddDevice(), NCExtrapolationPID::AddEvent(), NC::MockDataAdder::AddEventsToExtrapolations(), NC::RealDataAdder::AddEventsToExtrapolations(), NC::SplitFakeDataAdder::AddEventsToExtrapolations(), NC::FakeDataAdder::AddEventsToExtrapolations(), NuFCEventManager::AddFile(), NCExtrapolationModule::AddShiftedEventToExtrapolations(), TridModel::AddStrip(), NueSensitivity::Ana(), MCTrueAna::ana(), CondensedNtpModuleNC::Ana(), CondensedNtpModuleAtm::Ana(), CondensedNtpModule::Ana(), ShieldRejVarAna::Analyze(), EventQualAna::Analyze(), ANtpShowerInfoAna::Analyze(), ANtpEventInfoAna::Analyze(), PlexStripEndId::AsString(), PlexScintMdlId::AsString(), PlexPlaneId::AsString(), UgliStripNode::BackConstructVldContext(), CompareMST::BeginJob(), BfldCanvasSlice::BfldCanvasSlice(), blockname(), MINFLST::BookHits(), MINFFLS::BookHits(), MINFEMU::BookHits(), RotoClientBinaryFile::BuildBeamMonFileName(), RotoServer::BuildDaqBaseName(), RotoClientBinaryFile::BuildDAQFileName(), RotoServer::BuildDcsBaseName(), RotoClientBinaryFile::BuildDCSFileName(), DbuDaqFileModule::BuildExtContextAndSelect(), RunFileModule::BuildFileOUT(), PlexScintMdlId::BuildPlnMdlKey(), PlexStripEndId::BuildPlnStripEndKey(), UgliGeometry::BuildVldRange(), GeoGeometry::BuildVldRange(), NuHistos::CalcPOTsFromHistos(), BDCheckDB::CheckSpill(), UgliLoanPool::Config(), NueExtrapolationJB::CreateOscHist(), MadTVAnalysis::CreatePAN(), MadTestAnalysis::CreatePAN(), MadMKAnalysis::CreatePAN(), DbiValidityRecBuilder::DbiValidityRecBuilder(), LIRawNtAna::Demo(), LIRawNtAna::DemoOpenFile(), MadScanDisplay::Display(), MadEvDisplay::Display(), NuDSTAna::DoIO(), NCExtrapolationBeamMatrix::DoneFilling(), NueSystematic::DoShwDevCalc(), NueSystematic::DoSKZPCalc(), MadScanDisplay::DrawTextBox(), MadEvDisplay::DrawTextBox(), dump_peds(), FileGap::DumpMissing(), BDataQualityModule::EndFile(), CoilTools::ExtendedQuery(), NuExtraction::ExtractNCInfo(), UgliDbiStripStruct::Fill(), UgliDbiStrip::Fill(), UgliDbiSteelPln::Fill(), UgliDbiScintPlnStruct::Fill(), UgliDbiScintPln::Fill(), UgliDbiScintMdlStruct::Fill(), UgliDbiScintMdl::Fill(), PulserRefDriftPin::Fill(), PulserRawGainPin::Fill(), PulserRawDriftPin::Fill(), PulserGainPin::Fill(), PulserDriftPin::Fill(), PlexVetoShieldMuxToMdl::Fill(), PlexStripEndToLed::Fill(), PlexRawChannelToPinDiode::Fill(), PlexRawChannelReadoutType::Fill(), PlexPixelToRawChannel::Fill(), PlexPixelSpotToStripEnd::Fill(), PlexPinDiodeToLed::Fill(), FabPlnInstall::Fill(), DbuVaChipSpars::Fill(), DbuVaChipPeds::Fill(), DbuSubRunSummary::Fill(), DbuRunSummary::Fill(), DbuDaqFileSummary::Fill(), BfldDbiPlaneMap::Fill(), BfieldCoilCurrent::Fill(), RawQieErrorStatsBlock::FillAllMaps(), RawDeadChipBlock::FillDeadChannels(), BDataQualityModule::FillFile(), ANtpShowerInfoAna::FillGapInformation(), ExtrapHistsGen::FillHistograms(), NuHistos::FillMatrixMethodNCHistos(), NuFCExperimentFactoryNSI::FillMCEvents(), NuFCExperimentFactory::FillMCEvents(), NtpMCModule::FillNtpMCDetSimResult(), RawOvershootBlock::FillOvershootChannels(), NCBeam::FillResultHistograms(), FilterChannelsT1102(), FilterChannelsT702(), MakeAlignmentModule::FitTrackLessOne(), DetectorAlignment::FitTrackLessOne(), MadAnalysis::GetDataPOT(), TrackDirectionModule::GetDirectionalCosines(), MiniPlotMaker::GetDirectory(), FileGap::GetFileBounds(), NueExtrapolationJB::GetFNRatio(), NCExtractionANN::GetIdProbability(), MadAnalysis::GetNumDataEvents(), Plexus::GetRawChannelId(), NuCutImps::ChairSound::GetRegion(), NueStandard::GetRPWBeamWeight(), NCEventInfo::GetShowerEnergy(), MadAnalysis::GetSignalFracInData(), NuZBeamReweight::GetSKZPWeightCalculatorCustom(), TemperatureCalScheme::GetTemperature(), NCEventInfo::GetTrackEnergy(), Zbeam::GetWeight(), SKZPWeightCalculator::GetWeight(), BeamEnergyCalculator::GetWeight(), NuZBeamReweight::GetWeightHelium(), UgliGeometry::GetZExtent(), NCAnalysisCutsNC::InFiducialVolumeTrue(), NCExtrapolation::InitializeInterpolator(), NCAnalysisCuts::IsGoodShower(), BFLVorOperator::IsInTheCircle(), LoadBeamMomentum(), LoadCERRange(), LoadCERTimeWin(), LoadOverlapWin(), LoadTOFRange(), main(), NueExtrapolationJB::MakeDataHistograms(), Zbeam::MakeHistogram(), ValVtxModule::MakeIdString(), CompareMD::MakeIdString(), CompareAll::MakeIdString(), NNTrain::MakeTrainTree(), MeuPlots::MakeValidationPlots(), NuMMHelperPRL::NuMMHelperPRL(), NCExtractionCuts::PassesCCCuts(), MCNNRunner::PassesMCNNPrecuts(), NCExtractionCutswkNN::PassesNCCuts(), NCExtractionCuts::PassesNCCuts(), NueStandard::PassesParticlePIDPreselectionCut(), pmt_plot(), NueExtrapolationJB::PrepareExtrapHistograms(), DbuDaqMonitorModule::ProcessRawRecord(), DbuDaqFileModule::ProcessRawRecord(), DbmModule::Query(), RawLIHeader::RawLIHeader(), ParticleFinder::Reco(), MergeEvent::Reco(), AutoPIDMaker::Reco(), NC::EventAdderBase::ReportOnEventInfo(), BField::ResetVldContext(), run(), Anp::FillMadId::Run(), AlgCalDetSI::RunAlg(), RunFileModule::RunFileOUT(), MiniMaker::RunMiniMaker(), MiniMakerPID::RunMiniMakerPID(), Trimmer::RunTrimmer(), StndBmsSpin::Scan(), STND_BMS::Scan(), BMS_STND::Scan(), DbiCache::Search(), MBSpillAccessor::SeekClosest(), BDSpillAccessor::SeekClosest(), set_detector(), set_dir(), set_output(), EVD::SetChargeRange(), AlgTrack::SetdS(), NCExtrapolationModule::SetEventWeight(), Zbeam::SetReweightConfig(), AlgShowerSR::SetUV(), AlgTrack::SetUVZ(), BField::SMGapAndEndField(), PlotPeds::Start(), PlotAllPeds::Start(), VldValidate::TestContext(), SRMom::TrackEndDistZEnd(), ParticleTrimmer::trimPOT(), RawTpSinglesSummaryBlock::UnpackQieRates(), RawTpSinglesSummaryBlock::UnpackVaRates(), RawCrateMonitorBlock::UnpackVfbMonitors(), EVD::UpdateChargeHists(), Mint::UpdateDigitRanges(), Mint::UpdateStripRanges(), FillBadChannelDB::WriteAllBadToDatabase(), NCExtrapolationPID::WriteResources(), FillBadChannelDB::WriteToDatabase(), DbuDaqMonitorModule::WriteVaChipPedsEntry(), and DbuDaqMonitorModule::WriteVaChipSparsEntry().

string month = ""

Definition at line 19 of file make_uDST.h.

NC::RunUtil::ERunType runPeriod = NC::RunUtil::kRunAll

Generated on 14 Dec 2017 for loon by  doxygen 1.6.1