CompareAll Class Reference

#include <CompareAll.h>

Inheritance diagram for CompareAll:
JobCModule

List of all members.

Public Member Functions

 CompareAll ()
 ~CompareAll ()
JobCResult Ana (const MomNavigator *mom)
void EndJob ()
void BeginJob ()
bool PassesCuts (NueRecord *nr)
bool PassesBeamCuts (NueRecord *nr)
TString MakeIdString (NueRecord *nr)
void FillFromList (NueRecord *nr, TString id, Float_t weight)
bool NeedsSpecialAttention (TString name, NueRecord *nr, Float_t &value)
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Types

enum  POTID { far_mc, far_data, near_mc, near_data }

Private Attributes

int counter
vector< string > varName
vector< Float_t > beg
vector< Float_t > end
vector< Int_t > nbins
vector< TString > gtype
Int_t kHiPlaneTrackCut
Int_t kLoPlaneEventCut
Int_t kHiTrackLikeCut
Int_t kDPlaneCut
Int_t kLoPhNStripCut
Int_t kLoPhNPlaneCut
Float_t kHiEnergyCut
Float_t kLoEnergyCut
Float_t kHiEnergyShowerCut
Float_t kLoEnergyShowerCut
Float_t kPhStripCut
Float_t kPhPlaneCut
Float_t kLoCurrentCut
Float_t kLoHorBeamWidth
Float_t kHiHorBeamWidth
Float_t kLoVertBeamWidth
Float_t kHiVertBeamWidth
Float_t kLoNuTarZ
Float_t kHiNuTarZ
Int_t kOscillate
std::string kOutputFile
Float_t fPOT [4]
Float_t fOscParams [4]
TTree * fHistRecord

Detailed Description

Definition at line 24 of file CompareAll.h.


Member Enumeration Documentation

enum CompareAll::POTID [private]
Enumerator:
far_mc 
far_data 
near_mc 
near_data 

Definition at line 77 of file CompareAll.h.


Constructor & Destructor Documentation

CompareAll::CompareAll (  ) 

Definition at line 36 of file CompareAll.cxx.

00036                       :
00037     counter(0),
00038    kHiPlaneTrackCut(25),
00039    kLoPlaneEventCut(-1),
00040    kHiTrackLikeCut(-1),
00041    kDPlaneCut(-1),
00042    kLoPhNStripCut(-1),
00043    kLoPhNPlaneCut(-1),
00044    kHiEnergyCut(-1),
00045    kLoEnergyCut(-1),
00046    kHiEnergyShowerCut(-1),
00047    kLoEnergyShowerCut(-1),
00048    kPhStripCut(-1),
00049    kPhPlaneCut(-1),
00050    kLoCurrentCut(0.1),
00051    kLoHorBeamWidth(0.0),
00052    kHiHorBeamWidth(2.9),
00053    kLoVertBeamWidth(0.0),
00054    kHiVertBeamWidth(2.9),
00055    kLoNuTarZ(-1),
00056    kHiNuTarZ(1000),
00057    kOscillate(0),   
00058    kOutputFile("HistManOut.root")
00059 {}

CompareAll::~CompareAll (  ) 

Definition at line 63 of file CompareAll.cxx.

00064 {}


Member Function Documentation

JobCResult CompareAll::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 136 of file CompareAll.cxx.

References ANtpTruthInfoBeamNue::Baseline, BeamMon::bI, NueRecord::bmon, counter, ANtpTruthInfoBeamNue::DeltamSquared23, far_data, far_mc, FillFromList(), ANtpTruthInfoBeamNue::fNueWeight, fOscParams, ANtpTruthInfoBeamNue::fOscProb, fPOT, MomNavigator::FragmentIter(), VldContext::GetDetector(), NueHeader::GetEventNo(), RecRecordImp< T >::GetHeader(), NueHeader::GetRun(), VldContext::GetSimFlag(), NueHeader::GetSnarl(), RecHeader::GetVldContext(), SimFlag::kData, Msg::kDebug, Msg::kError, Detector::kFar, SimFlag::kMC, Detector::kNear, kOscillate, JobCResult::kPassed, MakeIdString(), NueRecord::mctrue, MSG, near_data, near_mc, PassesBeamCuts(), PassesCuts(), ANtpTruthInfoBeamNue::Theta23, and ANtpTruthInfoBeamNue::Ue3Squared.

