NuCutImps::CC1070Resolution Class Reference

#include <NuCutImps.h>

Inheritance diagram for NuCutImps::CC1070Resolution:
NuCut

List of all members.

Public Member Functions

 CC1070Resolution (const NuPlots *plots, TString ana, int quantile)
virtual ~CC1070Resolution ()
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

CC1070Std fCC1070Std

Detailed Description

Definition at line 262 of file NuCutImps.h.


Constructor & Destructor Documentation

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

Definition at line 1817 of file NuCutImps.cxx.

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

01820     : NuCut(ana, plots), fResCuts_r1(0), fResCuts_r2(0),
01821       fResCuts_r3(0), fResCuts_phe(0), fQuantile(quantile)
01822   {
01823     assert(fQuantile >= 0 && fQuantile <= 4);
01824 
01825     SetFidVol("cc2008");
01826     SetAnaVersion(NuCuts::kCC1070Std);
01827 
01828     const NuGeneral& gen = NuLibrary::Instance().general;
01829     const TString releaseDir = gen.GetReleaseDirToUse("NtupleUtils");
01830     const TString fullPath = releaseDir+"/NtupleUtils/data/cuts_numu.root";
01831     SetCutFile(fullPath);
01832   }

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

Definition at line 1834 of file NuCutImps.cxx.

01835   {
01836   }


Member Function Documentation

Bool_t NuCutImps::CC1070Resolution::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 1838 of file NuCutImps.cxx.

References fCC1070Std, and NuCutImps::CC1070Std::InFidVol().

01839   {
01840     return fCC1070Std.InFidVol(nu);
01841   }

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

Implements NuCut.

Definition at line 1843 of file NuCutImps.cxx.

References NuCut::Defer_Preselection(), and fCC1070Std.

01844   {
01845     Defer_Preselection(fCC1070Std, nu);
01846   }

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

Definition at line 1876 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().

01877   {
01878     Double_t low_en_edge = 0;
01879     Double_t high_en_edge = 0;
01880     Double_t low_res_edge = 0;
01881     Double_t high_res_edge = 0;
01882     Double_t quantiles[6];
01883     TTree *resCuts;
01884     resCuts=fResCuts_r3;
01885     //Different cuts per run period!
01886     switch(nu.runPeriod){
01887     case 1:
01888       resCuts=fResCuts_r1;
01889       break;
01890     case 2:
01891       resCuts=fResCuts_r2;
01892       break;
01893     case 3:
01894 
01895       resCuts=fResCuts_r3;
01896       break;
01897       //default:
01898       //assert(0 && "Badly configured runPeriod");
01899     }
01900     //Whatever run period this is nowadays...
01901     if(nu.beamTypeDB == BeamType::kL250z200i) {
01902       resCuts=fResCuts_phe;
01903       MAXMSG("NuCutImps",Msg::kInfo,10)<<"Using pHE resolution cuts"<<endl;
01904     }
01905 
01906     resCuts->SetBranchAddress("quantiles", quantiles);
01907     resCuts->SetBranchAddress("lowedge", &low_en_edge);
01908     resCuts->SetBranchAddress("highedge", &high_en_edge);
01909 
01910     for(Int_t i = 0; i < resCuts->GetEntries(); i++){
01911       resCuts->GetEntry(i);
01912 
01913       if(fQuantile == 0) low_res_edge = 0.0;
01914       else low_res_edge = quantiles[fQuantile];
01915 
01916       if(fQuantile == 4) high_res_edge = 9999999.;
01917       else high_res_edge = quantiles[fQuantile+1];
01918 
01919       if(nu.energy > low_en_edge && nu.energy <= high_en_edge)
01920       {
01921         MAXMSG("NuCutImps", Msg::kInfo, 20)
01922           << "Entry:" << i << " Energy:" << nu.energy << " sigma/E:"
01923           << (nu.resolution/nu.energy) << endl
01924           << "Keep if between " << low_res_edge << " and "
01925           << high_res_edge << endl;
01926 
01927         Keep_If((nu.resolution/nu.energy) > low_res_edge &&
01928                 (nu.resolution/nu.energy) <= high_res_edge, "resolution");
01929         return;
01930        }
01931     }
01932     // God knows how we got here. We'd better keep the event, but not
01933     // double-count it, so bung it in quantile 4.
01934     Keep_If(fQuantile == 4, "Overflow");
01935   }

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

Implements NuCut.

Definition at line 1848 of file NuCutImps.cxx.

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

01849   {
01850     Defer_Selection(fCC1070Std, nu);
01851 
01852     if(nu.detector == Detector::kFar/* && nu.charge<0*/) Resolution(nu);
01853   }

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

Definition at line 1855 of file NuCutImps.cxx.

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

Referenced by CC1070Resolution().

01856   {
01857     TDirectory* tmpd = gDirectory; //get the right path
01858     TFile* cutfile = new TFile(filename, "READ");
01859     gDirectory = tmpd;
01860     if(cutfile->IsZombie()){
01861       MSG("NuCutImps", Msg::kWarning) << "cutfile does not exist" << endl;
01862       return;
01863     }
01864     //I know, I know, this isn't a great way to do it...
01865 
01866     fResCuts_r1 = (TTree*)cutfile->Get("cuts_r1");
01867     fResCuts_r2 = (TTree*)cutfile->Get("cuts_r2");
01868     fResCuts_r3 = (TTree*)cutfile->Get("cuts_r3");
01869     fResCuts_phe = (TTree*)cutfile->Get("cuts_phe");
01870 
01871     MSG("NuCutImps", Msg::kInfo) << "cutfile exists: "
01872                                  << fResCuts_r1->GetEntries()
01873                                  << " R1 entries" << endl;
01874   }


Member Data Documentation

Definition at line 264 of file NuCutImps.h.

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

Definition at line 283 of file NuCutImps.h.

Referenced by CC1070Resolution(), and Resolution().

Definition at line 282 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().

Definition at line 279 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().

Definition at line 280 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().

Definition at line 281 of file NuCutImps.h.

Referenced by Resolution(), and SetCutFile().


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

Generated on 19 Jan 2018 for loon by  doxygen 1.6.1