All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ana::SBNOsc::Normalize Class Reference

#include <Normalize.h>

Public Member Functions

void Initialize (const fhicl::ParameterSet &fcl)
 
void AddCosmicEvent (const event::Event &event)
 
void AddNeutrinoEvent (const event::Event &event)
 
void AddNeutrinoSubRun (const SubRun &subrun)
 
void AddCosmicFile (const FileMeta &meta)
 
double ScaleNeutrino (double goal_pot) const
 
double ScaleCosmic (double goal_pot) const
 

Private Attributes

int fLastCosmicFileID
 
int fLastCosmicEventID
 
int fLastNeutrinoFileID
 
int fLastNeutrinoEventID
 
double fPotPerReadout
 
double fNeutrinoPOT
 
unsigned fCosmicEventsPerFile
 
unsigned fNNeutrinoEvents
 
unsigned fNCosmicEvents
 

Detailed Description

Class to handle normalization of overlay and intime-cosmic samples.

Definition at line 15 of file Normalize.h.

Member Function Documentation

void ana::SBNOsc::Normalize::AddCosmicEvent ( const event::Event event)

Add a cosmic event to the normalization

Parameters
eventThe sbncode core event information

Definition at line 23 of file Normalize.cc.

23 {}
void ana::SBNOsc::Normalize::AddCosmicFile ( const FileMeta meta)

Definition at line 19 of file Normalize.cc.

19  {
21 }
unsigned n_gen_events
Definition: FileMeta.hh:25
unsigned fNCosmicEvents
Definition: Normalize.h:70
void ana::SBNOsc::Normalize::AddNeutrinoEvent ( const event::Event event)

Add a neutrino event to the normalization

Parameters
eventThe sbncode core event information

Definition at line 25 of file Normalize.cc.

25  {
27 }
unsigned fNNeutrinoEvents
Definition: Normalize.h:69
void ana::SBNOsc::Normalize::AddNeutrinoSubRun ( const SubRun subrun)

Add a neutrino subrunto the normalization

Parameters
subrunThe sbncode core Subrun information

Definition at line 29 of file Normalize.cc.

29  {
30  std::cout << "New subrun: " << subrun.totgoodpot << std::endl;
31  fNeutrinoPOT += subrun.totgoodpot;
32 }
float totgoodpot
Definition: SubRun.hh:40
BEGIN_PROLOG could also be cout
void ana::SBNOsc::Normalize::Initialize ( const fhicl::ParameterSet &  fcl)

Initialize the class

Parameters
fclThe fhicl configuration

Definition at line 5 of file Normalize.cc.

5  {
6  fPotPerReadout = fcl.get<double>("PotPerReadout", 5.e12);
7 
10 
13 
14  fNeutrinoPOT = 0.;
15  fNNeutrinoEvents = 0;
16  fNCosmicEvents = 0;
17 }
process_name standard_reco_uboone fcl
unsigned fNNeutrinoEvents
Definition: Normalize.h:69
unsigned fNCosmicEvents
Definition: Normalize.h:70
double ana::SBNOsc::Normalize::ScaleCosmic ( double  goal_pot) const

Scale the cosmic events to a certain POT. To be called after all events are processed

Parameters
goal_potThe POT to scale the sample to.
Returns
The scale factor for each cosmic event to the set POT

Definition at line 34 of file Normalize.cc.

34  {
35 
36  std::cout << "Total N cosmics: " << fNCosmicEvents << std::endl;
37  std::cout << "Total N neutrinos: " << fNNeutrinoEvents << std::endl;
38  std::cout << "Total neutrino POT: " << fNeutrinoPOT << std::endl;
39 
40  // fraction of all POT accounted for by the neutrino sample
41  double neutrino_per_pot = 0.;
42  if (fNeutrinoPOT > 1e-3 && fNNeutrinoEvents > 0) {
43  neutrino_per_pot = fNNeutrinoEvents / (fNeutrinoPOT);
44  }
45 
46  std::cout << "Neutrino per POT: " << neutrino_per_pot << std::endl;
47 
48  // POT per cosmic event
49  double cosmic_per_pot = (1./fPotPerReadout) - neutrino_per_pot;
50 
51  std::cout << "Cosmic per POT: " << cosmic_per_pot << std::endl;
52 
53  // total POT equaivalent of cosmic
54  double cosmic_pot = fNCosmicEvents / cosmic_per_pot;
55 
56  std::cout << "Cosmic POT: " << cosmic_pot << std::endl;
57 
58  // scale
59  return goal_pot / cosmic_pot;
60 }
unsigned fNNeutrinoEvents
Definition: Normalize.h:69
do i e
BEGIN_PROLOG could also be cout
unsigned fNCosmicEvents
Definition: Normalize.h:70
double ana::SBNOsc::Normalize::ScaleNeutrino ( double  goal_pot) const

Scale the neutrino events to a certain POT. To be called after all events are processed

Parameters
goal_potThe POT to scale the sample to.
Returns
The scale factor for each neutrino event to the set POT

Definition at line 62 of file Normalize.cc.

62  {
63  if (fNeutrinoPOT < 1e-3 || fNNeutrinoEvents == 0) return 0;
64  // simpler -- just scale neutrino POT to goal
65  return goal_pot / (fNeutrinoPOT);
66 }
unsigned fNNeutrinoEvents
Definition: Normalize.h:69
do i e

Member Data Documentation

unsigned ana::SBNOsc::Normalize::fCosmicEventsPerFile
private

Definition at line 68 of file Normalize.h.

int ana::SBNOsc::Normalize::fLastCosmicEventID
private

Definition at line 61 of file Normalize.h.

int ana::SBNOsc::Normalize::fLastCosmicFileID
private

Definition at line 60 of file Normalize.h.

int ana::SBNOsc::Normalize::fLastNeutrinoEventID
private

Definition at line 64 of file Normalize.h.

int ana::SBNOsc::Normalize::fLastNeutrinoFileID
private

Definition at line 63 of file Normalize.h.

unsigned ana::SBNOsc::Normalize::fNCosmicEvents
private

Definition at line 70 of file Normalize.h.

double ana::SBNOsc::Normalize::fNeutrinoPOT
private

Definition at line 67 of file Normalize.h.

unsigned ana::SBNOsc::Normalize::fNNeutrinoEvents
private

Definition at line 69 of file Normalize.h.

double ana::SBNOsc::Normalize::fPotPerReadout
private

Definition at line 66 of file Normalize.h.


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