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

FomCalculator.h

Go to the documentation of this file.
00001 
00002 //
00003 // Some functions necessary for FOM calculation
00004 // Stolen from NueAna
00005 // 
00006 // Pedro Ochoa, Feb-1-2007
00007 //
00009 
00010 #include "MCNNAnalysis/NNReader.h"
00011 
00012 //Comment: stole this from NueAna/NueAnaTools/NueConvention.cxx, since couldn't get the new NueAna to compile in R1.18.2
00013 float Oscillate(int nuFlavor, int nonOscNuFlavor, float Energy,
00014                               float L, float dm2, float theta23, float UE32)
00015 {
00016    float oscterm = TMath::Sin(1.27*dm2*L/Energy);
00017 
00018    float pmt=pow((1-UE32)*oscterm*TMath::Sin(2*theta23),2);
00019    float pme=pow(TMath::Sin(theta23),2)*4.*UE32*(1-UE32)*pow(oscterm,2);
00020    float pmm=1.-pmt-pme;
00021  
00022    float pet=4*(1-UE32)*UE32*pow(TMath::Cos(theta23)*oscterm,2);
00023    float pem=pow(TMath::Sin(theta23),2)*4.*UE32*(1-UE32)*pow(oscterm,2);
00024    float pee=1.-pet-pem;
00025 
00026    if(abs(nonOscNuFlavor)==14){
00027       if(abs(nuFlavor)==12){
00028          return pme;
00029       }
00030       else if(abs(nuFlavor)==14){
00031          return pmm;
00032       }
00033       else if(abs(nuFlavor)==16){
00034          return pmt;
00035       }
00036    }
00037    else if(abs(nonOscNuFlavor)==12){
00038       if(abs(nuFlavor)==12){
00039          return pee;
00040       }
00041       else if(abs(nuFlavor)==14){
00042         return pem;
00043       }
00044       else if(abs(nuFlavor)==16){
00045          return pet;
00046       }
00047    }
00048    else{
00049      std::cout<<"I don't know what to do with "<<nonOscNuFlavor
00050          <<" "<<nuFlavor<<" "<<pee<<std::endl;
00051    }
00052    return 0.;
00053 }//end of Oscillate
00054 
00055 //Comment: stole this from ANtpTruthInfoBeamAna.cxx
00056 //Basically beam nue's get a weight of 0.5 since they are repeated in the beam and nue files (I think)
00057 float Calcweight(int inu, int inunoosc){
00058 
00059   Float_t weight=1;
00060 
00061   if(abs(inu)==12 || abs(inu)==14 || abs(inu)==16){
00062     if(abs(inunoosc)==12 || abs(inunoosc)==14 || abs(inunoosc)==16){
00063       weight = 1.0;
00064       if(abs(inu)==12 && abs(inunoosc)==12){
00065         weight=0.5;
00066       }
00067     }
00068   }
00069   
00070   return weight;
00071 
00072 }//end of Calcweight
00073 
00074 //=========================================================
00075 
00076 bool VtxIsContainedFD(NNReader *nread_in){
00077 
00078   bool veredicto=true;
00079   Float_t radius=sqrt(pow(nread_in->vtxx,2)+pow(nread_in->vtxy,2));
00080 
00081   if(nread_in->vtxz>29){//End of SM2
00082     veredicto=false;
00083   }
00084   if(nread_in->vtxz>14 && nread_in->vtxz<15.8){//Between end of SM1 and SM2
00085     veredicto=false;
00086   }
00087 
00088   return veredicto;
00089 
00090 }

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