00137 {
00138    //get all NueRecords from mom 
00139    //may have more than one per go since mom reads in a snarl's worth of data
00140    //so, this is a little more complicated than just asking for a NueRecord
00141    TObject *obj=0;
00142 //  static Float_t total_pot = 0;
00143   static Int_t runno = -1;
00144   static Int_t snarlno = -1;
00145 
00146 //  if its a brand new far det mc file add a far mc number of POT
00147 //  if its a brand new near det mc file add near mc number of POT
00148 // if mc also chekc htat the nueosc params are the same
00149 
00150 //  if its data -> add up the number of POT recorded in the bmon nutple for each snarl
00151 
00152 
00153 //  if(
00154 
00155 //  static Int_t printpot = 1;
00156 
00157 
00158    TIter objiter = mom->FragmentIter();
00159    while((obj=objiter.Next())){
00160       NueRecord *nr = static_cast<NueRecord *>(obj);
00161       if(nr){
00162          MSG("CompareAll",Msg::kDebug)<<"Found a NueRecord in MOM"<<endl;
00163       }
00164       else{
00165          MSG("CompareAll",Msg::kError)<<"Didn't find a NueRecord in MOM"<<endl;
00166          continue;
00167       }
00168       MSG("CompareAll",Msg::kDebug)<<"Found a NueRecord "<<nr<<endl;
00169       SimFlag::SimFlag_t s = nr->GetHeader().GetVldContext().GetSimFlag();
00170       Detector::Detector_t d = 
00171               nr->GetHeader().GetVldContext().GetDetector();
00172   
00173 //  need at least 1 sucessfully reconstructed event
00174        
00175      if(counter%1000==0){
00176          cout<<"On entry "<<counter<<endl;
00177      }
00178      counter++;
00179       
00180      if(nr->GetHeader().GetEventNo()<0){
00181         continue;
00182      }
00183 
00184      //  if its a brand new far det mc file add a far mc number of POT
00185      //  //  if its a brand new near det mc file add near mc number of POT
00186      //  // if mc also chekc htat the nueosc params are the same
00187      //  
00188 
00189 
00190      //if it is data
00191      if(s==SimFlag::kData){
00192        if(PassesBeamCuts(nr)){
00193          if (runno != nr->GetHeader().GetRun() ||
00194                 runno == nr->GetHeader().GetRun() &&
00195                 snarlno != nr->GetHeader().GetSnarl())
00196          {
00197              runno = nr->GetHeader().GetRun();
00198              snarlno = nr->GetHeader().GetSnarl();
00199 
00200              if(d == Detector::kFar)
00201                fPOT[far_data] += nr->bmon.bI;
00202              if(d == Detector::kNear)
00203                fPOT[near_data] += nr->bmon.bI;                    
00204         }
00205      }                                                                         
00206    }       
00207      if(s==SimFlag::kMC){
00208        if (runno != nr->GetHeader().GetRun() ) 
00209        {
00210            runno = nr->GetHeader().GetRun();
00211                                                                                 
00212            if(d == Detector::kFar)
00213                fPOT[far_mc] += 6.5e8;
00214            if(d == Detector::kNear)
00215                fPOT[near_mc] += 550*24.;
00216       }
00217       if(fOscParams[0] < 0)
00218       {
00219         fOscParams[0] = nr->mctrue.Baseline;
00220         fOscParams[1] = nr->mctrue.DeltamSquared23;
00221         fOscParams[2] = nr->mctrue.Theta23;
00222         fOscParams[3] = nr->mctrue.Ue3Squared;          
00223       }
00224        
00225     }
00226            
00227      if(PassesCuts(nr)){
00228        if (s==SimFlag::kData){
00229          if(PassesBeamCuts(nr)){
00230            TString id = MakeIdString(nr);
00231            FillFromList(nr,id,1.);
00232          }
00233        }else{
00234            TString id = MakeIdString(nr);
00235            Float_t weight  = 1.0;
00236            if(kOscillate) weight = nr->mctrue.fOscProb*nr->mctrue.fNueWeight;
00237            FillFromList(nr,id,weight);
00238         }
00239      }
00240    }
00241 
00242    return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00243 }

