Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AnaTrim.cxx

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #include "TTree.h"
00010 #include "TFile.h"
00011 #include "TDirectory.h"
00012 #include "TROOT.h"
00013 
00014 #include "NueAna/ParticlePID/ParticleAna/AnaTrim.h"
00015 #include "MessageService/MsgService.h"
00016 #include "MinosObjectMap/MomNavigator.h"
00017 #include "JobControl/JobCModuleRegistry.h" // For JOBMODULE macro
00018 
00019 #include "NueAna/ParticlePID/ParticleAna/PRecord.h"
00020 #include "NueAna/ParticlePID/ParticleAna/PRecordAna.h"
00021 
00022 
00023 
00024 
00025 #include <math.h>
00026 
00027 
00028 JOBMODULE(AnaTrim, "AnaTrim",
00029           "does the ana trim for ParticleFinder");
00030 CVSID("$Id: AnaTrim.cxx,v 1.2 2009/06/23 22:42:24 scavan Exp $");
00031 //......................................................................
00032 
00033 AnaTrim::AnaTrim() 
00034 {
00035 
00036 
00037 
00038 
00039         
00043 }
00044 //......................................................................
00045 
00046 AnaTrim::~AnaTrim()
00047 {
00051 
00052 
00053 }
00054 
00055 //......................................................................
00056 
00057 void AnaTrim::BeginJob()
00058 {
00062 }
00063 
00064 //......................................................................
00065 
00066 void AnaTrim::EndJob()
00067 {
00071 
00072   
00073 }
00074 
00075 //......................................................................
00076 
00077 JobCResult AnaTrim::Reco(MomNavigator* mom)
00078 {
00082 
00083   std::vector<TObject* > hft =( mom->GetFragmentList("PRecord"));
00084 
00085 
00086 
00087 
00088         for(unsigned int s =0;s<hft.size();s++)
00089         {
00090                 PRecord *n=0;
00091                 n=dynamic_cast<PRecord *>(hft[s]);      
00092 
00093 //              int infid=1;
00094 //      
00095 //              infid = infid && (n->event.vtx_z>0.47692 && n->event.vtx_z<14.6 || n->event.vtx_z>16.0 && n->event.vtx_z <29.8);
00096 //              infid = infid && (sqrt(n->event.vtx_u*n->event.vtx_u+n->event.vtx_v*n->event.vtx_v)<4);
00097 //              infid = infid && (sqrt(n->event.vtx_u*n->event.vtx_u+n->event.vtx_v*n->event.vtx_v)>0.5);
00098         
00099         
00100         
00101                 int passcuts=1;
00102                 
00103 //              passcuts=passcuts && infid;
00104 //              passcuts=passcuts && n->particles.ntot>1;
00105 //              passcuts=passcuts && n->particles.totvise > 25.;
00106 //              passcuts=passcuts && n->particles.totvise < 25.*8.;
00107                         
00108         
00109                 if(!passcuts)continue;
00110                         n->SetName("TrimmedPA");
00111                 
00112         //      n->mctrue.trainweight *=3.5/6.5/10;
00113         
00114         
00115 
00116         }
00117 
00118                 
00119 
00120 
00121   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00122 }
00123 
00124 //......................................................................
00125 
00126 const Registry& AnaTrim::DefaultConfig() const
00127 {
00131   static Registry r; // Default configuration for module
00132 
00133   // Set name of config
00134   std::string name = this->GetName();
00135   name += ".config.default";
00136   r.SetName(name.c_str());
00137  // r.Set("POTTreeFileName","pottree.root");
00138   // Set values in configuration
00139   r.UnLockValues();
00140   r.LockValues();
00141 
00142 
00143   return r;
00144 }
00145 
00146 //......................................................................
00147 
00148 void AnaTrim::Config(const Registry& /*r*/)
00149 {
00153   
00154  
00155    // const char* tmps;
00156     //if(r.Get("POTTreeFileName",tmps)){kPOTTreeName=tmps;}
00157   
00158 }
00159 
00160 //......................................................................
00161 
00162 void AnaTrim::Reset()
00163 {
00167 }
00168 
00170 

Generated on Mon Feb 15 11:06:21 2010 for loon by  doxygen 1.3.9.1