NtpStTrimmer Class Reference

#include <NtpStTrimmer.h>

Inheritance diagram for NtpStTrimmer:
JobCModule

List of all members.

Public Member Functions

 NtpStTrimmer ()
 ~NtpStTrimmer ()
JobCResult Reco (MomNavigator *mom)
void EndJob ()
void BeginJob ()
bool PassesCuts ()
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Attributes

int counter
int kept
NueAnalysisCuts fCuts
std::string kOutputFile
Int_t kReWeight
Float_t kTheta23
Float_t kUe3Square
Float_t kDeltaMSquare

Detailed Description

Definition at line 23 of file NtpStTrimmer.h.


Constructor & Destructor Documentation

NtpStTrimmer::NtpStTrimmer (  ) 

Definition at line 37 of file NtpStTrimmer.cxx.

00037                           :
00038   counter(0),
00039   kOutputFile("TrimmedOut.root"),
00040   kReWeight(0),
00041   kTheta23(1.0),
00042   kUe3Square(0.01),
00043   kDeltaMSquare(0.0025)
00044 {}

NtpStTrimmer::~NtpStTrimmer (  ) 

Definition at line 48 of file NtpStTrimmer.cxx.

00049 {}


Member Function Documentation

void NtpStTrimmer::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 52 of file NtpStTrimmer.cxx.

References counter, and kept.

00053 {
00054   kept = 0;
00055 //  fCuts.Reset();
00056   if(counter%1000==0){
00057     cout<<"On entry "<<counter<<endl;
00058   }
00059 }

void NtpStTrimmer::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 150 of file NtpStTrimmer.cxx.

References NueAnalysisCuts::Config(), fCuts, Registry::Get(), Msg::kDebug, kDeltaMSquare, kOutputFile, kReWeight, kTheta23, kUe3Square, and MSG.

00151 {
00152 //======================================================================
00153 // Configure the module given the Registry r
00154 //======================================================================
00155   MSG("NtpStTrimmer",Msg::kDebug)<<"In Trimmer::Config"<<endl;
00156   
00157   fCuts.Config(r);
00158                                                                                
00159   //  const char* tmps;
00160   int imps;
00161   if(r.Get("ReWeight", imps)) {kReWeight = imps;}
00162   
00163   double fmps;
00164   if(r.Get("DeltaMSquare", fmps)) {kDeltaMSquare = fmps;}
00165   if(r.Get("Ue3Square", fmps))    {kUe3Square = fmps;}
00166   if(r.Get("Theta23", fmps))  {kTheta23 = fmps;}
00167 
00168   const char* tmps;
00169   if(r.Get("OutputFile", tmps)) {kOutputFile = tmps;}
00170   
00171 }

const Registry & NtpStTrimmer::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 122 of file NtpStTrimmer.cxx.

References NueAnalysisCuts::DefaultConfig(), fCuts, JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00123 {
00124 //======================================================================
00125 // Supply the default configuration for the module
00126 //======================================================================
00127    MSG("NtpStTrimmer",Msg::kDebug)<<"In Trimmer::DefaultConfig"<<endl;
00128 
00129   static Registry r = fCuts.DefaultConfig();
00130  
00131   // Set name of config
00132   std::string name = this->GetName();
00133   name += ".config.default";
00134   r.SetName(name.c_str());
00135                                                                                 
00136   // Set values in configuration
00137   r.UnLockValues();
00138   r.Set("OutputFile", "TrimmedNtuple.root");
00139 
00140   r.Set("DeltaMSquare", 0.0025);
00141   r.Set("Theta23", TMath::Pi()/4);
00142   r.Set("Ue3Square", 0.01);
00143   r.Set("ReWeight", 0);
00144   
00145   r.LockValues();
00146                                                                                 
00147   return r;
00148 }

void NtpStTrimmer::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 108 of file NtpStTrimmer.cxx.

References counter, and kept.

00109 {
00110   cout<<counter<<" events processed and "<<kept<<" were output"<<endl;
00111 
00112   //fCuts.Report();
00113 //Now i have to output the tree
00114   // Here is where all of the writeout work will be done, first the tree and then the histos
00115 
00116   //If we are oscillating the files, then the effective exposure is only one third per file
00117   //    if you are not using an equal number of files from each type I accept no responsibility
00118   //    for the nature of your results
00119 
00120 }

