Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
fnex::CompareFNEXCAFEventListFiles Class Reference
Inheritance diagram for fnex::CompareFNEXCAFEventListFiles:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 CompareFNEXCAFEventListFiles (fhicl::ParameterSet const &p)
 
 CompareFNEXCAFEventListFiles (CompareFNEXCAFEventListFiles const &)=delete
 
 CompareFNEXCAFEventListFiles (CompareFNEXCAFEventListFiles &&)=delete
 
CompareFNEXCAFEventListFilesoperator= (CompareFNEXCAFEventListFiles const &)=delete
 
CompareFNEXCAFEventListFilesoperator= (CompareFNEXCAFEventListFiles &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void reconfigure (fhicl::ParameterSet const &p)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

void ReadFNEXTree_FillEventListMap (std::string, std::string)
 
void ReadCAFMCTextFile (std::string)
 
void ReadCAFDataTextFile (std::string)
 
double NeutrinoE (double, double, std::string)
 
void ReadEventListNew (TTree *, std::string const &)
 

Private Attributes

std::string fFNEXEventListFile
 
std::string fCAFTextFile
 
art::ServiceHandle< art::TFileServicefTFS
 
std::set< fnex::MCEventInfo_structset_mceventinfo_caf
 
std::set< fnex::MCEventInfo_structset_mceventinfo_caf_duplicate
 
std::set< fnex::MCEventInfo_structset_mceventinfo_fnex
 
std::set< fnex::MCEventInfo_structset_mceventinfo_fnex_duplicate
 
std::set< fnex::DataEventInfo_structset_dataeventinfo_caf
 
std::set< fnex::DataEventInfo_structset_dataeventinfo_caf_duplicate
 
std::set< fnex::DataEventInfo_structset_dataeventinfo_fnex
 
std::set< fnex::DataEventInfo_structset_dataeventinfo_fnex_duplicate
 
std::set< intset_runs_caf
 
std::set< intset_runs_caf_not_in_fnex
 
std::set< intset_runs_fnex
 
std::set< intset_runs_fnex_not_in_caf
 
std::set< EventInfo_struct_RunSubrunCycleset_event_run_subrun_cycle_caf
 
std::set< EventInfo_struct_RunSubrunCycleset_event_run_subrun_cycle_fnex
 
std::ofstream caf_duplicate
 
std::ofstream caf_non_duplicate
 
std::ofstream caf_all
 
std::ofstream caf_all_NuMuCC
 
std::ofstream caf_all_NuMuBarCC
 
std::ofstream caf_all_NuECC
 
std::ofstream caf_all_NuEBarCC
 
std::ofstream caf_all_NuTauCC
 
std::ofstream caf_all_NuTauBarCC
 
std::ofstream caf_all_NC
 
std::ofstream caf_all_CosmicMuon
 
std::ofstream fnex_duplicate
 
std::ofstream fnex_non_duplicate
 
std::ofstream fnex_all
 
std::ofstream fnex_all_NuMuCC
 
std::ofstream fnex_all_NuMuBarCC
 
std::ofstream fnex_all_NuECC
 
std::ofstream fnex_all_NuEBarCC
 
std::ofstream fnex_all_NuTauCC
 
std::ofstream fnex_all_NuTauBarCC
 
std::ofstream fnex_all_NC
 
std::ofstream fnex_all_CosmicMuon
 
std::ofstream summary
 
bool fUseEventId
 
bool fUseNewTrees
 
osc::OscCalcPMNSOpt fOscCalc
 
TH1F * h_fnex_reconue_without_xseccv
 
TH1F * h_fnex_reconue_with_xseccv
 
fnex::FileType_t fFileType
 get from the configuration for now More...
 
fnex::SelectionType_t fSelectionTypes
 get from the analysis configuration More...
 
novadaq::cnv::DetId fDetectorType
 
std::set< std::stringfEpochsToUse
 which epochs to use in the analysis More...
 
std::string fAnalysisYear
 Analysis year. Options 2016 (for SA), 2017 (for TA) etc. More...
 
std::string fSampleType
 Core or Peripheral sample for the 2017 FD nue analysis only. More...
 
fnex::BeamType_t fBeamType
 Is it FHC or RHC analysis. More...
 
int count_nu_on_e_events = 0
 Count nu_on_e FNEX events. More...
 
int count_total_event = 0
 Total FNEX events. More...
 

Detailed Description

Definition at line 362 of file CompareFNEXCAFEventListFiles_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

fnex::CompareFNEXCAFEventListFiles::CompareFNEXCAFEventListFiles ( fhicl::ParameterSet const &  p)
explicit

Definition at line 456 of file CompareFNEXCAFEventListFiles_module.cc.

References reconfigure().

457  :
458  EDAnalyzer(p) // ,
459  // More initializers here.
460 {
461  this->reconfigure(p);
462 
463  return;
464 }
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
fnex::CompareFNEXCAFEventListFiles::CompareFNEXCAFEventListFiles ( CompareFNEXCAFEventListFiles const &  )
delete
fnex::CompareFNEXCAFEventListFiles::CompareFNEXCAFEventListFiles ( CompareFNEXCAFEventListFiles &&  )
delete

Member Function Documentation

void fnex::CompareFNEXCAFEventListFiles::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 559 of file CompareFNEXCAFEventListFiles_module.cc.

References fCAFTextFile, fFNEXEventListFile, and ReadFNEXTree_FillEventListMap().

560 {
561  //Read Eventlist tree and fill FNEX map
562  //this function works if the evelist tree has the slice information
564 
565 }//end of analyze
void ReadFNEXTree_FillEventListMap(std::string, std::string)
void fnex::CompareFNEXCAFEventListFiles::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 554 of file CompareFNEXCAFEventListFiles_module.cc.

555 {
556  return;
557 }
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
double fnex::CompareFNEXCAFEventListFiles::NeutrinoE ( double  hadE,
double  lepE,
std::string  metadataName 
)
private

Definition at line 956 of file CompareFNEXCAFEventListFiles_module.cc.

References fAnalysisYear, and LOG_DEBUG.

Referenced by ReadEventListNew(), and ReadFNEXTree_FillEventListMap().

958  {
959 
960  //numu selection neutrino energy
961  if(metadataName.find("NuMuSel") != std::string::npos)
962  return (hadE + lepE);
963 
964  //nue selection neutrino energy
965  else if(metadataName.find("NuESel") != std::string::npos){
966 
967  //2018 Analysis
968  if(fAnalysisYear.compare("2018") == 0){
969  // FHC
970  if(metadataName.find("FHC") != std::string::npos){
971  LOG_DEBUG("CompareFNEXCAFEventListFiles::NeutrinoE")
972  << "2017 FHC analysis";
973 
974  return 1.0/(1.0 + 0.0501206) * ((0.227129 * hadE * hadE) +
975  (0.0128608 * lepE * lepE) +
976  (0.0 * lepE * hadE) +
977  (1.07093 * hadE ) +
978  (1.00756 * lepE ) +
979  0.000);
980  }//FHC
981 
982  else if(metadataName.find("RHC") != std::string::npos){
983  LOG_DEBUG("CompareFNEXCAFEventListFiles::NeutrinoE")
984  << "2018 RHC analysis";
985 
986  return 1.0/(1.0 + 0.001766 ) * ((-0.227599 * hadE * hadE) +
987  (-0.00582609 * lepE * lepE) +
988  (0.0 * lepE * hadE) +
989  (1.45170 * hadE ) +
990  (0.980479 * lepE ) +
991  0.000);
992  }//RHC
993  }//end of 2018 analysis condiction
994 
995  //2017 energy
996  else if(fAnalysisYear.compare("2017") == 0)
997  return 1.0/(1.0+0.057) *(( 0.504 * hadE * hadE ) +
998  ( 0.025 * lepE * lepE ) +
999  ( 0.000 * lepE * hadE ) +
1000  ( 0.869 * hadE ) +
1001  ( 0.996 * lepE ) +
1002  0.000);
1003  //2016 energy
1004  else
1005  return (0.687 + 0.702*lepE + 1.211*hadE + 0.543*lepE*hadE + 0.248*lepE*lepE - 0.140*hadE*hadE);
1006  }
1007 
1008  return -99999.;
1009 }//end of NeutrinoE function
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::string fAnalysisYear
Analysis year. Options 2016 (for SA), 2017 (for TA) etc.
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
CompareFNEXCAFEventListFiles& fnex::CompareFNEXCAFEventListFiles::operator= ( CompareFNEXCAFEventListFiles const &  )
delete
CompareFNEXCAFEventListFiles& fnex::CompareFNEXCAFEventListFiles::operator= ( CompareFNEXCAFEventListFiles &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void fnex::CompareFNEXCAFEventListFiles::ReadCAFDataTextFile ( std::string  CAFTextFile)
private

Definition at line 1637 of file CompareFNEXCAFEventListFiles_module.cc.

References bins, caf_all, caf_duplicate, caf_non_duplicate, confusionMatrixTree::count, fnex::DEFINE_ART_MODULE(), allTimeWatchdog::endl, fAnalysisYear, Fill(), fSelectionTypes, fTFS, ana::kCVNe, ana::kCycle, ana::kHadE, ana::kNMichels, fnex::kNuESelection, fnex::kNuMuSelection, PandAna.weight.cv_weights::kRPAWeightCCQE(), kRun, kSlice, kSpillPOT, ana::kSubrun, fnex::kTrueE, LOG_DEBUG, LOG_VERBATIM, art::TFileDirectory::make(), set_dataeventinfo_caf, set_dataeventinfo_caf_duplicate, set_event_run_subrun_cycle_caf, set_runs_caf, and summary.

Referenced by ReadFNEXTree_FillEventListMap().

1637  {
1638 
1639  //Print the name of the CAF file
1640  LOG_VERBATIM("CompareFNEXCAFEventListFiles::ReadCAFDataTextFile")
1641  << "CAF Data text file is: "
1642  << CAFTextFile;
1643 
1644  summary << "CAF Data file is: " << CAFTextFile << std::endl;
1645 
1646  //Text file to store CAF duplicate events
1647  caf_all .open("caf_all.txt"); //CAF all events
1648  //caf_duplicate .open("caf_duplicate.txt"); //CAF duplicate events
1649  //caf_non_duplicate .open("caf_non_duplicate.txt"); //CAF non-duplicate events
1650 
1651  //CAF reconstructed neutrino energies with and without Xseccv weights
1652  TH1F* h_caf_reconue_without_xseccv;
1653  TH1F* h_caf_reconue_with_xseccv;
1654 
1655  //Different bining for 2017 style
1656  Float_t bins[] = {0, 0.75, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 5.};
1657  Int_t binnum = sizeof(bins)/sizeof(Float_t) - 1;
1658 
1659  if(fAnalysisYear.compare("2017") == 0){
1660  h_caf_reconue_without_xseccv = fTFS->make<TH1F>("h_caf_reconue_without_xseccv", ";E^{#nu}_{reco} (GeV);Events", binnum, bins);
1661  h_caf_reconue_with_xseccv = fTFS->make<TH1F>("h_caf_reconue_with_xseccv", ";E^{#nu}_{reco} (GeV);Events", binnum, bins);
1662  }
1663  else{
1664  h_caf_reconue_without_xseccv = fTFS->make<TH1F>("h_caf_reconue_without_xseccv", ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
1665  h_caf_reconue_with_xseccv = fTFS->make<TH1F>("h_caf_reconue_with_xseccv", ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
1666  }
1667 
1668  //count to find if we are correctly counting all CAF rows
1669  int count = 0;
1670 
1671  std::ifstream in_caf;
1672 
1673  //open caf file
1674  in_caf.open(CAFTextFile);
1675 
1676  //Abort the job if CAF file is not found
1677  if(!in_caf){
1678  LOG_VERBATIM("CompareFNEXCAFEventListFiles::ReadCAFDataTextFile")
1679  << "CAF data File does not exists. ABORTING..."
1680  << " " ;
1681  abort();
1682  }
1683 
1684  //declaration of the variable found in the CAF file
1685  int kRun = 0 ;
1686  int kSubrun = 0 ;
1687  int kEvent = 0 ;
1688  int kCycle = 0 ;
1689  int kSlice = 0 ;
1690  int kDet = 0 ;
1691  int kNMichels = 0 ;
1692 
1693  double kTrueE = 0.;
1694  double kHadE = 0.;
1695  double kLepE = 0.;
1696  double kNueE = 0.;
1697  double kRPAWeightCCQE = 0.;
1698  double kXseccvWeightCC= 0.;
1699  double kCVNe = 0.;
1700  double fHadEFrac = 0.;
1701  double fPPFXWeight = 0.;
1702  double kXSecCVWgt = 0.;
1703 
1704  float kSpillPOT = 0.;
1705 
1706  bool kIsMC = false ;
1707  bool kIsGoodSpill = false ;
1708 
1709  //read the CAF file and reads in various variables
1710  while(1){
1711 
1712  //read variables from CAF file for numu selection
1714  if(fAnalysisYear.compare("2018") == 0){
1715  in_caf
1716  >> kRun
1717  >> kSubrun
1718  >> kCycle
1719  >> kEvent
1720  >> kSlice
1721  >> kTrueE
1722  >> kHadE
1723  >> kLepE
1724  >> kNueE
1725  >> fHadEFrac
1726  >> kNMichels
1727  >> kXSecCVWgt
1728  >> fPPFXWeight
1729  >> kIsMC
1730  >> kDet
1731  >> kSpillPOT
1732  >> kIsGoodSpill;
1733  }//end of condition that it is a 2018 analysis
1734  else if(fAnalysisYear.compare("2017") == 0){
1735  in_caf
1736  >> kRun
1737  >> kSubrun
1738  >> kEvent
1739  >> kSlice
1740  >> kHadE
1741  >> kLepE
1742  >> kNueE
1743  >> fHadEFrac
1744  >> kRPAWeightCCQE
1745  >> kXseccvWeightCC
1746  >> fPPFXWeight
1747  >> kIsMC
1748  >> kDet
1749  >> kSpillPOT
1750  >> kIsGoodSpill;
1751  }//end of condition that it is a 2017 analysis
1752  else{
1753  in_caf
1754  >> kRun
1755  >> kSubrun
1756  >> kEvent
1757  >> kSlice
1758  >> kHadE
1759  >> kLepE
1760  >> kNueE
1761  >> kRPAWeightCCQE
1762  >> kXseccvWeightCC
1763  >> kIsMC
1764  >> kDet
1765  >> kSpillPOT
1766  >> kIsGoodSpill;
1767  }//end of condition that it is a 2016 analysis
1768  }//end of condition that these are numu selected events
1769  else{
1770  if(fAnalysisYear.compare("2017") == 0 ||
1771  fAnalysisYear.compare("2018") == 0){
1772  in_caf
1773  >> kRun
1774  >> kSubrun
1775  >> kCycle
1776  >> kEvent
1777  >> kSlice
1778  >> kTrueE
1779  >> kHadE
1780  >> kLepE
1781  >> kNueE
1782  >> kCVNe
1783  >> kNMichels
1784  >> kXSecCVWgt
1785  >> fPPFXWeight
1786  >> kIsMC
1787  >> kDet
1788  >> kSpillPOT
1789  >> kIsGoodSpill;
1790  }//end of condition that it is a 2017 or 2018 analysis
1791  else{
1792  in_caf
1793  >> kRun
1794  >> kSubrun
1795  >> kEvent
1796  >> kSlice
1797  >> kCycle
1798  >> kHadE
1799  >> kLepE
1800  >> kNueE
1801  >> kCVNe
1802  >> kNMichels
1803  >> kRPAWeightCCQE
1804  >> kXseccvWeightCC
1805  >> kIsMC
1806  >> kDet
1807  >> kSpillPOT
1808  >> kIsGoodSpill;
1809  }//end of condition that it is a 2016 analysis
1810  }//end of condition that selected events are nue selected
1811 
1812  if(!in_caf.good()) break;
1813 
1814  ++count;
1815 
1816  LOG_DEBUG("ReadCAFDataTextFile")
1817  << "Counting CAF enetris: "
1818  << count;
1819 
1820  DataEventInfo_struct eventinfo_caf;
1821 
1822  //Let us assign Cycle number a value -5 for data events
1823  //and True neutrino energy at -1
1824  //because CAF also does the same
1825  kCycle = -5;
1826  kTrueE = -1.;
1827  if((fAnalysisYear.compare("2017") == 0 || fAnalysisYear.compare("2018") == 0) && fSelectionTypes == fnex::kNuESelection)
1828  eventinfo_caf = DataEventInfo_struct(kRun, kSubrun, kCycle, kEvent, kSlice, kTrueE, kHadE, kLepE, kNueE, kXSecCVWgt*fPPFXWeight, kCVNe);
1829  else
1830  eventinfo_caf = DataEventInfo_struct(kRun, kSubrun, kCycle, kEvent, kSlice, kTrueE, kHadE, kLepE, kNueE, kXseccvWeightCC);
1831 
1832  //Save all CAF events
1833  caf_all << eventinfo_caf;
1834 
1835  //fill caf runs in a std::set
1836  set_runs_caf.insert(kRun);
1837 
1838  //fill run, subrun and cycle in a set
1839  set_event_run_subrun_cycle_caf.insert(EventInfo_struct_RunSubrunCycle(kRun, kSubrun, kCycle));
1840 
1841  //Fill CAF histograms with and without Xseccv weights
1842  h_caf_reconue_without_xseccv ->Fill(kNueE);
1843  if(fAnalysisYear.compare("2017") == 0 ||
1844  fAnalysisYear.compare("2018") == 0) h_caf_reconue_with_xseccv ->Fill(kNueE, kXseccvWeightCC*fPPFXWeight);
1845  else h_caf_reconue_with_xseccv ->Fill(kNueE, kXseccvWeightCC);
1846 
1847  //check if the element is already present in list or not
1848  //If it is already present then write it into a
1849  //caf_duplicate text file
1850  //If not present then save the information in a set
1851  //
1852  //Find the event
1853  auto itr_caf_find = set_dataeventinfo_caf.find(eventinfo_caf);
1854 
1855  //Event found
1856  if(itr_caf_find != set_dataeventinfo_caf.end()){
1857 
1858  // Let's not print the duplicate list of events
1859  //caf_duplicate << *itr_caf_find;
1860 
1861  //Fill duplicate events in a set so that we can prevent this
1862  //event from saving into a non-duplicate set
1863  set_dataeventinfo_caf_duplicate.insert(*itr_caf_find);
1864 
1865  }//caf duplicate event found
1866  //Event not found
1867  //OR it is a unique event
1868  else{
1869  set_dataeventinfo_caf.insert(eventinfo_caf);
1870  }
1871 
1872  LOG_DEBUG("ReadCAFDataTextFile")
1873  << "CAF set: "
1874  << " Run "
1875  << kRun
1876  << " ,Subrun "
1877  << kSubrun
1878  << " ,Cycle: "
1879  << kCycle
1880  << " ,Event "
1881  << kEvent
1882  << " ,Slice: "
1883  << kSlice
1884  << " ,TrueneuE "
1885  << kTrueE
1886  << " ,HadE "
1887  << kHadE
1888  << " ,LepE "
1889  << kLepE
1890  << " ,NueE "
1891  << kNueE
1892  << std::endl;
1893  }//end of while condition
1894 
1895  //Remove duplicate events from the caf full set
1896  for(auto itr_caf_duplicate = set_dataeventinfo_caf_duplicate.begin(); itr_caf_duplicate != set_dataeventinfo_caf_duplicate.end(); ++itr_caf_duplicate){
1897  LOG_DEBUG("ReadCAFDataTextFile")
1898  << " CAF duplicate event: "
1899  << *itr_caf_duplicate;
1900 
1901  //remove the event if duplicate event is found in the CAF set
1902  auto find_duplicate = set_dataeventinfo_caf.find(*itr_caf_duplicate);
1903  if(find_duplicate != set_dataeventinfo_caf.end()){
1904  LOG_DEBUG("ReadCAFDataTextFile")
1905  << "FOUND duplicate event in CAF set: "
1906  << *find_duplicate;
1907  set_dataeventinfo_caf.erase(*find_duplicate);
1908  }//condition remove the event if duplicate event is found in the CAF set
1909  }//end of condition Remove duplicate events from the fnex full set
1910 
1911  //Loop over caf set and write the text file with non-duplicate events
1912  // Let's not print the non-duplicate list
1913  //for(auto itr_caf = set_dataeventinfo_caf.begin(); itr_caf != set_dataeventinfo_caf.end(); ++itr_caf){
1914 
1915  // caf_non_duplicate << *itr_caf;
1916 
1917  //}//end of looping over all non-duplicate caf events
1918 
1919  LOG_VERBATIM("ReadCAFDataTextFile")
1920  << " Size of CAF set: "
1921  << set_dataeventinfo_caf.size()
1922  << " and entries in caf file are: "
1923  << count;
1924 
1925  summary << "Size of caf set : " << set_dataeventinfo_caf.size() << std::endl;
1926  summary << "Entries in CAF file : " << count << std::endl;
1927 
1928  caf_duplicate .close();
1929  caf_non_duplicate .close();
1930  caf_all .close();
1931 
1932  //Normalize histograms to their bin size for 2017 analysis
1933 // if(fAnalysisYear.compare("2017") == 0){
1934 // for(int i = 1; i < h_caf_reconue_without_xseccv->GetNbinsX()+1; ++i){
1935 //
1936 // if(h_caf_reconue_without_xseccv->GetBinContent(i) > 0)
1937 // LOG_VERBATIM("ReadCAFDataTextFile")
1938 // << "CAF 2017 Normalizing --- Bin: "
1939 // << i
1940 // << " BinContent: "
1941 // << h_caf_reconue_without_xseccv->GetBinContent(i)
1942 // << " Bin width : "
1943 // << h_caf_reconue_without_xseccv ->GetBinWidth(i)
1944 // << " New BinContent: "
1945 // << h_caf_reconue_without_xseccv->GetBinContent(i)*(0.1/h_caf_reconue_without_xseccv->GetBinWidth(i));
1946 //
1947 // if(h_caf_reconue_without_xseccv->GetBinContent(i) > 0) h_caf_reconue_without_xseccv ->SetBinContent(i, h_caf_reconue_without_xseccv->GetBinContent(i)*(0.1/h_caf_reconue_without_xseccv->GetBinWidth(i)) );
1948 // if(h_caf_reconue_with_xseccv ->GetBinContent(i) > 0) h_caf_reconue_with_xseccv ->SetBinContent(i, h_caf_reconue_with_xseccv ->GetBinContent(i)*(0.1/h_caf_reconue_with_xseccv ->GetBinWidth(i)) );
1949 // }//end of loop over binning
1950 // }//end of condition that it is a 2017 Analysis
1951 
1952  return;
1953 }//end of ReadCAFDataTextFile
const Var kHadE
Definition: NumuVars.h:23
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::set< fnex::DataEventInfo_struct > set_dataeventinfo_caf
const Var kCVNe
PID
Definition: Vars.cxx:35
fnex::SelectionType_t fSelectionTypes
get from the analysis configuration
const Var kSubrun
Definition: Vars.cxx:21
std::set< fnex::DataEventInfo_struct > set_dataeventinfo_caf_duplicate
art::ServiceHandle< art::TFileService > fTFS
correl_yv Fill(-(dy[iP-1][iC-1]), hyv->GetBinContent(iP, iC))
def kRPAWeightCCQE(tables, weight)
Definition: cv_weights.py:44
const Binning bins
const Var kCycle
Definition: Vars.cxx:22
const SpillVar kSpillPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})
const Var kNMichels([](const caf::SRProxy *sr){int n_me=0;for(int i=0;i< (int) sr->me.nslc;i++) if(sr->me.slc[i].mid > 1. &&sr->me.slc[i].deltat > 1200.) n_me++;for(int i=0;i< (int) sr->me.nkalman;i++) if(sr->me.trkkalman[i].mid > 0. &&sr->me.trkkalman[i].deltat > 800.) n_me++;if(n_me > 2) n_me=2;return n_me;})
Number of SlcME&#39;s assoc with slice.
Definition: Vars.h:85
T * make(ARGS...args) const
std::string fAnalysisYear
Analysis year. Options 2016 (for SA), 2017 (for TA) etc.
static const unsigned char kTrueE
Definition: VarVals.h:42
const SpillVar kRun([](const caf::SRSpillProxy *spill){return spill->run;})
const Var kSlice
std::set< EventInfo_struct_RunSubrunCycle > set_event_run_subrun_cycle_caf
#define LOG_VERBATIM(category)
void fnex::CompareFNEXCAFEventListFiles::ReadCAFMCTextFile ( std::string  CAFTextFile)
private

Definition at line 1012 of file CompareFNEXCAFEventListFiles_module.cc.

References bins, caf_all, caf_all_CosmicMuon, caf_all_NC, caf_all_NuEBarCC, caf_all_NuECC, caf_all_NuMuBarCC, caf_all_NuMuCC, caf_all_NuTauBarCC, caf_all_NuTauCC, caf_duplicate, caf_non_duplicate, confusionMatrixTree::count, allTimeWatchdog::endl, fAnalysisYear, Fill(), fOscCalc, fSelectionTypes, fTFS, osc::_IOscCalcAdjustable< T >::GetdCP(), osc::_IOscCalcAdjustable< T >::GetDmsq21(), osc::_IOscCalcAdjustable< T >::GetDmsq32(), osc::_IOscCalcAdjustable< T >::GetL(), osc::_IOscCalcAdjustable< T >::GetRho(), osc::_IOscCalcAdjustable< T >::GetTh12(), osc::_IOscCalcAdjustable< T >::GetTh13(), osc::_IOscCalcAdjustable< T >::GetTh23(), ana::kCVNe, ana::kCycle, ana::kHadE, ana::xsec::numubarcc::kIsCC, ana::kNMichels, fnex::kNuESelection, fnex::kNuMuSelection, PandAna.Demos.tute_pid_validation::kPDG, PandAna.weight.cv_weights::kRPAWeightCCQE(), kRun, kSlice, kSpillPOT, ana::kSubrun, fnex::kTrueE, LOG_DEBUG, LOG_VERBATIM, art::TFileDirectory::make(), osc::_OscCalcPMNSOpt< T >::P(), set_mceventinfo_caf, and set_mceventinfo_caf_duplicate.

Referenced by ReadFNEXTree_FillEventListMap().

1012  {
1013 
1014  LOG_DEBUG("ReadCAFMCTextFile")
1015  << "Oscillation Parameters.";
1016  LOG_VERBATIM("ReadCAFMCTextFile") << "L : " << fOscCalc.GetL() ;
1017  LOG_VERBATIM("ReadCAFMCTextFile") << "#rho : " << fOscCalc.GetRho() ;
1018  LOG_VERBATIM("ReadCAFMCTextFile") << "Dmsq21 : " << fOscCalc.GetDmsq21() ;
1019  LOG_VERBATIM("ReadCAFMCTextFile") << "Dmsq32 : " << fOscCalc.GetDmsq32() ;
1020  LOG_VERBATIM("ReadCAFMCTextFile") << "Th12 : " << fOscCalc.GetTh12() ;
1021  LOG_VERBATIM("ReadCAFMCTextFile") << "Th13 : " << fOscCalc.GetTh13() ;
1022  LOG_VERBATIM("ReadCAFMCTextFile") << "Th23 : " << fOscCalc.GetTh23() ;
1023  LOG_VERBATIM("ReadCAFMCTextFile") << "dCP : " << fOscCalc.GetdCP() ;
1024 
1025  //Print the name of the CAF file
1026  LOG_VERBATIM("CompareFNEXCAFEventListFiles::ReadCAFMCTextFile")
1027  << "CAF text file is: "
1028  << CAFTextFile;
1029 
1030  //plot of CAF Events vs. Neutrino Energy
1031  //All events in the CAF file are used to fill this histogram
1032 
1033  //Text file to store CAF duplicate events
1034  //caf_duplicate .open("caf_duplicate.txt" ); // CAF duplicate events
1035  //caf_non_duplicate .open("caf_non_duplicate.txt" ); // CAF non-duplicate events
1036  caf_all .open("caf_all.txt" ); // CAF all events
1037  caf_all_NuMuCC .open("caf_all_NuMuCC.txt" ); // NuMu CC
1038  caf_all_NuMuBarCC .open("caf_all_NuMuBarCC.txt" ); // NuMu Bar CC
1039  caf_all_NuECC .open("caf_all_NuECC.txt" ); // NuE CC
1040  caf_all_NuEBarCC .open("caf_all_NuEBarCC.txt" ); // NuE Bar CC
1041  caf_all_NuTauCC .open("caf_all_NuTauCC.txt" ); // NuTau CC
1042  caf_all_NuTauBarCC .open("caf_all_NuTauBarCC.txt" ); // NuTau Bar CC
1043  caf_all_NC .open("caf_all_NC.txt" ); // NC
1044  caf_all_CosmicMuon .open("caf_all_CosmicMuon.txt" ); // Cosmic Muons
1045 
1046  //CAF plot of oscillation spectra
1047  TH1F* h_caf_osc_unextrap = fTFS->make<TH1F>("h_caf_osc_unextrap", ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
1048 
1049  //CAF reconstructed neutrino energies with and without Xseccv weights
1050  TH1F* h_caf_reconue_without_xseccv;
1051  TH1F* h_caf_reconue_with_xseccv;
1052 
1053 
1054  //Different bining for 2017 style
1055  Float_t bins[] = {0, 0.75, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 5.};
1056  Int_t binnum = sizeof(bins)/sizeof(Float_t) - 1;
1057 
1058  if(fAnalysisYear.compare("2017") == 0){
1059  h_caf_reconue_without_xseccv = fTFS->make<TH1F>("h_caf_reconue_without_xseccv", ";E^{#nu}_{reco} (GeV);Events", binnum, bins);
1060  h_caf_reconue_with_xseccv = fTFS->make<TH1F>("h_caf_reconue_with_xseccv", ";E^{#nu}_{reco} (GeV);Events", binnum, bins);
1061  }
1062  else{
1063  h_caf_reconue_without_xseccv = fTFS->make<TH1F>("h_caf_reconue_without_xseccv", ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
1064  h_caf_reconue_with_xseccv = fTFS->make<TH1F>("h_caf_reconue_with_xseccv", ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
1065  }
1066 
1067 
1068  //count to find if we are correctly counting all CAF rows
1069  int count = 0;
1070 
1071  std::ifstream in_caf;
1072 
1073  //open caf file
1074  in_caf.open(CAFTextFile);
1075 
1076  //Abort the job if CAF file is not found
1077  if(!in_caf){
1078  LOG_VERBATIM("CompareFNEXCAFEventListFiles::ReadCAFMCTextFile")
1079  << "CAF File does not exists. ABORTING..."
1080  << " ";
1081  abort();
1082  }
1083 
1084  //declaration of the variable found in the CAF file
1085  int kRun = 0 ;
1086  int kSubrun = 0 ;
1087  int kCycle = 0 ;
1088  int kEvent = 0 ;
1089  int kSlice = 0 ;
1090  int kPDGOrig = 0 ;
1091  int kPDG = 0 ;
1092  int kIntType = 0 ;
1093  int kPDG_parent = 0 ;
1094  int kParentDecay = 0 ;
1095  int kPDG_ParentTarget = 0 ;
1096  int kDet = 0 ;
1097  int kNMichels = 0 ;
1098 
1099  double kTrueE = 0.;
1100  double kHadE = 0.;
1101  double kLepE = 0.;
1102  double kNueE = 0.;
1103  double kRPAWeightCCQE = 1.;
1104  double kXseccvWeightCC = 1.;
1105  double kCVNe = 0.;
1106  double fHadEFrac = 0.;
1107  double fPPFXWeight = 1.;
1108  double kXSecCVWgt = 1.;
1109 
1110  float kParentPZ = 0.;
1111  float kParentPT = 0.;
1112  float kSpillPOT = 0.;
1113 
1114  bool kIsCC = false;
1115  bool kIsMC = false;
1116  bool kIsGoodSpill = false;
1117 
1118  //read the CAF file and reads in various variables
1119  while(1){
1120 
1121  //read variables from CAF file for numu selection
1123  if(fAnalysisYear.compare("2018") == 0){
1124  in_caf
1125  >> kRun
1126  >> kSubrun
1127  >> kCycle
1128  >> kEvent
1129  >> kSlice
1130  >> kTrueE
1131  >> kHadE
1132  >> kLepE
1133  >> kNueE
1134  >> fHadEFrac
1135  >> kNMichels
1136  >> kXSecCVWgt
1137  >> fPPFXWeight
1138  >> kIsMC
1139  >> kDet
1140  >> kSpillPOT
1141  >> kIsGoodSpill
1142  >> kPDGOrig
1143  >> kPDG
1144  >> kIsCC;
1145  }//end of condition that it is a 2018 analysis
1146  else if(fAnalysisYear.compare("2017") == 0){
1147  in_caf
1148  >> kRun
1149  >> kSubrun
1150  >> kEvent
1151  >> kSlice
1152  >> kCycle
1153  >> kTrueE
1154  >> kHadE
1155  >> kLepE
1156  >> kNueE
1157  >> fHadEFrac
1158  >> kRPAWeightCCQE
1159  >> kXSecCVWgt
1160  >> fPPFXWeight
1161  >> kIsMC
1162  >> kDet
1163  >> kSpillPOT
1164  >> kIsGoodSpill;
1165  }//end of condition that it is a 2017 analysis
1166  else{
1167  in_caf
1168  >> kRun
1169  >> kSubrun
1170  >> kEvent
1171  >> kSlice
1172  >> kCycle
1173  >> kTrueE
1174  >> kHadE
1175  >> kLepE
1176  >> kNueE
1177  >> kPDGOrig
1178  >> kPDG
1179  >> kIsCC
1180  >> kIntType
1181  >> kPDG_parent
1182  >> kParentDecay
1183  >> kPDG_ParentTarget
1184  >> kParentPZ
1185  >> kParentPT
1186  >> kRPAWeightCCQE
1187  >> kXseccvWeightCC
1188  >> kIsMC
1189  >> kDet
1190  >> kSpillPOT
1191  >> kIsGoodSpill;
1192  }//end of condition that it is a 2016 analysis
1193  }//end of condition that these are numu selected events
1194  else{
1195  if(fAnalysisYear.compare("2018") == 0){
1196  in_caf
1197  >> kRun
1198  >> kSubrun
1199  >> kCycle
1200  >> kEvent
1201  >> kSlice
1202  >> kTrueE
1203  >> kHadE
1204  >> kLepE
1205  >> kNueE
1206  >> kCVNe
1207  >> kNMichels
1208  >> kXSecCVWgt
1209  >> fPPFXWeight
1210  >> kIsMC
1211  >> kDet
1212  >> kSpillPOT
1213  >> kIsGoodSpill
1214  >> kPDGOrig
1215  >> kPDG
1216  >> kIsCC;
1217  }//end of condition that it is a 2018 analysis
1218  else if(fAnalysisYear.compare("2017") == 0){
1219  in_caf
1220  >> kRun
1221  >> kSubrun
1222  >> kCycle
1223  >> kEvent
1224  >> kSlice
1225  >> kTrueE
1226  >> kHadE
1227  >> kLepE
1228  >> kNueE
1229  >> kCVNe
1230  >> kNMichels
1231  >> kXSecCVWgt
1232  >> fPPFXWeight
1233  >> kIsMC
1234  >> kDet
1235  >> kSpillPOT
1236  >> kIsGoodSpill;
1237  }//end of condition that it is a 2017 analysis
1238  else{
1239  in_caf
1240  >> kRun
1241  >> kSubrun
1242  >> kEvent
1243  >> kSlice
1244  >> kCycle
1245  >> kTrueE
1246  >> kHadE
1247  >> kLepE
1248  >> kNueE
1249  >> kCVNe
1250  >> kNMichels
1251  >> kPDGOrig
1252  >> kPDG
1253  >> kIsCC
1254  >> kIntType
1255  >> kPDG_parent
1256  >> kParentDecay
1257  >> kPDG_ParentTarget
1258  >> kParentPZ
1259  >> kParentPT
1260  >> kRPAWeightCCQE
1261  >> kXseccvWeightCC
1262  >> kIsMC
1263  >> kDet
1264  >> kSpillPOT
1265  >> kIsGoodSpill;
1266  }//end of condition that it is a 2016 analysis
1267  }//end of condition that selected events are nue selected
1268 
1269  if(!in_caf.good()) break;
1270 
1271  ++count;
1272  LOG_DEBUG("ReadCAFMCTextFile")
1273  << "Counting CAF enetris: "
1274  << count;
1275 
1276  if(kTrueE==0){
1277  LOG_VERBATIM("CompareFNEXCAFEventListFiles::ReadCAFMCTextFile")
1278  << "CAF event with zero true nuE:: "
1279  << " True nuE: "
1280  << kTrueE;
1281 
1282  continue;
1283  }
1284 
1285  MCEventInfo_struct eventinfo_caf;
1286 
1287  if(fAnalysisYear.compare("2017") == 0 ||
1288  fAnalysisYear.compare("2018") == 0){
1289 
1291  eventinfo_caf = MCEventInfo_struct(kRun, kSubrun, kCycle, kEvent, kSlice, kTrueE, kHadE, kLepE, kNueE, kXSecCVWgt*fPPFXWeight, kIsCC, kPDG);
1292 
1294  eventinfo_caf = MCEventInfo_struct(kRun, kSubrun, kCycle, kEvent, kSlice, kTrueE, kHadE, kLepE, kNueE, kXSecCVWgt*fPPFXWeight, kIsCC, kPDG, kCVNe);
1295  }//end of condition that it is a 2017 analysis
1296 
1297  else
1298  eventinfo_caf = MCEventInfo_struct(kRun, kSubrun, kCycle, kEvent, kSlice, kTrueE, kHadE, kLepE, kNueE, kXseccvWeightCC, kIsCC, kPDG);
1299 
1300  //Save all CAF events
1301  caf_all << eventinfo_caf;
1302 
1303  //Save CAF files for different interactions
1304  // kIsCC is true for CC and false for NC interactions
1305  if(kIsCC == true){
1306  if(kPDG == +12) caf_all_NuECC << eventinfo_caf;
1307  else if(kPDG == -12) caf_all_NuEBarCC << eventinfo_caf;
1308  else if(kPDG == +14) caf_all_NuMuCC << eventinfo_caf;
1309  else if(kPDG == -14) caf_all_NuMuBarCC << eventinfo_caf;
1310  else if(kPDG == +16) caf_all_NuTauCC << eventinfo_caf;
1311  else if(kPDG == -16) caf_all_NuTauBarCC << eventinfo_caf;
1312  }// CC interactions
1313  // NC interactions
1314  else if(kIsCC == false) caf_all_NC << eventinfo_caf;
1315  // Also fill cosmic CAF events
1316  if(kPDG == +13) caf_all_CosmicMuon << eventinfo_caf;
1317 
1318  //Fill CAF histograms with and without Xseccv weights
1319  h_caf_reconue_without_xseccv ->Fill(kNueE);
1320  if(fAnalysisYear.compare("2017") == 0 ||
1321  fAnalysisYear.compare("2018") == 0) h_caf_reconue_with_xseccv ->Fill(kNueE, kXSecCVWgt * fPPFXWeight);
1322  else{
1323  h_caf_reconue_with_xseccv ->Fill(kNueE, kXseccvWeightCC);
1324  h_caf_osc_unextrap ->Fill(kNueE, kXseccvWeightCC*fOscCalc.P(kPDGOrig, kPDG, kTrueE));
1325  }
1326 
1327  //check if the element is already present in list or not
1328  //If it is already present them write it into a
1329  //caf_duplicate text file
1330  //If not present then save the information in a set
1331  //
1332  //Find the event
1333  auto itr_caf_find = set_mceventinfo_caf.find(eventinfo_caf);
1334 
1335  //Event found
1336  if(itr_caf_find != set_mceventinfo_caf.end()){
1337 
1338  // Let's not print the duplicate events
1339  //caf_duplicate << *itr_caf_find;
1340  //Fill duplicate events in a set so that we can prevent this
1341  //event from saving into a non-duplicate set
1342  set_mceventinfo_caf_duplicate.insert(*itr_caf_find);
1343  }//caf duplicate event found
1344 
1345  //Event not found
1346  //OR it is a unique event
1347  else{
1348  set_mceventinfo_caf.insert(eventinfo_caf);
1349  }
1350 
1351 // if(kRun == 10378 && kSubrun == 17 && kCycle == 4 && kEvent == 319 && kSlice == 4)
1352  LOG_DEBUG("ReadCAFMCTextFile")
1353  << "CAF set: "
1354  << " Run "
1355  << kRun
1356  << " ,Subrun "
1357  << kSubrun
1358  << " ,Cycle: "
1359  << kCycle
1360  << " ,Event "
1361  << kEvent
1362  << " ,Slice: "
1363  << kSlice
1364  << " ,TrueneuE "
1365  << kTrueE
1366  << " ,HadE "
1367  << kHadE
1368  << " ,LepE "
1369  << kLepE
1370  << " ,NueE "
1371  << kNueE
1372  << " ,PDGOrig "
1373  << kPDGOrig
1374  << " ,PDG "
1375  << kPDG
1376  << std::endl;
1377  }//end of while condition
1378 
1379  //Remove duplicate events from the caf full set
1380  for(auto itr_caf_duplicate = set_mceventinfo_caf_duplicate.begin(); itr_caf_duplicate != set_mceventinfo_caf_duplicate.end(); ++itr_caf_duplicate){
1381  LOG_DEBUG("ReadCAFMCTextFile")
1382  << " CAF duplicate event: "
1383  << *itr_caf_duplicate;
1384 
1385  //remove the event if duplicate event is found in the CAF set
1386  auto find_duplicate = set_mceventinfo_caf.find(*itr_caf_duplicate);
1387  if(find_duplicate != set_mceventinfo_caf.end()){
1388  LOG_DEBUG("ReadCAFMCTextFile")
1389  << "FOUND duplicate event in CAF set: "
1390  << *find_duplicate;
1391  set_mceventinfo_caf.erase(*find_duplicate);
1392  }//condition remove the event if duplicate event is found in the CAF set
1393  }//end of condition Remove duplicate events from the fnex full set
1394 
1395  //Loop over caf set and write the text file with non-duplicate events
1396  // Let's not print the on-duplicate lists
1397  //for(auto itr_caf = set_mceventinfo_caf.begin(); itr_caf != set_mceventinfo_caf.end(); ++itr_caf){
1398  // caf_non_duplicate << *itr_caf;
1399 
1400  //}//end of looping over all non-duplicate caf events
1401 
1402  LOG_VERBATIM("ReadCAFMCTextFile")
1403  << " Size of CAF set: "
1404  << set_mceventinfo_caf.size()
1405  << " and entries in caf file are: "
1406  << count;
1407 
1408  caf_duplicate .close();
1409  caf_non_duplicate .close();
1410  caf_all .close();
1411  caf_all_NuMuCC .close();
1412  caf_all_NuMuBarCC .close();
1413  caf_all_NuECC .close();
1414  caf_all_NuEBarCC .close();
1415  caf_all_NuTauCC .close();
1416  caf_all_NuTauBarCC .close();
1417  caf_all_NC .close();
1418  caf_all_CosmicMuon .close();
1419 
1420  return;
1421 }//end of ReadCAFMCTextFile
const Var kHadE
Definition: NumuVars.h:23
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const Var kCVNe
PID
Definition: Vars.cxx:35
fnex::SelectionType_t fSelectionTypes
get from the analysis configuration
std::set< fnex::MCEventInfo_struct > set_mceventinfo_caf_duplicate
std::set< fnex::MCEventInfo_struct > set_mceventinfo_caf
virtual double GetL() const
Definition: IOscCalc.h:88
virtual T GetTh23() const
Definition: IOscCalc.h:94
const Var kSubrun
Definition: Vars.cxx:21
art::ServiceHandle< art::TFileService > fTFS
correl_yv Fill(-(dy[iP-1][iC-1]), hyv->GetBinContent(iP, iC))
def kRPAWeightCCQE(tables, weight)
Definition: cv_weights.py:44
T P(int flavBefore, int flavAfter, double E) override
E in GeV; flavors as PDG codes (so, neg==>antinu)
const Binning bins
virtual T GetDmsq32() const
Definition: IOscCalc.h:91
virtual T GetTh12() const
Definition: IOscCalc.h:92
const Var kCycle
Definition: Vars.cxx:22
const SpillVar kSpillPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})
const Var kNMichels([](const caf::SRProxy *sr){int n_me=0;for(int i=0;i< (int) sr->me.nslc;i++) if(sr->me.slc[i].mid > 1. &&sr->me.slc[i].deltat > 1200.) n_me++;for(int i=0;i< (int) sr->me.nkalman;i++) if(sr->me.trkkalman[i].mid > 0. &&sr->me.trkkalman[i].deltat > 800.) n_me++;if(n_me > 2) n_me=2;return n_me;})
Number of SlcME&#39;s assoc with slice.
Definition: Vars.h:85
virtual T GetdCP() const
Definition: IOscCalc.h:95
virtual T GetTh13() const
Definition: IOscCalc.h:93
virtual T GetDmsq21() const
Definition: IOscCalc.h:90
T * make(ARGS...args) const
std::string fAnalysisYear
Analysis year. Options 2016 (for SA), 2017 (for TA) etc.
static const unsigned char kTrueE
Definition: VarVals.h:42
const SpillVar kRun([](const caf::SRSpillProxy *spill){return spill->run;})
const Var kSlice
#define LOG_VERBATIM(category)
virtual double GetRho() const
Definition: IOscCalc.h:89
void fnex::CompareFNEXCAFEventListFiles::ReadEventListNew ( TTree *  eventTree,
std::string const &  mdString 
)
private

Definition at line 1423 of file CompareFNEXCAFEventListFiles_module.cc.

References count_nu_on_e_events, count_total_event, make_root_from_grid_output::cycle, fnex::EventId::cycle, allTimeWatchdog::endl, fnex::EventId::event, fAnalysisYear, fFileType, fnex::DataVars::fHad_RecoE, fnex::DataVars::fLep_RecoE, fnex_all, fnex_all_CosmicMuon, fnex_all_NC, fnex_all_NuEBarCC, fnex_all_NuECC, fnex_all_NuMuBarCC, fnex_all_NuMuCC, fnex_all_NuTauBarCC, fnex_all_NuTauCC, fnex::DataVars::fNuE_CVN, fSelectionTypes, fnex::TruthVars::fTrueCCNC, fnex::TruthVars::fTrueE, fnex::TruthVars::fTrueIntMode, fnex::TruthVars::fTrueIntType, fUseEventId, fnex::WeightVars::fXSecCVPPFX_Weight, h_fnex_reconue_with_xseccv, h_fnex_reconue_without_xseccv, fnex::kDataFile, simb::kElectronScattering, fnex::kNuESelection, LOG_DEBUG, NeutrinoE(), fnex::EventId::run, set_mceventinfo_fnex, set_mceventinfo_fnex_duplicate, fnex::EventId::slice, and fnex::EventId::subrun.

Referenced by ReadFNEXTree_FillEventListMap().

1425 {
1426  fnex::EventId eventId;
1427  fnex::DataVars dataVars;
1428  fnex::TruthVars truthVars;
1429  fnex::WeightVars weightVars;
1430 
1431  eventTree->SetBranchAddress("dataVars", &dataVars);
1432 
1433  if(mdString.find("MC") != std::string::npos){
1434  eventTree->SetBranchAddress("truthVars" , &truthVars );
1435  eventTree->SetBranchAddress("weightVars", &weightVars);
1436  } // end if MC
1437 
1438  // set the address for the EventId info if you want to have access to it
1439  if(fUseEventId){
1440  eventTree->SetBranchAddress("eventId", &eventId );
1441  }
1442 
1443  int run = 0 ;
1444  int subRun = 0 ;
1445  int cycle = 0 ;
1446  int event = 0 ;
1447  int slice = 0 ;
1448 
1449  double neutrinoTrueE = 0.;
1450  double hadronicE = 0.;
1451  double leptonicE = 0.;
1452  double neutrinoE = 0.;
1453  double xseccvCCQE = 0.;
1454  double cvn = 0.;
1455  bool ccnc = false;
1456  int neutrinotype = 0 ;
1457  int trueintmode = 0;
1458 
1459  //loop over entries for each tree and fill the
1460  //run, subRun, event, indepVarNames, indepVarVals information
1461  for(int etr = 0; etr < eventTree->GetEntries(); ++etr){
1462 
1463  //Get entry from old event list trees
1464  eventTree->GetEntry(etr);
1465 
1466  run = eventId .run;
1467  subRun = eventId .subrun;
1468  cycle = eventId .cycle;
1469  event = eventId .event;
1470  slice = eventId .slice;
1471  if(fFileType != kDataFile)
1472  neutrinoTrueE = truthVars .fTrueE;
1473  else
1474  neutrinoTrueE = 1.0;
1475  hadronicE = dataVars .fHad_RecoE;
1476  leptonicE = dataVars .fLep_RecoE;
1477  cvn = dataVars .fNuE_CVN;
1478  xseccvCCQE = weightVars .fXSecCVPPFX_Weight;
1479  ccnc = truthVars .fTrueCCNC;
1480  neutrinotype = truthVars .fTrueIntType;
1481  trueintmode = truthVars .fTrueIntMode;
1482 
1483  neutrinoE = this->NeutrinoE(hadronicE, leptonicE, mdString);
1484 
1485  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
1486  << "FNEX events: Run "
1487  << run
1488  << " , Subrun "
1489  << subRun
1490  << " , cycle: "
1491  << cycle
1492  << " , Event "
1493  << event
1494  << " , slice: "
1495  << slice
1496  << " , neutrinoTrueE "
1497  << neutrinoTrueE
1498  << " , hadronicE "
1499  << hadronicE
1500  << " , leptonicE "
1501  << leptonicE
1502  << " , neutrinoE "
1503  << neutrinoE
1504  << " , Xseccv: "
1505  << xseccvCCQE
1506  << " , mdString "
1507  << mdString
1508  << " , Interaction Mode "
1509  << trueintmode
1510  << std::endl;
1511 
1512  // Let's count the neutrino-electron scattering events
1513  if(trueintmode == simb::kElectronScattering) ++count_nu_on_e_events;
1515 
1516  //Let us assign Cycle number a value -5 for data events
1517  //and True neutrino energy at -1
1518  //because CAF also does the same
1519  if(fFileType == kDataFile){
1520  cycle = -5;
1521  neutrinoTrueE = -1;
1522  }
1523 
1524  //fill the struct
1525  MCEventInfo_struct eventinfo_fnex;
1526  if((fAnalysisYear.compare("2017") == 0 ||
1527  fAnalysisYear.compare("2018") == 0) &&
1529  eventinfo_fnex = MCEventInfo_struct(run, subRun, cycle, event, slice, neutrinoTrueE, hadronicE, leptonicE, neutrinoE, xseccvCCQE, ccnc, neutrinotype, cvn);
1530 
1531  else
1532  eventinfo_fnex = MCEventInfo_struct(run, subRun, cycle, event, slice, neutrinoTrueE, hadronicE, leptonicE, neutrinoE, xseccvCCQE, ccnc, neutrinotype);
1533 
1534  //Save all FNEX events
1535  fnex_all << eventinfo_fnex;
1536 
1537  if((((TString)mdString).Contains("NuMuCC") )) fnex_all_NuMuCC << eventinfo_fnex;
1538  else if((((TString)mdString).Contains("NuMuBarCC") )) fnex_all_NuMuBarCC << eventinfo_fnex;
1539  else if((((TString)mdString).Contains("NuECC") )) fnex_all_NuECC << eventinfo_fnex;
1540  else if((((TString)mdString).Contains("NuEBarCC") )) fnex_all_NuEBarCC << eventinfo_fnex;
1541  else if((((TString)mdString).Contains("NuTauCC") )) fnex_all_NuTauCC << eventinfo_fnex;
1542  else if((((TString)mdString).Contains("NuTauBarCC"))) fnex_all_NuTauBarCC << eventinfo_fnex;
1543  else if((((TString)mdString).Contains("NC") )) fnex_all_NC << eventinfo_fnex;
1544  else if((((TString)mdString).Contains("CosmicMuon"))) fnex_all_CosmicMuon << eventinfo_fnex;
1545 
1546  //Let's Print the information of the events if they are from nu_on_e scattering and is a true NuMu CC interation
1547 // if(trueintmode == simb::kElectronScattering && ((TString)mdString).Contains("NuMuCC"))
1548  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
1549  << "FNEX events: Run "
1550  << run
1551  << " , Subrun "
1552  << subRun
1553  << " , cycle: "
1554  << cycle
1555  << " , Event "
1556  << event
1557  << " , slice: "
1558  << slice
1559  << " , neutrinoTrueE "
1560  << neutrinoTrueE
1561  << " , hadronicE "
1562  << hadronicE
1563  << " , leptonicE "
1564  << leptonicE
1565  << " , neutrinoE "
1566  << neutrinoE
1567  << " , Xseccv: "
1568  << xseccvCCQE
1569  << " , mdString "
1570  << mdString
1571  << " , Interaction Mode "
1572  << trueintmode
1573  << std::endl;
1574 
1575 
1576 
1577  //Fill FNEX histograma
1578  h_fnex_reconue_without_xseccv ->Fill(neutrinoE);
1579  h_fnex_reconue_with_xseccv ->Fill(neutrinoE, xseccvCCQE);
1580 
1581  //check if the element is already present in list or not
1582  //If it is already present then write it into a
1583  //fnex_duplicate text file
1584  //If not present then save the information in a set
1585  //
1586  //Find the event
1587  auto itr_fnex_find = set_mceventinfo_fnex.find(eventinfo_fnex);
1588 
1589  //Duplicate event found
1590  if(itr_fnex_find != set_mceventinfo_fnex.end()){
1591 
1592  //Fill duplicate events in a set so that we can prevent this
1593  //event from saving in a non-duplicate set
1594  set_mceventinfo_fnex_duplicate.insert(*itr_fnex_find);
1595 
1596  // Let's not print the duplicate text file
1597  //fnex_duplicate << *itr_fnex_find;
1598  }//fnex duplicate event found
1599 
1600  //No duplicate event not found
1601  //OR it is a unique event
1602  else{
1603  //find events in the FNEX duplicate list
1604  //if found in duplicate list do nothing otherwise save non duplicate event in
1605  //non-duplicate list
1606  set_mceventinfo_fnex.insert(eventinfo_fnex);
1607  }
1608 
1609  }//end of loop over entries of event list trees
1610 
1611  //Normalize histograms to their bin size for 2017 analysis
1612 // if(fAnalysisYear.compare("2017") == 0){
1613 // for(int i = 1; i < h_fnex_reconue_without_xseccv->GetNbinsX()+1; ++i){
1614 //
1615 // if(h_fnex_reconue_without_xseccv->GetBinContent(i) > 0)
1616 // LOG_VERBATIM("ReadCAFMCTextFile")
1617 // << "FNEX 2017 Normalizing --- Bin: "
1618 // << i
1619 // << " BinContent: "
1620 // << h_fnex_reconue_without_xseccv->GetBinContent(i)
1621 // << " Bin width : "
1622 // << h_fnex_reconue_without_xseccv ->GetBinWidth(i)
1623 // << " New BinContent: "
1624 // << h_fnex_reconue_without_xseccv->GetBinContent(i)*(0.1/h_fnex_reconue_without_xseccv->GetBinWidth(i));
1625 //
1626 // if(h_fnex_reconue_without_xseccv->GetBinContent(i) > 0) h_fnex_reconue_without_xseccv ->SetBinContent(i, h_fnex_reconue_without_xseccv->GetBinContent(i)*(0.1/h_fnex_reconue_without_xseccv->GetBinWidth(i)) );
1627 // if(h_fnex_reconue_with_xseccv ->GetBinContent(i) > 0) h_fnex_reconue_with_xseccv ->SetBinContent(i, h_fnex_reconue_with_xseccv ->GetBinContent(i)*(0.1/h_fnex_reconue_with_xseccv ->GetBinWidth(i)) );
1628 // }//end of loop over binning
1629 // }//end of condition that it is a 2017 Analysis
1630 
1631 
1632  return;
1633 
1634 }//end of function ReadEventListNew
float fTrueCCNC
true cc vs nc
Definition: VarVals.h:648
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
float fNuE_CVN
Definition: VarVals.h:729
std::set< fnex::MCEventInfo_struct > set_mceventinfo_fnex_duplicate
float fLep_RecoE
Definition: VarVals.h:732
fnex::SelectionType_t fSelectionTypes
get from the analysis configuration
float fXSecCVPPFX_Weight
Was Tufts weight for SA.
Definition: VarVals.h:752
Defines an enumeration for prong classification.
float fTrueIntMode
true interaction mode
Definition: VarVals.h:657
fnex::FileType_t fFileType
get from the configuration for now
float fHad_RecoE
Definition: VarVals.h:731
Definition: run.py:1
std::set< fnex::MCEventInfo_struct > set_mceventinfo_fnex
float fTrueE
True nu energy.
Definition: VarVals.h:646
std::string fAnalysisYear
Analysis year. Options 2016 (for SA), 2017 (for TA) etc.
float fTrueIntType
true interaction type
Definition: VarVals.h:649
void fnex::CompareFNEXCAFEventListFiles::ReadFNEXTree_FillEventListMap ( std::string  EventListTreeFile,
std::string  CAFTextFile 
)
private

Definition at line 567 of file CompareFNEXCAFEventListFiles_module.cc.

References fnex::MetaData::BeamType(), count_nu_on_e_events, count_total_event, make_root_from_grid_output::cycle, fnex::MetaData::detector, allTimeWatchdog::endl, fnex::MetaData::EpochString(), art::rootNames::eventTreeName(), MakeMiniprodValidationCuts::f, fAnalysisYear, fBeamType, fDetectorType, fEpochsToUse, fFileType, fnex::MetaData::fileType, fnex_all, fnex_all_CosmicMuon, fnex_all_NC, fnex_all_NuEBarCC, fnex_all_NuECC, fnex_all_NuMuBarCC, fnex_all_NuMuCC, fnex_all_NuTauBarCC, fnex_all_NuTauCC, fnex_duplicate, fnex_non_duplicate, fSampleType, fSelectionTypes, fUseNewTrees, h_fnex_reconue_with_xseccv, h_fnex_reconue_without_xseccv, fnex::MetaData::IsNuMuSelected(), it, fnex::kDataFile, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, fnex::kNuESelection, fnex::kNuESelectionHighPID, fnex::kNuESelectionLowPID, fnex::kNuESelectionMidPID, fnex::kNuESelectionPeripheral, fnex::kNuMuSelection, LOG_DEBUG, LOG_VERBATIM, fetch_tb_beamline_files::md, NeutrinoE(), ReadCAFDataTextFile(), ReadCAFMCTextFile(), ReadEventListNew(), fnex::MetaData::selectionType, set_mceventinfo_fnex, set_mceventinfo_fnex_duplicate, ss, string, and fnex::MetaData::ToString().

Referenced by analyze().

568  {
569 
570  fnex_all .open("fnex_all.txt" ); //FNEX all events
571  fnex_all_NuMuCC .open("fnex_NuMuCC.txt" ); //FNEX events NuMuCC
572  fnex_all_NuMuBarCC .open("fnex_NuMuBarCC.txt" ); //FNEX events NuMuBarCC
573  fnex_all_NuECC .open("fnex_NuECC.txt" ); //FNEX events NuECC
574  fnex_all_NuEBarCC .open("fnex_NuEBarCC.txt" ); //FNEX events NuEBarCC
575  fnex_all_NuTauCC .open("fnex_NuTauCC.txt" ); //FNEX events NuTauBarC
576  fnex_all_NuTauBarCC .open("fnex_NuTauBarCC.txt" ); //FNEX events NuTauBarCC
577  fnex_all_NC .open("fnex_NC.txt" ); //FNEX events NC
578  fnex_all_CosmicMuon .open("fnex_CosmicMuon.txt" ); //FNEX events CosmicMuon
579  //fnex_non_duplicate .open("fnex_non_duplicate.txt" ); //FNEX non-duplicate events
580  //fnex_duplicate .open("fnex_duplicate.txt" ); //FNEX duplicate file
581 
582  //set to store the metadata names
583  std::set<std::string> metadata_string;
584 
585  //Open the FNEX eventlist tree file
586  TFile *f = TFile::Open(EventListTreeFile.c_str());
587  LOG_VERBATIM("CompareFNEXCAFEventListFiles::ReadFNEXTree_FillEventListMap")
588  << " FNEX File name is : "
589  << EventListTreeFile
590  << " ";
591 
592  //Get the metadata tree
593  std::string metadataTreeName("list");
594  if(fUseNewTrees) metadataTreeName += "/full";
595  metadataTreeName += "/metadata";
596  TTree *metadataTree = dynamic_cast<TTree*>(f->Get(metadataTreeName.c_str()));
597 
598  //throw some exception if metadata tree is not found
599  if( !metadataTree){
600  throw cet::exception("CompareFNEXCAFEventListFiles")
601  << "cannot find metadata tree: "
602  << metadataTreeName;
603  }
604  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
605  << "Metadata tree name is: "
606  << *(metadataTree->GetName());
607 
608  // declare the metadata and spillsummary branches
609  fnex::MetaData *md = nullptr;
610  fnex::SpillSummary *ss = nullptr;
611  metadataTree->SetBranchAddress("metadata", &md);
612  metadataTree->SetBranchAddress("spillsummary", &ss);
613 
614  //loop over metadata entries
615  for(int ctr = 0; ctr < metadataTree->GetEntries(); ++ctr){
616 
617  // Get each entry
618  metadataTree->GetEntry(ctr);
619 
620  //Only allow metadata that you want
621  if(md->detector != fDetectorType ||
622  md->fileType != fFileType
623  ) continue;
624 
625  //Only allow the selections you want
627  if(!md->IsNuMuSelected()) continue;
628 
629  if(fAnalysisYear == "2017" &&
635  ) continue;
636 
637  if(fAnalysisYear == "2016" &&
642  ) continue;
643 
644  //Also check which sample to use for comparison
645  //if it is 2017 FD nue selected analysis then make sure
646  //to use either Core or Peripheral Sample
647  if(fAnalysisYear == "2017" &&
650  fSampleType == "Core" &&
653  md->selectionType != fnex::kNuESelectionHighPID) continue;
654 
655  if(fAnalysisYear == "2017" &&
658  fSampleType == "Peripheral" &&
660 
661  // For the 2018 analysis only let the trees to pass which we want
662  if(fAnalysisYear == "2018"){
663 
664  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
665  << "Epoch is "
666  << md->EpochString();
667 
668  // Only let the CVNPID we need for the nue selections
673  ) continue;
674 
675  // For the FD Core sample only let the Low and High trees
676  if(md->detector == novadaq::cnv::kFARDET &&
677  fSampleType == "Core" &&
680  md->selectionType != fnex::kNuESelectionHighPID) continue;
681 
682  // For the FD Peripheral sample only let the Peripheral tree
683  if(md->detector == novadaq::cnv::kFARDET &&
684  fSampleType == "Peripheral" &&
687 
688  // Only let the FHC or RHC trees
689  if(fBeamType != md->BeamType()) continue;
690 
691  }//end of condition that it is 2018 analysis
692 
693  //Skip unless the epoch is in the fEpochsToUse set
694  if(fEpochsToUse.count(md->EpochString()) < 1) continue;
695 
696  if(md->detector == novadaq::cnv::kNEARDET &&
698 
699  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
700  << "Epoch is "
701  << md->EpochString();
702 
703  //Fill metadata set
704  if(!fUseNewTrees)
705  metadata_string.insert(md->ToString());
706 
707  //if eventlist tree file is new type file i.e. is after Sep 29, 2017
708  if(fUseNewTrees)
709  metadata_string.insert(md->ToString());
710 
711  }//end of loop over metadatatree
712 
713  LOG_VERBATIM("ReadFNEXTree_FillEventListMap")
714  << "MetaData string size: "
715  << metadata_string.size()
716  << " ";
717 
718  //Get the eventlist tree from the old file
719  std::string eventTreeName("list");
720  eventTreeName += "/";
721  if(fUseNewTrees)
722  eventTreeName += "full/";
723 
724  //count how many entries are in all the eventlist tree file is
725  unsigned long Entries_EventlistTrees = 0.;
726 
727  //loop over metadata set to get the eventlist trees
728  for (auto it = metadata_string.begin(); it != metadata_string.end(); ++it){
729  auto mdString = *it;
730 
731  TTree *eventTree = dynamic_cast<TTree*>(f->Get((eventTreeName + mdString).c_str()));
732 
733  if( !eventTree )
734  throw cet::exception("CompareFNEXCAFEventListFiles")
735  << "cannot find event tree: "
736  << eventTreeName;
737 
738  LOG_VERBATIM("ReadFNEXTree_FillEventListMap")
739  << "Tree name is: "
740  << eventTree->GetName()
741  << " and entries are: "
742  << eventTree->GetEntries()
743  << std::endl;
744 
745  Entries_EventlistTrees += eventTree->GetEntries();
746 
747  //Loop over all event list branches and store them in the new trees in new file
748  std::vector<std::string> *indepVarNames = nullptr;
749  std::vector<float> *indepVarVals = nullptr;
750  int run = 0 ;
751  int subRun = 0 ;
752  int event = 0 ;
753  int cycle = 0 ;
754  int slice = 0 ;
755  std::string varName ;
756  double neutrinoTrueE = 0. ;
757  double hadronicE = 0. ;
758  double leptonicE = 0. ;
759  double neutrinoE = 0. ;
760  double xseccvCCQE = 0. ;
761  bool ccnc = false ;
762  int neutrinotype = 0 ;
763 
764 
765  //if eventlist tree is made after Sep29, 2017
766  if(fUseNewTrees) this->ReadEventListNew(eventTree, (std::string)mdString);
767  else{
768 
769  eventTree->SetBranchAddress("run", &run );
770  eventTree->SetBranchAddress("subRun", &subRun );
771  eventTree->SetBranchAddress("cycle", &cycle );
772  eventTree->SetBranchAddress("event", &event );
773  // eventTree->SetBranchAddress("slice", &slice );
774  eventTree->SetBranchAddress("indepVarNames", &indepVarNames);
775  eventTree->SetBranchAddress("indepVarVals", &indepVarVals );
776 
777  //loop over entries for each tree and fill the
778  //run, subRun, event, indepVarNames, indepVarVals information
779  for(int etr = 0; etr < eventTree->GetEntries(); ++etr){
780 
781  //Get entry from old event list trees
782  eventTree->GetEntry(etr);
783 
784  //indepVarNames and indepVarVals should have exactly the same size
785  if (indepVarNames->size() != indepVarVals->size())
786  throw cet::exception("CompareFNEXCAFEventListFiles")
787  << "IndepVar names and IndepVar values not of same length for event";
788 
789  std::vector<std::string> object_indepVarNames = *indepVarNames;
790  std::vector<float> object_indepVarVals = *indepVarVals;
791 
792  //loop over indepVarNames{Vals} to get the reconstructed neutrino energy,
793  //hadronic and leptonic energies
794  for(size_t varNum = 0; varNum < indepVarNames->size(); ++varNum){
795 
796  //get the variable name
797  varName = object_indepVarNames[varNum];
798 
799  //get the true neutrino energy
800  if(varName.compare("TrueE") == 0 ) neutrinoTrueE = object_indepVarVals[varNum];
801 
802  //get the hadronicE
803  if(varName.compare("Had_RecoE") == 0 ) hadronicE = object_indepVarVals[varNum];
804 
805  //get the leptonic energy
806  if(varName.compare("Lep_RecoE") == 0 ) leptonicE = object_indepVarVals[varNum];
807 
808  //get the Xseccv CC QE weights
809  if(varName.compare("XsecCVWgt") == 0 ) xseccvCCQE = object_indepVarVals[varNum];
810 
811  //Get the CCNC information
812  if(varName.compare("kTrueCCNC") == 0 ) ccnc = object_indepVarVals[varNum];
813 
814  //Get the neutrino type
815  if(varName.compare("kTruePDG") == 0 ) neutrinotype = object_indepVarVals[varNum];
816 
817  }//end of loop over indepVarNames
818 
819  neutrinoE = this->NeutrinoE(hadronicE, leptonicE, (std::string)mdString);
820 
821  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
822  << "FNEX events: Run "
823  << run
824  << " , Subrun "
825  << subRun
826  << " , cycle: "
827  << cycle
828  << " , Event "
829  << event
830  << " , slice: "
831  << slice
832  << " , neutrinoTrueE "
833  << neutrinoTrueE
834  << " , hadronicE "
835  << hadronicE
836  << " , leptonicE "
837  << leptonicE
838  << " , neutrinoE "
839  << neutrinoE
840  << " , Xseccv: "
841  << xseccvCCQE
842  << " , mdString "
843  << mdString
844  << std::endl;
845 
846  //TODO: use correct cycle and slice numbers after Brian get them in FNEX files as well
847  cycle = 1;
848  //slice = 1;
849 
850  //fill the struct
851  MCEventInfo_struct eventinfo_fnex;
852 // eventinfo_fnex = MCEventInfo_struct(run, subRun, event, cycle, neutrinoTrueE, hadronicE, leptonicE, neutrinoE, xseccvCCQE, ccnc, neutrinotype);
853  eventinfo_fnex = MCEventInfo_struct(run, subRun, cycle, event, slice, neutrinoTrueE, hadronicE, leptonicE, neutrinoE, xseccvCCQE, ccnc, neutrinotype);
854 
855  //Save all FNEX events
856  fnex_all << eventinfo_fnex;
857 
858  //Fill FNEX histograma
859  h_fnex_reconue_without_xseccv ->Fill(neutrinoE);
860  h_fnex_reconue_with_xseccv ->Fill(neutrinoE, xseccvCCQE);
861 
862  //check if the element is already present in list or not
863  //If it is already present then write it into a
864  //fnex_duplicate text file
865  //If not present then save the information in a set
866  //
867  //Find the event
868  auto itr_fnex_find = set_mceventinfo_fnex.find(eventinfo_fnex);
869 
870  //Duplicate event found
871  if(itr_fnex_find != set_mceventinfo_fnex.end()){
872 
873  //Fill duplicate events in a set so that we can prevent this
874  //event from saving in a non-duplicate set
875  set_mceventinfo_fnex_duplicate.insert(*itr_fnex_find);
876  }//fnex duplicate event found
877 
878  //No duplicate event not found
879  //OR it is a unique event
880  else{
881  //find events in the FNEX duplicate list
882  //if found in duplicate list do nothing otherwise save non duplicate event in
883  //non-duplicate list
884  set_mceventinfo_fnex.insert(eventinfo_fnex);
885  }
886 
887  }//end of loop over entries of event list tree
888  }//end of condition that it is an old eventlist tree
889  }//end of loop over metadata set
890 
891  //Remove duplicate events from the fnex full set
892  for(auto itr_fnex_duplicate = set_mceventinfo_fnex_duplicate.begin(); itr_fnex_duplicate != set_mceventinfo_fnex_duplicate.end(); ++itr_fnex_duplicate){
893  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
894  << " FNEX duplicate event:"
895  << *itr_fnex_duplicate;
896  //remove the event if duplicate event is found in the FNEX set
897  auto find_fnex_duplicate = set_mceventinfo_fnex.find(*itr_fnex_duplicate);
898 
899  if(find_fnex_duplicate != set_mceventinfo_fnex.end()){
900 
901  LOG_DEBUG("ReadFNEXTree_FillEventListMap")
902  << "FOUND duplicate event in FNEX set: "
903  << *find_fnex_duplicate;
904 
905  //fnex_duplicate << *find_fnex_duplicate;
906 
907  set_mceventinfo_fnex.erase(*find_fnex_duplicate);
908  }
909  }//end of condition Remove duplicate events from the fnex full set
910 
911  //loop over fnex set and fill the non duplicate fnex text file
912  // Let's not print the nnon-duplicate lists
913  //for(auto itr_fnex = set_mceventinfo_fnex.begin(); itr_fnex != set_mceventinfo_fnex.end(); ++itr_fnex){
914 
915  // // Let's not print the non-duplicate text list
916  // fnex_non_duplicate << *itr_fnex;
917  //}
918 
919  LOG_VERBATIM("ReadFNEXTree_FillEventListMap")
920  << " Size of FNEX set: "
921  << set_mceventinfo_fnex.size()
922  << " Total entries in the FNEX trees are: "
923  << Entries_EventlistTrees;
924 
925  // Let's print the number of neutrino-electron scattering events
926  LOG_VERBATIM("ReadFNEXTree_FillEventListMap")
927  << " Total FNEX events "
929  << " Nu_on_E events "
931  << " Fraction of Nu_on_E events "
932  << std::setprecision(3)
934  << "%.";
935 
936  //call the function to fill CAF variables
937  if(fFileType != kDataFile) this->ReadCAFMCTextFile(CAFTextFile); //For MC CAF file
938  else if(fFileType == kDataFile) this->ReadCAFDataTextFile(CAFTextFile); //For Data CAF file
939 
940 
941  fnex_duplicate .close();
942  fnex_non_duplicate .close();
943  fnex_all .close();
944  fnex_all_NuMuCC .close();
945  fnex_all_NuMuBarCC .close();
946  fnex_all_NuECC .close();
947  fnex_all_NuEBarCC .close();
948  fnex_all_NuTauCC .close();
949  fnex_all_NuTauBarCC .close();
950  fnex_all_NC .close();
951  fnex_all_CosmicMuon .close();
952 
953  return;
954 }//end of ReadFNEXTree_FillEventListMap
std::set< std::string > fEpochsToUse
which epochs to use in the analysis
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::set< fnex::MCEventInfo_struct > set_mceventinfo_fnex_duplicate
bool IsNuMuSelected() const
Definition: Structs.cxx:256
set< int >::iterator it
fnex::SelectionType_t fSelectionTypes
get from the analysis configuration
Float_t ss
Definition: plot.C:24
std::string const & eventTreeName()
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
std::string const EpochString() const
Definition: Structs.cxx:101
fnex::FileType_t fFileType
get from the configuration for now
std::string const ToString() const
Definition: Structs.cxx:114
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
novadaq::cnv::DetId detector
Definition: Structs.h:50
fnex::BeamType_t fBeamType
Is it FHC or RHC analysis.
fnex::FileType_t fileType
Definition: Structs.h:51
Definition: run.py:1
fnex::SelectionType_t selectionType
Definition: Structs.h:52
std::string fSampleType
Core or Peripheral sample for the 2017 FD nue analysis only.
std::set< fnex::MCEventInfo_struct > set_mceventinfo_fnex
std::string fAnalysisYear
Analysis year. Options 2016 (for SA), 2017 (for TA) etc.
#define LOG_VERBATIM(category)
fnex::BeamType_t const BeamType() const
Definition: Structs.cxx:165
enum BeamMode string
void fnex::CompareFNEXCAFEventListFiles::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 466 of file CompareFNEXCAFEventListFiles_module.cc.

References bins, e, fAnalysisYear, fBeamType, fCAFTextFile, fDetectorType, fEpochsToUse, fFileType, fFNEXEventListFile, fOscCalc, fSampleType, fSelectionTypes, fTFS, fUseEventId, fUseNewTrees, fhicl::ParameterSet::get(), h_fnex_reconue_with_xseccv, h_fnex_reconue_without_xseccv, fnex::kBeam, fnex::kDataFile, cmf::kFARDET, fnex::kFHC, cmf::kNEARDET, fnex::kNuESelection, fnex::kNuMuSelection, fnex::kRHC, fnex::kSwap, fnex::kTauSwap, LOG_VERBATIM, art::TFileDirectory::make(), osc::_OscCalcPMNSOpt< T >::SetdCP(), osc::_OscCalcPMNSOpt< T >::SetDmsq21(), osc::_OscCalcPMNSOpt< T >::SetDmsq32(), osc::_OscCalcPMNSOpt< T >::SetL(), osc::_OscCalcPMNSOpt< T >::SetRho(), osc::_OscCalcPMNSOpt< T >::SetTh12(), osc::_OscCalcPMNSOpt< T >::SetTh13(), osc::_OscCalcPMNSOpt< T >::SetTh23(), string, and summary.

Referenced by CompareFNEXCAFEventListFiles().

467 {
468 
469  fFNEXEventListFile = p.get< std::string >("FNEXEventList" );
470  fCAFTextFile = p.get< std::string >("CAFTextFile" );
471  fUseEventId = p.get< bool >("UseEventId", false );
472  fUseNewTrees = p.get< bool >("UseNewTrees", false );
473  auto ftString = p.get<std::string >("FileType" );
474  auto type = p.get<std::string >("AnalysisType" );
475  auto dettype = p.get<std::string >("DetectorType" );
476  auto epochPars = p.get< std::vector<fhicl::ParameterSet> >("EpochsToUse" );
477  fAnalysisYear = p.get<std::string >("AnalysisYear", "2016");
478  fSampleType = p.get<std::string >("SampleType", "" );
479  auto fBeamString = p.get<std::string >("BeamType", "FHC" );
480 
481  if(ftString.compare("DataFile") == 0 ) fFileType = fnex::kDataFile;
482  else if(ftString.compare("NonSwap") == 0 ) fFileType = fnex::kBeam;
483  else if(ftString.compare("FluxSwap") == 0 ) fFileType = fnex::kSwap;
484  else if(ftString.compare("TauSwap") == 0 ) fFileType = fnex::kTauSwap;
485  else{
486  throw cet::exception("CompareFNEXCAFEventListFiles")
487  << " unknown File type "
488  << ftString
489  << " ";
490  }
491  if(type.compare("NuMu_Standard") == 0 ) fSelectionTypes = fnex::kNuMuSelection;
492  else if(type.compare("NuE_Standard") == 0 ) fSelectionTypes = fnex::kNuESelection;
493  else{
494  throw cet::exception("CompareFNEXCAFEventListFiles")
495  << " unknown Analysis Type "
496  << type
497  << " ";
498  }
499 
500  if(fBeamString.compare("FHC") == 0 ) fBeamType = fnex::kFHC;
501  else if(fBeamString.compare("RHC") == 0 ) fBeamType = fnex::kRHC;
502  else{
503  throw cet::exception("CompareFNEXCAFEventListFiles")
504  << " unknown Beam Type "
505  << fBeamString
506  << " ";
507  }
508 
509  if(dettype.compare("FD") == 0 || dettype.compare("fd") == 0 || dettype.compare("Fd") == 0 || dettype.compare("FARDET") == 0 || dettype.compare("FAR") == 0)
511  else if(dettype.compare("ND") == 0 || dettype.compare("nd") == 0 || dettype.compare("Nd") == 0 || dettype.compare("NEARDET") == 0 || dettype.compare("NEAR") == 0)
513 
514  //set the epochs need to be used in analysis
515  std::string epoch;
516  for(auto itr : epochPars){
517  epoch = itr.get<std::string>("Epoch" );
518  fEpochsToUse.insert(epoch);
519 
520  LOG_VERBATIM("CompareFNEXCAFEventListFiles")
521  << "Using "
522  << epoch
523  << " for this analysis";
524  }//end of loop over epochPars
525 
526  //Set parameters for the oscillator calculator
527  fOscCalc.SetL (810. );
528  fOscCalc.SetRho (2.84 );
529  fOscCalc.SetDmsq21(7.54e-5 );
530  fOscCalc.SetDmsq32(2.65661e-3 );
531  fOscCalc.SetTh12 (0.584 );
532  fOscCalc.SetTh13 (0.148 );
533  fOscCalc.SetTh23 (0.685942 );
534  fOscCalc.SetdCP (4.71239 );
535 
536  //Different bining for 2017 style
537  Float_t bins[] = {0, 0.75, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 5.};
538  Int_t binnum = sizeof(bins)/sizeof(Float_t) - 1;
539 
540  if(fAnalysisYear.compare("2017") == 0){
541  h_fnex_reconue_without_xseccv = fTFS->make<TH1F>("h_fnex_reconue_without_xseccv", ";E^{#nu}_{reco} (GeV);Events", binnum, bins);
542  h_fnex_reconue_with_xseccv = fTFS->make<TH1F>("h_fnex_reconue_with_xseccv" , ";E^{#nu}_{reco} (GeV);Events", binnum, bins);
543  }
544  else{
545  h_fnex_reconue_without_xseccv = fTFS->make<TH1F>("h_fnex_reconue_without_xseccv", ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
546  h_fnex_reconue_with_xseccv = fTFS->make<TH1F>("h_fnex_reconue_with_xseccv" , ";E^{#nu}_{reco} (GeV);Events", 120, 0, 30);
547  }
548 
549  //summary file
550  summary .open("summary.txt");
551 
552 }//end of reconfigure
std::set< std::string > fEpochsToUse
which epochs to use in the analysis
void SetTh13(const T &th13) override
fnex::SelectionType_t fSelectionTypes
get from the analysis configuration
void SetL(double L) override
const char * p
Definition: xmltok.h:285
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
fnex::FileType_t fFileType
get from the configuration for now
art::ServiceHandle< art::TFileService > fTFS
const Binning bins
void SetTh23(const T &th23) override
fnex::BeamType_t fBeamType
Is it FHC or RHC analysis.
void SetDmsq21(const T &dmsq21) override
void SetDmsq32(const T &dmsq32) override
T * make(ARGS...args) const
std::string fSampleType
Core or Peripheral sample for the 2017 FD nue analysis only.
std::string fAnalysisYear
Analysis year. Options 2016 (for SA), 2017 (for TA) etc.
void SetdCP(const T &dCP) override
void SetTh12(const T &th12) override
#define LOG_VERBATIM(category)
Float_t e
Definition: plot.C:35
void SetRho(double rho) override
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_CosmicMuon
private

Definition at line 423 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NC
private

Definition at line 422 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NuEBarCC
private

Definition at line 419 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NuECC
private

Definition at line 418 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NuMuBarCC
private

Definition at line 417 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NuMuCC
private

Definition at line 416 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NuTauBarCC
private

Definition at line 421 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_all_NuTauCC
private

Definition at line 420 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_duplicate
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::caf_non_duplicate
private
int fnex::CompareFNEXCAFEventListFiles::count_nu_on_e_events = 0
private

Count nu_on_e FNEX events.

Definition at line 451 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadEventListNew(), and ReadFNEXTree_FillEventListMap().

int fnex::CompareFNEXCAFEventListFiles::count_total_event = 0
private

Total FNEX events.

Definition at line 452 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadEventListNew(), and ReadFNEXTree_FillEventListMap().

std::string fnex::CompareFNEXCAFEventListFiles::fAnalysisYear
private

Analysis year. Options 2016 (for SA), 2017 (for TA) etc.

Definition at line 448 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by NeutrinoE(), ReadCAFDataTextFile(), ReadCAFMCTextFile(), ReadEventListNew(), ReadFNEXTree_FillEventListMap(), and reconfigure().

fnex::BeamType_t fnex::CompareFNEXCAFEventListFiles::fBeamType
private

Is it FHC or RHC analysis.

Definition at line 450 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadFNEXTree_FillEventListMap(), and reconfigure().

std::string fnex::CompareFNEXCAFEventListFiles::fCAFTextFile
private

Definition at line 384 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by analyze(), and reconfigure().

novadaq::cnv::DetId fnex::CompareFNEXCAFEventListFiles::fDetectorType
private
std::set<std::string> fnex::CompareFNEXCAFEventListFiles::fEpochsToUse
private

which epochs to use in the analysis

Definition at line 447 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadFNEXTree_FillEventListMap(), and reconfigure().

fnex::FileType_t fnex::CompareFNEXCAFEventListFiles::fFileType
private

get from the configuration for now

Definition at line 444 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadEventListNew(), ReadFNEXTree_FillEventListMap(), and reconfigure().

std::string fnex::CompareFNEXCAFEventListFiles::fFNEXEventListFile
private

Definition at line 383 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by analyze(), and reconfigure().

std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_CosmicMuon
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NuEBarCC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NuECC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NuMuBarCC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NuMuCC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NuTauBarCC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_all_NuTauCC
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_duplicate
private
std::ofstream fnex::CompareFNEXCAFEventListFiles::fnex_non_duplicate
private
osc::OscCalcPMNSOpt fnex::CompareFNEXCAFEventListFiles::fOscCalc
private

Definition at line 440 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile(), and reconfigure().

std::string fnex::CompareFNEXCAFEventListFiles::fSampleType
private

Core or Peripheral sample for the 2017 FD nue analysis only.

Definition at line 449 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadFNEXTree_FillEventListMap(), and reconfigure().

fnex::SelectionType_t fnex::CompareFNEXCAFEventListFiles::fSelectionTypes
private
art::ServiceHandle<art::TFileService> fnex::CompareFNEXCAFEventListFiles::fTFS
private
bool fnex::CompareFNEXCAFEventListFiles::fUseEventId
private

Definition at line 437 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadEventListNew(), and reconfigure().

bool fnex::CompareFNEXCAFEventListFiles::fUseNewTrees
private
TH1F* fnex::CompareFNEXCAFEventListFiles::h_fnex_reconue_with_xseccv
private
TH1F* fnex::CompareFNEXCAFEventListFiles::h_fnex_reconue_without_xseccv
private
std::set<fnex::DataEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_dataeventinfo_caf
private

Definition at line 403 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFDataTextFile().

std::set<fnex::DataEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_dataeventinfo_caf_duplicate
private

Definition at line 404 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFDataTextFile().

std::set<fnex::DataEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_dataeventinfo_fnex
private

Definition at line 405 of file CompareFNEXCAFEventListFiles_module.cc.

std::set<fnex::DataEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_dataeventinfo_fnex_duplicate
private

Definition at line 406 of file CompareFNEXCAFEventListFiles_module.cc.

std::set<EventInfo_struct_RunSubrunCycle> fnex::CompareFNEXCAFEventListFiles::set_event_run_subrun_cycle_caf
private

Definition at line 411 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFDataTextFile().

std::set<EventInfo_struct_RunSubrunCycle> fnex::CompareFNEXCAFEventListFiles::set_event_run_subrun_cycle_fnex
private

Definition at line 412 of file CompareFNEXCAFEventListFiles_module.cc.

std::set<fnex::MCEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_mceventinfo_caf
private

Definition at line 398 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::set<fnex::MCEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_mceventinfo_caf_duplicate
private

Definition at line 399 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFMCTextFile().

std::set<fnex::MCEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_mceventinfo_fnex
private
std::set<fnex::MCEventInfo_struct> fnex::CompareFNEXCAFEventListFiles::set_mceventinfo_fnex_duplicate
private
std::set<int> fnex::CompareFNEXCAFEventListFiles::set_runs_caf
private

Definition at line 407 of file CompareFNEXCAFEventListFiles_module.cc.

Referenced by ReadCAFDataTextFile().

std::set<int> fnex::CompareFNEXCAFEventListFiles::set_runs_caf_not_in_fnex
private

Definition at line 408 of file CompareFNEXCAFEventListFiles_module.cc.

std::set<int> fnex::CompareFNEXCAFEventListFiles::set_runs_fnex
private

Definition at line 409 of file CompareFNEXCAFEventListFiles_module.cc.

std::set<int> fnex::CompareFNEXCAFEventListFiles::set_runs_fnex_not_in_caf
private

Definition at line 410 of file CompareFNEXCAFEventListFiles_module.cc.

std::ofstream fnex::CompareFNEXCAFEventListFiles::summary
private

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