void CompareAll::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 67 of file CompareAll.cxx.

References beg, counter, end, fHistRecord, fOscParams, fPOT, gtype, ANtpDefaultValue::kFloat, nbins, and varName.

00068 {
00069 
00070   if(counter%1000==0){
00071     cout<<"On entry "<<counter<<endl;
00072   }
00073   counter++;
00074 
00075   string dumName;
00076   TString  dumtype;
00077   Float_t dumstart, dumend;
00078   Int_t dumbins, nvar;
00079   ifstream ins;
00080   ins.open("AllParam.txt");
00081 
00082   nvar = 0;
00083 
00084   fPOT[0] = fPOT[1] = fPOT[2] = fPOT[3] = 0.0;
00085   for(int i = 0 ; i < 4; i++)
00086     fOscParams[i] = ANtpDefVal::kFloat;
00087 
00088   //read in the file
00089   while(!ins.eof()) {
00090       ins>>dumName>>dumstart>>dumend>>dumbins>>dumtype;
00091       if(!ins.eof()){
00092           varName.push_back(dumName);
00093           beg.push_back(dumstart);  end.push_back(dumend);
00094           nbins.push_back(dumbins);   gtype.push_back(dumtype);
00095           nvar++;
00096          }
00097     }
00098   cout<<nvar<<" variables read in"<<endl;
00099 
00100 // static HistMan *hm = new HistMan("allcomp");
00101         
00102   //create all possible histograms
00103  
00104   vector<TString> names;
00105   names.push_back("_far_mc_nue");
00106   names.push_back("_far_mc_numu");
00107   names.push_back("_far_mc_bnue");
00108   names.push_back("_far_mc_nutau");
00109   names.push_back("_far_mc_nc");
00110   names.push_back("_near_mc_bnue");
00111   names.push_back("_near_mc_numu");
00112   names.push_back("_near_mc_nc");
00113   names.push_back("_far_data");
00114   names.push_back("_near_data");
00115   names.push_back("_unknown");
00116  
00117   
00118   for(UInt_t i = 0; i < names.size(); i++){
00119      for(UInt_t l = 0; l < varName.size(); l++){
00120            string temp = (varName[l]);
00121            string dirstring = "allcomp/" + temp.substr(0,temp.find_first_of("."));
00122            HistMan hm2(dirstring.c_str());
00123            TString param = varName[l] + names[i];
00124            hm2.Book<TH1F>(param,param,nbins[l],beg[l],end[l]);     
00125     }
00126   }
00127   
00128   fHistRecord = new TTree("histRecord", "Historgram Filling Information");
00129 
00130   fHistRecord->Branch("POT", &fPOT, "farMCPOT/F:farDataPOT/F:nearMCPOT/F:nearDataPOT/F");
00131   fHistRecord->Branch("OscParams", &fOscParams, "Baseline/F:deltam23/F:theta23/F:Ue3/F");
00132 
00133 }

void CompareAll::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 332 of file CompareAll.cxx.

References Registry::Get(), Msg::kDebug, kDPlaneCut, kHiEnergyCut, kHiEnergyShowerCut, kHiHorBeamWidth, kHiNuTarZ, kHiPlaneTrackCut, kHiTrackLikeCut, kHiVertBeamWidth, kLoCurrentCut, kLoEnergyCut, kLoEnergyShowerCut, kLoHorBeamWidth, kLoNuTarZ, kLoPhNPlaneCut, kLoPhNStripCut, kLoPlaneEventCut, kLoVertBeamWidth, kOscillate, kOutputFile, kPhPlaneCut, kPhStripCut, and MSG.

