SpillTypeFilter Class Reference

#include <SpillTypeFilter.h>

Inheritance diagram for SpillTypeFilter:
JobCModule

List of all members.

Public Member Functions

 SpillTypeFilter ()
 ~SpillTypeFilter ()
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 SpillTypeFilter.h.


Constructor & Destructor Documentation

SpillTypeFilter::SpillTypeFilter (  ) 

Definition at line 37 of file SpillTypeFilter.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 {}

SpillTypeFilter::~SpillTypeFilter (  ) 

Definition at line 48 of file SpillTypeFilter.cxx.

00049 {}


Member Function Documentation

void SpillTypeFilter::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 52 of file SpillTypeFilter.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 SpillTypeFilter::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 142 of file SpillTypeFilter.cxx.

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

00143 {
00144 //======================================================================
00145 // Configure the module given the Registry r
00146 //======================================================================
00147   MSG("SpillTypeFilter",Msg::kDebug)<<"In Trimmer::Config"<<endl;
00148   
00149   fCuts.Config(r);
00150                                                                                
00151   //  const char* tmps;
00152   int imps;
00153   if(r.Get("ReWeight", imps)) {kReWeight = imps;}
00154   
00155   double fmps;
00156   if(r.Get("DeltaMSquare", fmps)) {kDeltaMSquare = fmps;}
00157   if(r.Get("Ue3Square", fmps))    {kUe3Square = fmps;}
00158   if(r.Get("Theta23", fmps))  {kTheta23 = fmps;}
00159 
00160   const char* tmps;
00161   if(r.Get("OutputFile", tmps)) {kOutputFile = tmps;}
00162   
00163 }

const Registry & SpillTypeFilter::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 114 of file SpillTypeFilter.cxx.

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

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

void SpillTypeFilter::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 100 of file SpillTypeFilter.cxx.

References counter, and kept.

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

bool SpillTypeFilter::PassesCuts (  ) 

Definition at line 165 of file SpillTypeFilter.cxx.

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

00166 {
00167     bool passes = true;   
00168     if(!fCuts.PassesFiducialVolume())    passes = false;
00169     if(!fCuts.PassesFullContainment())  passes = false;   
00170      
00171     if(!fCuts.PassesAllCuts()) passes = false;
00172 //    if(!fCuts.PassesFileCut())  passes = false;
00173 
00174      // Cut on min Total pulse height per prong (sigcor)
00175 //     if((nr->srevent.planes<1.05||nr->srevent.planes>16) ||
00176 //         (nr->hitcalc.fHitLongEnergy<30||nr->hitcalc.fHitLongEnergy>5000)||
00177 //         (nr->shwfit.uv_molrad_vert<0||nr->shwfit.uv_molrad_vert>5.51)||
00178 //        (nr->shwfit.par_b<0.315||nr->shwfit.par_b>1.47)) passes=false;
00179 
00180    return passes;
00181 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 62 of file SpillTypeFilter.cxx.

References NtpStRecord::evthdr, MomNavigator::GetFragment(), RecRecordImp< T >::GetHeader(), RecPhysicsHeader::GetRemoteSpillType(), header, JobCResult::kFailed, JobCResult::kPassed, and NtpSREventSummary::nevent.

00063 {
00064    bool foundST=false;
00065    bool passes=false;
00066                                                                                 
00067   // VldContext vc;
00068    //first ask mom for a NtpStRecord
00069    NtpStRecord *str=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord","Primary"));
00070    if(str){
00071      foundST=true;
00072 
00073    }
00074 
00075 
00076 
00077 
00078 
00079 
00080    Int_t evtn = 0;
00081    if(foundST){
00082      evtn=str->evthdr.nevent;
00083    }
00084                                                                  
00085     const RecCandHeader *header;
00086       header = &(str->GetHeader());
00087 
00088         if(header->GetRemoteSpillType()==3)
00089         {
00090                 passes=true;
00091         //      printf("SPILL TYPE %d\n",header->GetRemoteSpillType());
00092         }
00093 
00094 
00095    if (!passes) return JobCResult::kFailed;
00096    return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00097 }


Member Data Documentation

int SpillTypeFilter::counter [private]

Definition at line 42 of file SpillTypeFilter.h.

Referenced by BeginJob(), and EndJob().

Definition at line 45 of file SpillTypeFilter.h.

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

Float_t SpillTypeFilter::kDeltaMSquare [private]

Definition at line 52 of file SpillTypeFilter.h.

Referenced by Config().

int SpillTypeFilter::kept [private]

Definition at line 43 of file SpillTypeFilter.h.

Referenced by BeginJob(), and EndJob().

std::string SpillTypeFilter::kOutputFile [private]

Definition at line 47 of file SpillTypeFilter.h.

Referenced by Config().

Int_t SpillTypeFilter::kReWeight [private]

Definition at line 49 of file SpillTypeFilter.h.

Referenced by Config().

Float_t SpillTypeFilter::kTheta23 [private]

Definition at line 50 of file SpillTypeFilter.h.

Referenced by Config().

Float_t SpillTypeFilter::kUe3Square [private]

Definition at line 51 of file SpillTypeFilter.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