184 std::unique_ptr< std::vector<simb::MCFlux> > mcfluxvec(
new std::vector<simb::MCFlux >);
185 std::unique_ptr< std::vector<simb::MCTruth> > mctruthvec(
new std::vector<simb::MCTruth >);
187 std::unique_ptr< std::vector<bsim::Dk2Nu> > dk2nuvec(
new std::vector<bsim::Dk2Nu >);
188 std::unique_ptr< std::vector<bsim::NuChoice> > nuchoicevec(
new std::vector<bsim::NuChoice >);
189 std::unique_ptr< art::Assns<simb::MCTruth, bsim::Dk2Nu> >
190 dk2nuassn(
new art::Assns<simb::MCTruth, bsim::Dk2Nu>);
191 std::unique_ptr< art::Assns<simb::MCTruth, bsim::NuChoice> >
192 nuchoiceassn(
new art::Assns<simb::MCTruth, bsim::NuChoice>);
193 std::unique_ptr< art::Assns<simb::MCTruth, simb::MCFlux> >
194 mcfluxassn(
new art::Assns<simb::MCTruth, simb::MCFlux>);
211 simb::MCTruth mctruth;
212 simb::MCParticle mcpnu(0,flux.fntype,
"Flux");
216 mctruth.SetNeutrino(0,0,0,0,0,0,0,0,0,0);
217 mctruthvec->push_back(mctruth);
220 dk2nuvec->push_back(*((DK2NuInterface*)
fFluxDriver)->GetDk2Nu());
221 nuchoicevec->push_back(*((DK2NuInterface*)
fFluxDriver)->GetNuChoice());
226 if (flux.fntype==12) ipdg=0;
227 else if (flux.fntype==-12) ipdg=1;
228 else if (flux.fntype==14) ipdg=2;
229 else if (flux.fntype==-14) ipdg=3;
231 double enu=flux.fnenergyn;
232 double totwgh=flux.fnwtnear*flux.fnimpwt/
fCurrentPOT;
234 else if (totwgh<0 || totwgh>100) {
235 std::cout<<
" Bad weight "<<totwgh<<std::endl;
240 fHFlux[ipdg]->Fill(enu,totwgh);
242 if (flux.fptype==13 || flux.fptype==-13)
244 else if (flux.fptype==211 || flux.fptype==-211)
246 else if (flux.fptype==130)
248 else if (flux.fptype==321 || flux.fptype==-321)
251 if (fabs(flux.ftptype==211) && fabs(flux.fptype)==13)
253 else if (fabs(flux.ftptype)==211)
255 else if (fabs(flux.ftptype)==130)
257 else if (fabs(flux.ftptype)==321)
259 else if (flux.ftptype==2212 || flux.ftptype==2112)
262 mcfluxvec->push_back(flux);
267 if (rn==0) rn=999999;
268 art::Timestamp tstamp(time(0));
270 art::SubRunID newID(rn, 0);
271 if (
fSubRunID.runID() != newID.runID()) {
278 pot->totgoodpot =
fPOT;
280 art::put_product_in_principal(std::move(pot),
294 art::put_product_in_principal(std::move(mcfluxvec),
297 art::put_product_in_principal(std::move(mctruthvec),
301 art::put_product_in_principal(std::move(dk2nuvec),
304 art::put_product_in_principal(std::move(nuchoicevec),
313 dk2nuassn->addSingle(aptr,bptr);
314 nuchoiceassn->addSingle(aptr,cptr);
315 mcfluxassn->addSingle(aptr,dptr);
317 art::put_product_in_principal(std::move(dk2nuassn),
320 art::put_product_in_principal(std::move(nuchoiceassn),
323 art::put_product_in_principal(std::move(mcfluxassn),
virtual const TLorentzVector GetNuMomentum()=0
virtual bool FillMCFlux(Long64_t ientry, simb::MCFlux &mclux)=0
virtual const TLorentzVector GetNuPosition()=0
virtual const int GetRun()=0
art::SourceHelper const & fSourceHelper
TH1D * fHFluxParent[4][4]
art::TypeLabel fTLnuchoice
art::TypeLabel fTLmctruth
FluxInterface * fFluxDriver
BEGIN_PROLOG could also be cout