Anp::StudyFiducial Class Reference

#include <StudyFiducial.h>

Inheritance diagram for Anp::StudyFiducial:
Anp::AlgSnarl Anp::Base

List of all members.

Public Member Functions

 StudyFiducial ()
virtual ~StudyFiducial ()
bool Run (Record &record)
void Config (const Registry &)
void Set (TDirectory *dir)
void End (const DataBlock &)

Private Types

typedef std::pair< double, double > PassFail
typedef std::map< std::string,
PassFail
CountMap

Private Member Functions

void Print (std::ostream &os=std::cout) const
void Count (const std::string &key, bool pass, double weight)

Private Attributes

int fFiducialKey
int fNeutrinoKey
std::map< std::string, PassFailfCountMap

Detailed Description

Definition at line 20 of file StudyFiducial.h.


Member Typedef Documentation

typedef std::map<std::string, PassFail> Anp::StudyFiducial::CountMap [private]

Definition at line 38 of file StudyFiducial.h.

typedef std::pair<double,double> Anp::StudyFiducial::PassFail [private]

Definition at line 37 of file StudyFiducial.h.


Constructor & Destructor Documentation

Anp::StudyFiducial::StudyFiducial (  ) 

Definition at line 23 of file StudyFiducial.cxx.

00024    :fFiducialKey(100),
00025     fNeutrinoKey(2100)
00026 {
00027 }

Anp::StudyFiducial::~StudyFiducial (  )  [virtual]

Definition at line 30 of file StudyFiducial.cxx.

00031 {
00032 }


Member Function Documentation

void Anp::StudyFiducial::Config ( const Registry reg  )  [virtual]

Reimplemented from Anp::AlgSnarl.

Definition at line 125 of file StudyFiducial.cxx.

References fFiducialKey, fNeutrinoKey, and Registry::Get().

00126 {
00127    int value_int = 0;
00128    if(reg.Get("StudyFiducialKey", value_int) && value_int != 0)
00129    {
00130       fFiducialKey = value_int;
00131    }
00132 
00133    value_int = 0;
00134    if(reg.Get("StudyFiducialNeu", value_int) && value_int != 0)
00135    {
00136       fNeutrinoKey = value_int;
00137    }
00138 
00139    const char *value_char = 0;
00140    if(reg.Get("PrintConfig", value_char) && value_char && strcmp(value_char, "yes") == 0)
00141    {
00142       cout << "StudyFiducial::Config" << endl
00143            << "   FiducialKey = " << fFiducialKey << endl
00144            << "   NeutrinoKey = " << fNeutrinoKey << endl;
00145    }
00146 }

void Anp::StudyFiducial::Count ( const std::string &  key,
bool  pass,
double  weight 
) [private]

Referenced by Run().

void Anp::StudyFiducial::End ( const DataBlock  )  [virtual]

Reimplemented from Anp::AlgSnarl.

Definition at line 119 of file StudyFiducial.cxx.

References Print().

00120 {
00121    Print();
00122 }

void Anp::StudyFiducial::Print ( std::ostream &  os = std::cout  )  const [private]

Referenced by End().

bool Anp::StudyFiducial::Run ( Record record  )  [virtual]

Implements Anp::AlgSnarl.

Definition at line 35 of file StudyFiducial.cxx.

References Count(), Anp::Record::EventBeg(), Anp::Record::EventEnd(), fFiducialKey, fNeutrinoKey, Anp::Record::TruthBeg(), and Anp::Record::TruthEnd().

00036 {
00037    //
00038    // Count and study fiducial and non-fiducial events
00039    //
00040 
00041    for(TruthIter itrue = record.TruthBeg(); itrue != record.TruthEnd(); ++itrue)
00042    {
00043       bool fid_true = false;
00044       bool fid_reco = false;
00045       bool pid_pass = false;
00046 
00047       unsigned int rcount = 0;
00048 
00049       string fidR = "FidReco=0";
00050       string fidT = "FidTrue=0";
00051       string skey = "Select=0";
00052       
00053       //
00054       // Find reco event information
00055       //
00056       for(EventIter ievent = record.EventBeg(); ievent != record.EventEnd(); ++ievent)
00057       {
00058          if(!(itrue -> Match(*ievent)))
00059          {
00060             continue;
00061          }
00062 
00063          ++rcount;
00064          
00065          if(ievent -> KeyExists(fFiducialKey))
00066          {
00067             fid_reco = true;
00068             fidR = "FidReco=1";
00069          }
00070 
00071          if(ievent -> KeyExists(fNeutrinoKey))
00072          {
00073             pid_pass = true;
00074             skey = "Select=1";
00075          }
00076       }
00077 
00078       //
00079       // Check if true interaction vertex is within fiducial volume
00080       //
00081       if(itrue -> KeyExists(fFiducialKey))
00082       {
00083          fid_true = true;
00084          fidT = "FidTrue=1";
00085       }
00086       
00087       string ikey;
00088       if(itrue -> Interaction() == 0)
00089       {
00090          ikey = "NC";
00091       }
00092       else if(itrue -> Interaction() == 1)
00093       {
00094          ikey = "CC";
00095       }
00096 
00097       Count(ikey + " & FidTrue=?", fid_true, 1.0);
00098       Count(ikey + " & RecoEvent=?", rcount > 0, 1.0);
00099       Count(ikey + " & " + fidT + " & RecoEvent=?", rcount > 0, 1.0);
00100 
00101       if(rcount > 0)
00102       {
00103          Count(ikey + " & " + fidT + " & SplitEvent=?", rcount > 1, 1.0);
00104          Count(ikey + " & " + fidR + " & SplitEvent=?", rcount > 1, 1.0);
00105 
00106          Count(ikey + " & " + fidT + " & FidReco=?", fid_reco, 1.0);
00107 
00108          Count(ikey + " & " + skey + " & FidTrue=?", fid_true, 1.0);
00109          Count(ikey + " & " + skey + " & FidReco=?", fid_reco, 1.0);
00110 
00111          Count(ikey + " & " + skey + " & " + fidT + " & FidReco=?", fid_reco, 1.0);
00112       }
00113    }
00114 
00115    return true;
00116 }

void Anp::StudyFiducial::Set ( TDirectory *  dir  )  [virtual]

Reimplemented from Anp::AlgSnarl.

Definition at line 149 of file StudyFiducial.cxx.

00150 {
00151 }


Member Data Documentation

std::map<std::string, PassFail> Anp::StudyFiducial::fCountMap [private]

Definition at line 50 of file StudyFiducial.h.

Definition at line 47 of file StudyFiducial.h.

Referenced by Config(), and Run().

Definition at line 48 of file StudyFiducial.h.

Referenced by Config(), and Run().


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

Generated on 24 Apr 2018 for loon by  doxygen 1.6.1