bool NtpStTrimmer::PassesCuts (  ) 

Definition at line 173 of file NtpStTrimmer.cxx.

References fCuts, NueAnalysisCuts::PassesAllCuts(), NueAnalysisCuts::PassesFiducialVolume(), and NueAnalysisCuts::PassesFullContainment().

Referenced by Reco().

00174 {
00175     bool passes = true;   
00176     if(!fCuts.PassesFiducialVolume())    passes = false;
00177     if(!fCuts.PassesFullContainment())  passes = false;   
00178      
00179     if(!fCuts.PassesAllCuts()) passes = false;
00180 //    if(!fCuts.PassesFileCut())  passes = false;
00181 
00182      // Cut on min Total pulse height per prong (sigcor)
00183 //     if((nr->srevent.planes<1.05||nr->srevent.planes>16) ||
00184 //         (nr->hitcalc.fHitLongEnergy<30||nr->hitcalc.fHitLongEnergy>5000)||
00185 //         (nr->shwfit.uv_molrad_vert<0||nr->shwfit.uv_molrad_vert>5.51)||
00186 //        (nr->shwfit.par_b<0.315||nr->shwfit.par_b>1.47)) passes=false;
00187 
00188    return passes;
00189 }

JobCResult NtpStTrimmer::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 62 of file NtpStTrimmer.cxx.

References counter, NtpStRecord::evthdr, fCuts, MomNavigator::GetFragment(), RecRecordImp< T >::GetHeader(), RecPhysicsHeader::GetSnarl(), RecHeader::GetVldContext(), Msg::kDebug, kept, Msg::kError, JobCResult::kPassed, MSG, NtpSREventSummary::nevent, PassesCuts(), and NueAnalysisCuts::SetInfoObject().

00063 {
00064    bool foundST=false;
00065                                                                                 
00066    VldContext vc;
00067    //first ask mom for a NtpStRecord
00068    NtpStRecord *str=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord","Primary"));
00069    if(str){
00070      foundST=true;
00071      vc=str->GetHeader().GetVldContext();
00072    }
00073 
00074    cout<<"whats up"<<endl; 
00075    if(!foundST){
00076        MSG("NtpStTrimmer",Msg::kError)<<"This code ONLY runs on NtpSt"<<endl;
00077    }
00078 
00079    Int_t evtn = 0;
00080    if(foundST){
00081      evtn=str->evthdr.nevent;
00082    }
00083 
00084    str->SetName("NtpSt_junk");
00085    
00086    for(int i = 0; i < evtn; i++)
00087    {
00088       cout<<"looking at event "<<i<<endl;
00089       fCuts.SetInfoObject(i, str);
00090       if(PassesCuts()) {
00091           MSG("NtpStTrimmer",Msg::kDebug)<<"Excellent a NueRecord survives"
00092                     <<" Snarl "<<str->GetHeader().GetSnarl()
00093                     <<" Event "<<i<<endl;
00094                                                                                 
00095           str->SetName("NtpSt_trim");
00096           kept++;
00097       }
00098    }
00099    if(counter%1000==0){
00100       cout<<"On entry "<<counter<<endl;
00101    }
00102    counter++;
00103    
00104    return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00105 }


Member Data Documentation

int NtpStTrimmer::counter [private]

Definition at line 42 of file NtpStTrimmer.h.

Referenced by BeginJob(), EndJob(), and Reco().

Definition at line 45 of file NtpStTrimmer.h.

Referenced by Config(), DefaultConfig(), PassesCuts(), and Reco().

Float_t NtpStTrimmer::kDeltaMSquare [private]

Definition at line 52 of file NtpStTrimmer.h.

Referenced by Config().

int NtpStTrimmer::kept [private]

Definition at line 43 of file NtpStTrimmer.h.

Referenced by BeginJob(), EndJob(), and Reco().

std::string NtpStTrimmer::kOutputFile [private]

Definition at line 47 of file NtpStTrimmer.h.

Referenced by Config().

Int_t NtpStTrimmer::kReWeight [private]

Definition at line 49 of file NtpStTrimmer.h.

Referenced by Config().

Float_t NtpStTrimmer::kTheta23 [private]

Definition at line 50 of file NtpStTrimmer.h.

Referenced by Config().

Float_t NtpStTrimmer::kUe3Square [private]

Definition at line 51 of file NtpStTrimmer.h.

Referenced by Config().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1