00333 {
00334 //======================================================================
00335 // Configure the module given the Registry r
00336 //======================================================================
00337   MSG("CompareAll",Msg::kDebug)<<"In CompareAll::Config"<<endl;
00338                                                                                 
00339   //  const char* tmps;
00340   int imps;
00341   if(r.Get("HiPlaneTrackCut",imps)) { kHiPlaneTrackCut=imps;}
00342   if(r.Get("LoPlaneEventCut",imps)) { kLoPlaneEventCut=imps;}
00343   if(r.Get("HiTrackLikeCut",imps)) { kHiTrackLikeCut=imps;}
00344   if(r.Get("DPlaneCut",imps)) { kDPlaneCut=imps;}
00345   if(r.Get("LoPhNStripCut",imps)) { kLoPhNStripCut=imps;}
00346   if(r.Get("LoPhNPlaneCut",imps)) { kLoPhNPlaneCut=imps;}
00347 
00348   if(r.Get("LoNuTarZ", imps)) {kLoNuTarZ = imps;}
00349   if(r.Get("HiNuTarZ", imps)) {kHiNuTarZ = imps;}
00350   if(r.Get("Oscillate", imps)) {kOscillate = imps;}     
00351   
00352   double fmps;
00353   if(r.Get("HiEnergyCut",fmps)) { kHiEnergyCut=fmps;}
00354   if(r.Get("LoEnergyCut",fmps)) { kLoEnergyCut=fmps;}
00355   if(r.Get("HiEnergyShowerCut",fmps)) { kHiEnergyShowerCut=fmps;}
00356   if(r.Get("LoEnergyShowerCut",fmps)) { kLoEnergyShowerCut=fmps;}
00357   if(r.Get("PhStripCut",fmps)) { kPhStripCut=fmps;}
00358   if(r.Get("PhPlaneCut",fmps)) { kPhPlaneCut=fmps;}
00359 
00360   if(r.Get("LoCurrentCut", fmps)) {kLoCurrentCut = fmps;}
00361   if(r.Get("LoHorBeamWidth", fmps)) {kLoHorBeamWidth = fmps;}
00362   if(r.Get("HiHorBeamWidth", fmps)) {kHiHorBeamWidth = fmps;}
00363   if(r.Get("LoVertBeamWidth", fmps)) {kLoVertBeamWidth = fmps;}
00364   if(r.Get("HiVertBeamWidth", fmps)) {kHiVertBeamWidth = fmps;}
00365 
00366   const char* tmps;
00367   if(r.Get("OutputFile", tmps)) {kOutputFile = tmps;}
00368   
00369 }

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

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

00290 {
00291 //======================================================================
00292 // Supply the default configuration for the module
00293 //======================================================================
00294    MSG("CompareAll",Msg::kDebug)<<"In CompareAll::DefaultConfig"<<endl;
00295                                                                                 
00296   static Registry r; // Default configuration for module
00297                                                                                 
00298   // Set name of config
00299   std::string name = this->GetName();
00300   name += ".config.default";
00301   r.SetName(name.c_str());
00302                                                                                 
00303   // Set values in configuration
00304   r.UnLockValues();
00305   r.Set("HiPlaneTrackCut",25);
00306   r.Set("LoPlaneEventCut",-1);
00307   r.Set("HiTrackLikeCut",-1);
00308   r.Set("DPlaneCut",-1);
00309   r.Set("LoPhNStripCut",-1);
00310   r.Set("LoPhNPlaneCut",-1);
00311   r.Set("HiEnergyCut",-1);
00312   r.Set("LoEnergyCut",-1);
00313   r.Set("HiEnergyShowerCut",-1);
00314   r.Set("LoEnergyShowerCut",-1);
00315   r.Set("PhStripCut",-1);
00316   r.Set("PhPlaneCut",-1);
00317   r.Set("LoCurrentCut", 0.1);
00318   r.Set("LoHorBeamWidth", 0.0);
00319   r.Set("HiHorBeamWidth", 2.9);
00320   r.Set("LoVertBeamWidth", 0.0);
00321   r.Set("HiVertBeamWidth", 2.9);
00322   r.Set("LoNuTarZ", -1);
00323   r.Set("HiNuTarZ", 1000);
00324   r.Set("Oscillate", 0);
00325   r.Set("OutputFile", "HistManInfo.root");
00326   
00327   r.LockValues();
00328                                                                                 
00329   return r;
00330 }

