NuCutImps::CC0720Resolution Class Reference

#include <NuCutImps.h>

Inheritance diagram for NuCutImps::CC0720Resolution:
NuCut

List of all members.

Public Member Functions

 CC0720Resolution (const NuPlots *plots, TString ana, int quantile)
virtual ~CC0720Resolution ()
virtual Bool_t InFidVol (const NuEvent &nu) const
void Preselection (const NuEvent &nu)
void Selection (const NuEvent &nu)

Protected Member Functions

void Resolution (const NuEvent &nu)
void SetCutFile (const char *filename)

Protected Attributes

TTree * fResCuts_r1
TTree * fResCuts_r2
TTree * fResCuts_r3
TTree * fResCuts_phe
int fQuantile

Private Attributes

CC0720Std fCC0720Std

Detailed Description

Definition at line 236 of file NuCutImps.h.


Constructor & Destructor Documentation

NuCutImps::CC0720Resolution::CC0720Resolution ( const NuPlots plots,
TString  ana,
int  quantile 
)

Definition at line 1696 of file NuCutImps.cxx.

References fQuantile, NuLibrary::general, NuGeneral::GetReleaseDirToUse(), NuLibrary::Instance(), NuCuts::kCC0720Std, NuCut::SetAnaVersion(), SetCutFile(), and NuCut::SetFidVol().

01699     : NuCut(ana, plots), fResCuts_r1(0), fResCuts_r2(0),
01700       fResCuts_r3(0), fResCuts_phe(0), fQuantile(quantile)
01701   {
01702     assert(fQuantile >= 0 && fQuantile <= 4);
01703 
01704     SetFidVol("cc2008");
01705     SetAnaVersion(NuCuts::kCC0720Std);
01706 
01707     const NuGeneral& gen = NuLibrary::Instance().general;
01708     const TString releaseDir = gen.GetReleaseDirToUse("NtupleUtils");
01709     const TString fullPath = releaseDir+"/NtupleUtils/data/cuts_numu.root";
01710     SetCutFile(fullPath);
01711   }

NuCutImps::CC0720Resolution::~CC0720Resolution (  )  [virtual]

Definition at line 1713 of file NuCutImps.cxx.

01714   {
01715   }


Member Function Documentation

Bool_t NuCutImps::CC0720Resolution::InFidVol ( const NuEvent nu  )  const [virtual]

Fiducial volume calculation function. This is the basic 'infid' derived version, and should be overridden/passed to for any more complicated evaluations.

Reimplemented from NuCut.

Definition at line 1717 of file NuCutImps.cxx.

References fCC0720Std, and NuCutImps::CC0720Std::InFidVol().

01718   {
01719     return fCC0720Std.InFidVol(nu);
01720   }

void NuCutImps::CC0720Resolution::Preselection ( const NuEvent nu  )  [virtual]

Implements NuCut.

Definition at line 1722 of file NuCutImps.cxx.

References NuCut::Defer_Preselection(), and fCC0720Std.

01723   {
01724     Defer_Preselection(fCC0720Std, nu);
01725   }

void NuCutImps::CC0720Resolution::Resolution ( const NuEvent nu  )  [protected]

Definition at line 1755 of file NuCutImps.cxx.

References NuEvent::beamTypeDB, NuEvent::energy, fQuantile, fResCuts_phe, fResCuts_r1, fResCuts_r2, fResCuts_r3, NuCut::Keep_If(), Msg::kInfo, BeamType::kL250z200i, MAXMSG, NuEvent::resolution, and NuEvent::runPeriod.

Referenced by Selection().

