00001 #include "StandardNtuple/NtpStRecord.h" 00002 #include "MessageService/MsgService.h" 00003 #include "Registry/Registry.h" 00004 #include "MCReweight/MCReweight.h" 00005 #include "MCReweight/MCEventInfo.h" 00006 #include "MCReweight/ReweightHelpers.h" 00007 #include "NueAna/NueAnaTools/SntpHelpers.h" 00008 #include "NueAna/NueXsecWeightAna.h" 00009 00010 CVSID("$Id: NueXsecWeightAna.cxx,v 1.6 2007/03/12 14:05:34 cbs Exp $"); 00011 00012 00013 NueXsecWeightAna::NueXsecWeightAna(NueXsecWeight &nuexs): 00014 fNueXsecWeight(nuexs) 00015 {} 00016 00017 NueXsecWeightAna::~NueXsecWeightAna() 00018 {} 00019 00020 void NueXsecWeightAna::Analyze(int evtn, RecRecordImp<RecCandHeader> *srobj) 00021 { 00022 NtpStRecord *st=dynamic_cast<NtpStRecord *>(srobj); 00023 if(st==0){ 00024 MSG("NueXsecWeightAna",Msg::kError)<<"Trying to do mc reweighting on an event" 00025 <<" that comes from a non NtpStRecord"<<endl 00026 <<"That's not a good idea" 00027 <<"I haven't even tried to implement it"<<endl; 00028 return; 00029 } 00030 if(st->evthdr.nevent == 0 ) return; 00031 00032 double gw = 1.0; 00033 00034 if(ReleaseType::IsCarrot(release)){ 00035 MCEventInfo ei; 00036 00037 int thn = SntpHelpers::GetEvent2MCIndex(evtn,st); 00038 if(thn<0) { 00039 fNueXsecWeight.xsecweight=1.0; 00040 return; 00041 } 00042 00043 ReweightHelpers::MCEventInfoFilla(&ei,st,thn); 00044 NuParent *np=0; 00045 if(ei.iresonance!=1005){ 00046 gw = mcr->ComputeWeight(&ei,np,rwtreg); 00047 } 00048 } 00049 00050 fNueXsecWeight.xsecweight=gw; 00051 }
1.3.9.1