void CompareAll::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 246 of file CompareAll.cxx.

References far_mc, fHistRecord, fPOT, kOscillate, kOutputFile, varName, and HistMan::WriteOut().

00247 {
00248 //Now i have to output the tree
00249   // Here is where all of the writeout work will be done, first the tree and then the histos
00250 
00251   //If we are oscillating the files, then the effective exposure is only one third per file
00252   //    if you are not using an equal number of files from each type I accept no responsibility
00253   //    for the nature of your results
00254   if(kOscillate){
00255     fPOT[far_mc] =  fPOT[far_mc]/3.0;
00256   }
00257 
00258   TFile* file = new TFile(kOutputFile.c_str(), "update");
00259   file->cd();
00260   fHistRecord->Fill();
00261   fHistRecord->Write();
00262 //  delete file;
00263 
00264   vector<TString> branches;  
00265   for(UInt_t i = 0; i < varName.size(); i++)
00266   {
00267      string temp = (varName[i]);
00268      string dirstring = "allcomp/" + temp.substr(0,temp.find_first_of("."));
00269      bool newBranch = true;
00270      
00271      for(UInt_t j = 0; j < branches.size() && newBranch; j++)
00272      {
00273          if(dirstring == branches[j])
00274                 newBranch = false;
00275      }
00276      if(newBranch) branches.push_back(dirstring);
00277   }
00278 
00279   for(UInt_t i = 0; i < branches.size(); i++)
00280   {  
00281     HistMan *hm2 = new HistMan(branches[i]);
00282     hm2->WriteOut(*file);
00283   }
00284 
00285 
00286   delete file;  
00287 }

void CompareAll::FillFromList ( NueRecord nr,
TString  id,
Float_t  weight 
)

Definition at line 492 of file CompareAll.cxx.

References count, ANtpDefaultValue::IsDefault(), Msg::kDebug, MSG, NeedsSpecialAttention(), and varName.

Referenced by Ana().

00493 {
00494     if(varName.size() == 0) return;
00495     TString hname;
00496     UInt_t count = 0;
00497     
00498     TClass *cl;
00499     TRealData *rd;
00500     string vName;
00501     TDataMember *member;
00502     TDataType *membertype;
00503     Float_t value = 0.0;
00504     
00505     cl=nr->IsA();
00506     TIter  next(cl->GetListOfRealData());                                                                                 
00507     while ((rd =dynamic_cast<TRealData*>(next()))) {
00508       member = rd->GetDataMember();
00509       membertype = member->GetDataType();
00510       vName=rd->GetName();
00511                                                                          
00512       Int_t offset = rd->GetThisOffset();
00513       char *pointer = (char*)nr  + offset;
00514 
00515       for(UInt_t i = 0; i < varName.size();i++){
00516         if(vName == varName[i]){
00517             value = -9999;
00518             if(!NeedsSpecialAttention(vName, nr, value))
00519                 value=atof(membertype->AsString(pointer));
00520              MSG("CompareAll",Msg::kDebug)<<"Found variable "
00521                                         <<vName<<" with value "<<value;
00522              MSG("CompareAll",Msg::kDebug)<<"Storing it w/ id "<<id<<endl;
00523              
00524             
00525             if(!ANtpDefVal::IsDefault(value) && 
00526                 !ANtpDefVal::IsDefault(static_cast<Double_t> (value)) && 
00527                 !ANtpDefVal::IsDefault(static_cast<Int_t> (value))){
00528 
00529                 string dirstring = "allcomp/" + vName.substr(0,vName.find_first_of("."));
00530                 HistMan hm2(dirstring.c_str());                  
00531                     
00532                 hname = varName[i]+id;
00533                 TH1F* hist = hm2.Get<TH1F>(hname);      
00534                 hist->Fill(value, weight);
00535              }
00536              MSG("CompareAll",Msg::kDebug)<<"Found variable "
00537                    <<vName<<" with value "<<value;
00538 
00539           count++;
00540           i = varName.size();
00541           }
00542       }
00543       if(count == varName.size()) break;
00544     }
00545           
00546    return;     
00547 }     