01756   {
01757     Double_t low_en_edge = 0;
01758     Double_t high_en_edge = 0;
01759     Double_t low_res_edge = 0;
01760     Double_t high_res_edge = 0;
01761     Double_t quantiles[6];
01762     TTree *resCuts;
01763     //Different cuts per run period!
01764     switch(nu.runPeriod){
01765     case 1:
01766       resCuts=fResCuts_r1;
01767       break;
01768     case 2:
01769       resCuts=fResCuts_r2;
01770       break;
01771     case 3:
01772       resCuts=fResCuts_r3;
01773       break;
01774     default:
01775       assert(0 && "Badly configured runPeriod");
01776     }
01777     //Whatever run period this is nowadays...
01778     if(nu.beamTypeDB == BeamType::kL250z200i) {
01779       resCuts=fResCuts_phe;
01780       MAXMSG("NuCutImps",Msg::kInfo,10)<<"Using pHE resolution cuts"<<endl;
01781     }
01782 
01783     resCuts->SetBranchAddress("quantiles", quantiles);
01784     resCuts->SetBranchAddress("lowedge", &low_en_edge);
01785     resCuts->SetBranchAddress("highedge", &high_en_edge);
01786 
01787     for(Int_t i = 0; i < resCuts->GetEntries(); i++){
01788       resCuts->GetEntry(i);
01789 
01790       if(fQuantile == 0) low_res_edge = 0.0;
01791       else low_res_edge = quantiles[fQuantile];
01792 
01793       if(fQuantile == 4) high_res_edge = 9999999.;
01794       else high_res_edge = quantiles[fQuantile+1];
01795 
01796       if(nu.energy > low_en_edge && nu.energy <= high_en_edge)
01797       {
01798         MAXMSG("NuCutImps", Msg::kInfo, 20)
01799           << "Entry:" << i << " Energy:" << nu.energy << " sigma/E:"
01800           << (nu.resolution/nu.energy) << endl
01801           << "Keep if between " << low_res_edge << " and "
01802           << high_res_edge << endl;
01803 
01804         Keep_If((nu.resolution/nu.energy) > low_res_edge &&
01805                 (nu.resolution/nu.energy) <= high_res_edge, "resolution");
01806         return;
01807        }
01808     }
01809     // God knows how we got here. We'd better keep the event, but not
01810     // double-count it, so bung it in quantile 4.
01811     Keep_If(fQuantile == 4, "Overflow");
01812   }

void NuCutImps::CC0720Resolution::Selection ( const NuEvent nu  )  [virtual]

Implements NuCut.

Definition at line 1727 of file NuCutImps.cxx.

References NuCut::Defer_Selection(), NuEvent::detector, fCC0720Std, Detector::kFar, and Resolution().

01728   {
01729     Defer_Selection(fCC0720Std, nu);
01730 
01731     if(nu.detector == Detector::kFar/* && nu.charge<0*/) Resolution(nu);
01732   }

void NuCutImps::CC0720Resolution::SetCutFile ( const char *  filename  )  [protected]

Definition at line 1734 of file NuCutImps.cxx.

References fResCuts_phe, fResCuts_r1, fResCuts_r2, fResCuts_r3, Msg::kInfo, Msg::kWarning, and MSG.

Referenced by CC0720Resolution().

01735   {
01736     TDirectory* tmpd = gDirectory; //get the right path
01737     TFile* cutfile = new TFile(filename, "READ");
01738     gDirectory = tmpd;
01739     if(cutfile->IsZombie()){
01740       MSG("NuCutImps", Msg::kWarning) << "cutfile does not exist" << endl;
01741       return;
01742     }
01743     //I know, I know, this isn't a great way to do it...
01744 
01745     fResCuts_r1 = (TTree*)cutfile->Get("cuts_r1");
01746     fResCuts_r2 = (TTree*)cutfile->Get("cuts_r2");
01747     fResCuts_r3 = (TTree*)cutfile->Get("cuts_r3");
01748     fResCuts_phe = (TTree*)cutfile->Get("cuts_phe");
01749 
01750     MSG("NuCutImps", Msg::kInfo) << "cutfile exists: "
01751                                  << fResCuts_r1->GetEntries()
01752                                  << " R1 entries" << endl;
01753   }


Member Data Documentation

Definition at line 238 of file NuCutImps.h.

Referenced by InFidVol(), Preselection(), and Selection().

Definition at line 257 of file NuCutImps.h.

Referenced by CC0720Resolution(), and Resolution().

Definition at line 256 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().

Definition at line 253 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().

Definition at line 254 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().

Definition at line 255 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().


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

Generated on 3 Dec 2018 for loon by  doxygen 1.6.1