Functions | |
| void | EventRegistryFilla (NtpMCRecord *mc, int evtno, Registry &fReg) |
| void | EventRegistryFilla (ANtpTruthInfoBeam *ir, Registry &fReg) |
| void | BeamRegistryFilla (ANtpTruthInfoBeam *ir, Registry &fReg) |
|
||||||||||||
|
Definition at line 171 of file ReweightHelpers.cxx. References Registry::LockKeys(), Registry::LockValues(), ANtpTruthInfoBeam::parentGen, ANtpTruthInfoBeam::parentPID, ANtpTruthInfoBeam::parentPX, ANtpTruthInfoBeam::parentPY, ANtpTruthInfoBeam::parentPZ, ANtpTruthInfoBeam::parentX, ANtpTruthInfoBeam::parentY, ANtpTruthInfoBeam::parentZ, Registry::Set(), Registry::UnLockKeys(), and Registry::UnLockValues(). 00172 {
00173 //note: this function assumes the parent hadron information
00174 //in ANtpTruthInfoBeam
00175 //has already been filled
00176 //however, this information does not get filled
00177 //automatically by calling the filler object for
00178 //ANtpTruthInfoBeam, instead, it gets filled
00179 //by a call to GnumiInterface::FillANtpTruth
00180 fReg.UnLockKeys();
00181 fReg.UnLockValues();
00182
00183 fReg.Set("event:nuparent_x",ir->parentX);
00184 fReg.Set("event:nuparent_y",ir->parentY);
00185 fReg.Set("event:nuparent_z",ir->parentZ);
00186 fReg.Set("event:nuparent_px",ir->parentPX);
00187 fReg.Set("event:nuparent_py",ir->parentPY);
00188 fReg.Set("event:nuparent_pz",ir->parentPZ);
00189 fReg.Set("event:nuparent_pid",ir->parentPID);
00190 fReg.Set("event:nuparent_gen",ir->parentGen);
00191
00192 fReg.LockValues();
00193 fReg.LockKeys();
00194
00195 return;
00196 }
|
|
||||||||||||
|
Definition at line 118 of file ReweightHelpers.cxx. References ANtpTruthInfoBeam::atomicNumber, ANtpTruthInfoBeam::bjorkenX, ANtpTruthInfoBeam::hadronicFinalState, ANtpTruthInfo::hadronicY, ANtpTruthInfoBeam::initialState, ANtpTruthInfo::interactionType, Registry::LockKeys(), Registry::LockValues(), ANtpTruthInfo::nuDCosX, ANtpTruthInfo::nuDCosY, ANtpTruthInfo::nuDCosZ, ANtpTruthInfo::nuEnergy, ANtpTruthInfo::nuFlavor, ANtpTruthInfoBeam::q2, ANtpTruthInfoBeam::resonanceCode, Registry::Set(), ANtpTruthInfo::targetEnergy, ANtpTruthInfo::targetPX, ANtpTruthInfo::targetPY, ANtpTruthInfo::targetPZ, Registry::UnLockKeys(), Registry::UnLockValues(), and ANtpTruthInfoBeam::w2. 00119 {
00120 fReg.UnLockKeys();
00121 fReg.UnLockValues();
00122
00123 fReg.Set("event:nu_en",ir->nuEnergy);
00124 fReg.Set("event:nu_px",ir->nuDCosX*sqrt(ir->nuEnergy*ir->nuEnergy));
00125 fReg.Set("event:nu_py",ir->nuDCosY*sqrt(ir->nuEnergy*ir->nuEnergy));
00126 fReg.Set("event:nu_pz",ir->nuDCosZ*sqrt(ir->nuEnergy*ir->nuEnergy));
00127
00128 fReg.Set("event:tar_en",ir->targetEnergy);
00129 fReg.Set("event:tar_px",ir->targetPX);
00130 fReg.Set("event:tar_py",ir->targetPY);
00131 fReg.Set("event:tar_pz",ir->targetPZ);
00132
00133 fReg.Set("event:y",ir->hadronicY);
00134 fReg.Set("event:x",ir->bjorkenX);
00135 fReg.Set("event:q2",ir->q2);
00136 fReg.Set("event:w2",ir->w2);
00137
00138 fReg.Set("event:iaction",ir->interactionType);
00139 fReg.Set("event:inu",ir->nuFlavor);
00140 fReg.Set("event:iresonance",ir->resonanceCode);
00141 fReg.Set("event:initial_state",ir->initialState);
00142
00143 Int_t nucleus=1;
00144 switch ((int)(ir->atomicNumber)) {
00145 case 1:
00146 nucleus=0; // free nucleon
00147 break;
00148 case 6:
00149 nucleus=274; // carbon
00150 break;
00151 case 8:
00152 nucleus=284; // oxygen
00153 break;
00154 case 26:
00155 nucleus=372; // iron
00156 break;
00157 default:
00158 nucleus=1; // unknown
00159 break;
00160 }
00161 fReg.Set("event:nucleus",nucleus);
00162 fReg.Set("event:had_fs",ir->hadronicFinalState);
00163
00164
00165 fReg.LockValues();
00166 fReg.LockKeys();
00167
00168
00169 }
|
|
||||||||||||||||
|
Definition at line 13 of file ReweightHelpers.cxx. References abs(), NtpMCTruth::iaction, NtpMCStdHep::IdHEP, NtpMCTruth::inu, NtpMCTruth::iresonance, NtpMCStdHep::IstHEP, Registry::LockKeys(), Registry::LockValues(), NtpMCStdHep::mc, NtpMCRecord::mc, MSG, NtpMCTruth::p4neu, NtpMCTruth::p4tgt, NtpMCTruth::q2, Registry::Set(), NtpMCRecord::stdhep, Registry::UnLockKeys(), Registry::UnLockValues(), NtpMCTruth::w2, NtpMCTruth::x, NtpMCTruth::y, and NtpMCTruth::z. Referenced by NueReweight::Reco(). 00014 {
00015 if(evtno>=mc->mc->GetEntries()){
00016 MSG("ReweightHelper",Msg::kError)<<"EventRegistryFilla Error, event no: "<<evtno
00017 <<" size "<<mc->mc->GetEntries()<<std::endl;
00018 return;
00019 }
00020
00021 NtpMCTruth *mcth = static_cast<NtpMCTruth *>((*mc->mc)[evtno]);
00022
00023 Int_t initial_state=0;
00024 Int_t had_fs=0;
00025 bool foundfs=false;
00026 TClonesArray& heparray = *(mc->stdhep);
00027 Int_t nhep = heparray.GetEntries();
00028
00029 int protneut = -1; // 0 = neutron, 1 = proton, 2 = N, 3 = A
00030 int nubarnu = 0; // +1 = neutrino, -1 = antineutrino
00031
00032 for(int i=0;i<nhep;i++){
00033 NtpMCStdHep *sh = static_cast<NtpMCStdHep *>(heparray[i]);
00034 if(sh->mc==evtno){
00035 if(sh->IstHEP==0){ //initial state particle
00036 if(abs(sh->IdHEP)==12 ||
00037 abs(sh->IdHEP)==14 ||
00038 abs(sh->IdHEP)==16){ //(anti)neutrino
00039 nubarnu = sh->IdHEP/abs(sh->IdHEP); //get sign
00040 }
00041 }
00042 if(sh->IstHEP==11){ //target nucleon
00043 if(sh->IdHEP==2212) protneut = 1; //proton
00044 else if(sh->IdHEP==2112) protneut = 0; //neutron
00045 else if(abs(sh->IdHEP)>1000000000) protneut = 2; //nucleus
00046 else protneut = 3; //atom - probably never get here since IdHEP A>N?
00047 }
00048 if(sh->IstHEP==3&&!foundfs){
00049 if(mcth->iresonance!=1002 || //if not RES event
00050 TMath::Abs(sh->IdHEP)!=15){ //or if it is RES, IdHEP!=tau lepton
00051 had_fs = (sh->IdHEP%1000);
00052 foundfs=true;
00053 }
00054 }
00055 }
00056 }
00057
00058 if(protneut==1 && nubarnu==1) initial_state=1; //p + v
00059 if(protneut==0 && nubarnu==1) initial_state=2; //n + v
00060 if(protneut==1 && nubarnu==-1) initial_state=3; //p + vbar
00061 if(protneut==0 && nubarnu==-1) initial_state=4; //n + vbar
00062 if(protneut==2 && nubarnu==1) initial_state=5; //N + v
00063 if(protneut==3 && nubarnu==1) initial_state=6; //A + v
00064 if(protneut==2 && nubarnu==-1) initial_state=7; //N + vbar
00065 if(protneut==3 && nubarnu==-1) initial_state=8; //A + vbar
00066
00067 Int_t nucleus=1;
00068 switch ((int)(mcth->z)) {
00069 case 1:
00070 nucleus=0; // free nucleon
00071 break;
00072 case 6:
00073 nucleus=274; // carbon
00074 break;
00075 case 8:
00076 nucleus=284; // oxygen
00077 break;
00078 case 26:
00079 nucleus=372; // iron
00080 break;
00081 default:
00082 nucleus=1; // unknown
00083 break;
00084 }
00085
00086 fReg.UnLockKeys();
00087 fReg.UnLockValues();
00088
00089 fReg.Set("event:nu_en",1.*mcth->p4neu[3]);
00090 fReg.Set("event:nu_px",1.*mcth->p4neu[0]);
00091 fReg.Set("event:nu_py",1.*mcth->p4neu[1]);
00092 fReg.Set("event:nu_pz",1.*mcth->p4neu[2]);
00093
00094 fReg.Set("event:tar_en",1.*mcth->p4tgt[3]);
00095 fReg.Set("event:tar_px",1.*mcth->p4tgt[0]);
00096 fReg.Set("event:tar_py",1.*mcth->p4tgt[1]);
00097 fReg.Set("event:tar_pz",1.*mcth->p4tgt[2]);
00098
00099 fReg.Set("event:y",mcth->y);
00100 fReg.Set("event:x",mcth->x);
00101 fReg.Set("event:q2",mcth->q2);
00102 fReg.Set("event:w2",mcth->w2);
00103
00104 fReg.Set("event:iaction",mcth->iaction);
00105 fReg.Set("event:inu",mcth->inu);
00106 fReg.Set("event:iresonance",mcth->iresonance);
00107 fReg.Set("event:initial_state",initial_state);
00108
00109 fReg.Set("event:nucleus",nucleus);
00110
00111 fReg.Set("event:had_fs",had_fs);
00112
00113 fReg.LockValues();
00114 fReg.LockKeys();
00115 }
|
1.3.9.1