TString CompareAll::MakeIdString ( NueRecord nr  ) 

Definition at line 433 of file CompareAll.cxx.

References det, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), ANtpTruthInfo::interactionType, SimFlag::kData, Detector::kFar, SimFlag::kMC, Detector::kNear, NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, and ANtpTruthInfo::nuFlavor.

Referenced by Ana().

00434 {
00435   Detector::Detector_t d = nr->GetHeader().GetVldContext().GetDetector();
00436   SimFlag::SimFlag_t s = nr->GetHeader().GetVldContext().GetSimFlag();
00437   
00438   TString det, dm;
00439   TString type;
00440 
00441   if(d==Detector::kFar){
00442     det = "_far";
00443   }
00444   else if(d==Detector::kNear){
00445     det = "_near";
00446   }
00447   else{
00448     return "_unknown";
00449   }
00450                                                                         
00451   if(s==SimFlag::kData){
00452     dm = "_data";
00453     TString id = det+dm;
00454     return id;
00455   }
00456   else 
00457      if (s==SimFlag::kMC){
00458           dm = "_mc";
00459                                                                                 
00460        if(nr->mctrue.interactionType==1){
00461          if(abs(nr->mctrue.nuFlavor)==12 &&
00462             abs(nr->mctrue.nonOscNuFlavor)==12){
00463               type = "bnue";
00464          }
00465          else if(abs(nr->mctrue.nuFlavor)==12){
00466                type = "nue";
00467          }
00468          else if(abs(nr->mctrue.nuFlavor)==14){
00469                 type = "numu";
00470          }
00471          else if(abs(nr->mctrue.nuFlavor)==16){
00472                 type = "nutau";
00473          }
00474          else{
00475                 return "unknown";
00476          }
00477        }
00478        else{
00479               type = "nc";
00480        }
00481 
00482        TString id = det+dm+ "_" + type;
00483        return id;
00484   }
00485   else {
00486          return "unknown";
00487        }
00488   
00489 }

bool CompareAll::NeedsSpecialAttention ( TString  name,
NueRecord nr,
Float_t &  value 
)

Definition at line 550 of file CompareAll.cxx.

References MSTCalc::eallm1, MSTCalc::eallw1, MSTCalc::enn1, NueHeader::GetEventNo(), NueHeader::GetEvents(), RecRecordImp< T >::GetHeader(), NueHeader::GetRun(), NueHeader::GetSnarl(), NueHeader::GetSubRun(), NueHeader::GetTrackLength(), NueRecord::mstvars, MSTCalc::oallm1, MSTCalc::oallw1, and MSTCalc::onn1.

Referenced by FillFromList().

00551 {
00552    
00553    //All the fHeaders and four of hte MST vars require special effort
00554      if(name == "fHeader.fSnarl") {
00555          value = nr->GetHeader().GetSnarl();
00556      }if(name == "fHeader.fRun") {
00557          value = nr->GetHeader().GetRun();
00558      }if(name == "fHeader.fSubRun") {
00559          value = nr->GetHeader().GetSubRun();
00560      }if(name == "fHeader.fEvtNo") {
00561          value = nr->GetHeader().GetEventNo();
00562      }if(name == "fHeader.fEvents") {
00563          value = nr->GetHeader().GetEvents();
00564      }if(name == "fHeader.fTrackLength") {
00565          value = nr->GetHeader().GetTrackLength();
00566      }
00567 
00568      if(name == "mstvars.eallw1") {
00569         if(nr->mstvars.enn1 > 0) value = 0.0;
00570         for(int i=0;i<nr->mstvars.enn1;i++){
00571           value += nr->mstvars.eallw1[i];
00572         }
00573      }
00574      if(name == "mstvars.oallw1") {
00575         if(nr->mstvars.onn1 > 0) value = 0.0;
00576         for(int i=0;i<nr->mstvars.onn1;i++){
00577           value += nr->mstvars.oallw1[i];
00578         }
00579      } 
00580      if(name == "mstvars.eallm1") {
00581         if(nr->mstvars.enn1 > 0) value = 0.0;
00582         for(int i=0;i<nr->mstvars.enn1;i++){
00583           value += nr->mstvars.eallm1[i];
00584         }
00585      }
00586      if(name == "mstvars.oallm1") {
00587          if(nr->mstvars.onn1 > 0) value = 0.0;
00588         for(int i=0;i<nr->mstvars.onn1;i++){
00589           value += nr->mstvars.oallm1[i];
00590         }
00591      }    
00592 
00593      if(value > -9999) return true;
00594      return false;
00595 }

bool CompareAll::PassesBeamCuts ( NueRecord nr  ) 

Definition at line 374 of file CompareAll.cxx.

References BeamMon::bI, NueRecord::bmon, RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), BeamMon::hbw, SimFlag::kData, kHiHorBeamWidth, kHiNuTarZ, kHiVertBeamWidth, kLoCurrentCut, kLoHorBeamWidth, kLoNuTarZ, kLoVertBeamWidth, BeamMon::nuTarZ, and BeamMon::vbw.

Referenced by Ana().

00375 {
00376   //bool passes = true;
00377   if (nr->GetHeader().GetVldContext().GetSimFlag()!=SimFlag::kData) return true;
00378 
00379   if(kLoCurrentCut > 0)
00380     if (nr->bmon.bI < kLoCurrentCut) return false;      //beam intensity (in 1e12)
00381   if(kLoHorBeamWidth > 0)    
00382     if (nr->bmon.hbw*1e3 < kLoHorBeamWidth) return false;     //horizontal beam width
00383   if(kHiHorBeamWidth > 0)    
00384     if (nr->bmon.hbw*1e3 > kHiHorBeamWidth) return false;
00385   if(kLoVertBeamWidth > 0)        
00386     if (nr->bmon.vbw*1e3 < kLoVertBeamWidth) return false;     //vertical beam width
00387   if(kHiVertBeamWidth > 0)
00388     if (nr->bmon.vbw*1e3 > kHiVertBeamWidth) return false;
00389   if(kLoNuTarZ > 0)
00390     if (nr->bmon.nuTarZ < kLoNuTarZ) return false;  //low energy position
00391   if(kHiNuTarZ > 0)
00392     if (nr->bmon.nuTarZ > kHiNuTarZ) return false;
00393     
00394   return true;
00395 }

bool CompareAll::PassesCuts ( NueRecord nr  ) 

Definition at line 399 of file CompareAll.cxx.

References NueRecord::anainfo, RecRecordImp< T >::GetHeader(), NueHeader::GetTrackLength(), ANtpEventInfoNue::hotch, AnalysisInfoNue::inFiducialVolume, AnalysisInfoNue::isFullyContained, kHiEnergyCut, kHiEnergyShowerCut, kHiPlaneTrackCut, kHiTrackLikeCut, kLoEnergyCut, kLoEnergyShowerCut, kLoPlaneEventCut, EventFilter::PassesAllCuts(), ANtpEventInfoNue::phMeu, ANtpTrackInfo::planes, ANtpTrackInfo::pulseHeight, ANtpEventInfo::pulseHeight, ANtpShowerInfo::pulseHeight, NueRecord::srevent, NueRecord::srshower, and NueRecord::srtrack.

Referenced by Ana().

00400 {
00401     bool passes = true;   
00402 
00403     //dont even bother if there is a long track
00404     if(nr->srtrack.planes > 25) passes = false;
00405     if(nr->anainfo.inFiducialVolume != 1)
00406         passes = false;
00407     //dont even bother if there is a long track
00408     if (nr->srtrack.planes > 25) passes = false;
00409     if (nr->srevent.pulseHeight<2e4) passes = false;
00410                                                                                
00411     if (nr->anainfo.isFullyContained != 1 && nr->anainfo.isFullyContained!= -2)
00412             passes = false;
00413                                                                                 
00414     if (nr->srevent.phMeu>150) passes = false;
00415     if (nr->srevent.hotch==1) passes = false;
00416     if((TMath::Max(nr->srtrack.pulseHeight,nr->srshower.pulseHeight)<5000))
00417         passes = false;
00418 
00419    //only look at events for which mst actually gets calculated
00420    if(nr->GetHeader().GetTrackLength()>25)
00421        passes = false;
00422      
00423    if(!EventFilter::PassesAllCuts(nr,kHiPlaneTrackCut,kHiTrackLikeCut,
00424                            kLoPlaneEventCut, kHiEnergyCut,
00425                            kLoEnergyCut, kHiEnergyShowerCut,
00426                            kLoEnergyShowerCut))
00427      passes = false;
00428 
00429    return passes;
00430 }


Member Data Documentation

vector<Float_t> CompareAll::beg [private]

Definition at line 47 of file CompareAll.h.

Referenced by BeginJob().

int CompareAll::counter [private]

Definition at line 45 of file CompareAll.h.

Referenced by Ana(), and BeginJob().

vector<Float_t> CompareAll::end [private]

Definition at line 48 of file CompareAll.h.

Referenced by BeginJob().

TTree* CompareAll::fHistRecord [private]

Definition at line 75 of file CompareAll.h.

Referenced by BeginJob(), and EndJob().

Float_t CompareAll::fOscParams[4] [private]

Definition at line 74 of file CompareAll.h.

Referenced by Ana(), and BeginJob().

Float_t CompareAll::fPOT[4] [private]

Definition at line 73 of file CompareAll.h.

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

vector<TString> CompareAll::gtype [private]

Definition at line 50 of file CompareAll.h.

Referenced by BeginJob().

Int_t CompareAll::kDPlaneCut [private]

Definition at line 54 of file CompareAll.h.

Referenced by Config().

Float_t CompareAll::kHiEnergyCut [private]

Definition at line 57 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Float_t CompareAll::kHiEnergyShowerCut [private]

Definition at line 59 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Float_t CompareAll::kHiHorBeamWidth [private]

Definition at line 65 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Float_t CompareAll::kHiNuTarZ [private]

Definition at line 69 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Definition at line 51 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Int_t CompareAll::kHiTrackLikeCut [private]

Definition at line 53 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Float_t CompareAll::kHiVertBeamWidth [private]

Definition at line 67 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Float_t CompareAll::kLoCurrentCut [private]

Definition at line 63 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Float_t CompareAll::kLoEnergyCut [private]

Definition at line 58 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Float_t CompareAll::kLoEnergyShowerCut [private]

Definition at line 60 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Float_t CompareAll::kLoHorBeamWidth [private]

Definition at line 64 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Float_t CompareAll::kLoNuTarZ [private]

Definition at line 68 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Int_t CompareAll::kLoPhNPlaneCut [private]

Definition at line 56 of file CompareAll.h.

Referenced by Config().

Int_t CompareAll::kLoPhNStripCut [private]

Definition at line 55 of file CompareAll.h.

Referenced by Config().

Definition at line 52 of file CompareAll.h.

Referenced by Config(), and PassesCuts().

Float_t CompareAll::kLoVertBeamWidth [private]

Definition at line 66 of file CompareAll.h.

Referenced by Config(), and PassesBeamCuts().

Int_t CompareAll::kOscillate [private]

Definition at line 70 of file CompareAll.h.

Referenced by Ana(), Config(), and EndJob().

std::string CompareAll::kOutputFile [private]

Definition at line 71 of file CompareAll.h.

Referenced by Config(), and EndJob().

Float_t CompareAll::kPhPlaneCut [private]

Definition at line 62 of file CompareAll.h.

Referenced by Config().

Float_t CompareAll::kPhStripCut [private]

Definition at line 61 of file CompareAll.h.

Referenced by Config().

vector<Int_t> CompareAll::nbins [private]

Definition at line 49 of file CompareAll.h.

Referenced by BeginJob().

vector<string> CompareAll::varName [private]

Definition at line 46 of file CompareAll.h.

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


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1