@@ -421,7 +421,7 @@ namespace mu2e {
421421 break ;
422422 }
423423 }
424-
424+
425425 // Put all the branch configurations together
426426 for (const auto & branch_cfg : _conf.branches ()){
427427 _allBranches.push_back (branch_cfg);
@@ -448,7 +448,7 @@ namespace mu2e {
448448 if (_fillcalomc && _fillmc){
449449 _allMCTCHIs[i_branch] = std::vector<CaloClusterInfoMC>();
450450 }
451-
451+
452452 RecoQualInfo rqi;
453453 _allRQIs.push_back (rqi);
454454
@@ -616,24 +616,21 @@ namespace mu2e {
616616
617617 // general CRV info
618618 if (_fillcrvcoincs) {
619- // coincidence branches should be here FIXME
620619 _ntuple->Branch (" crvsummary" ,&_crvsummary,_buffsize,_splitlevel);
621620 _ntuple->Branch (" crvcoincs." ,&_crvcoincs,_buffsize,_splitlevel);
622- if (_fillcrvpulses) {
623- _ntuple->Branch (" crvpulses." ,&_crvpulses,_buffsize,_splitlevel);
624- }
625- if (_fillcrvdigis) {
626- _ntuple->Branch (" crvdigis." ,&_crvdigis,_buffsize,_splitlevel);
627- }
628621 if (_fillmc){
629622 _ntuple->Branch (" crvsummarymc" ,&_crvsummarymc,_buffsize,_splitlevel);
630623 _ntuple->Branch (" crvcoincsmc." ,&_crvcoincsmc,_buffsize,_splitlevel);
631624 _ntuple->Branch (" crvcoincsmcplane." ,&_crvcoincsmcplane,_buffsize,_splitlevel);
632- if (_fillcrvpulses) {
633- _ntuple->Branch (" crvpulsesmc." ,&_crvpulsesmc,_buffsize,_splitlevel);
634- }
635625 }
636626 }
627+ if (_fillcrvpulses) {
628+ _ntuple->Branch (" crvpulses." ,&_crvpulses,_buffsize,_splitlevel);
629+ if (_fillmc) _ntuple->Branch (" crvpulsesmc." ,&_crvpulsesmc,_buffsize,_splitlevel);
630+ }
631+ if (_fillcrvdigis) {
632+ _ntuple->Branch (" crvdigis." ,&_crvdigis,_buffsize,_splitlevel);
633+ }
637634 // CRV cosmic inference
638635 if (_fillCrvInference) {
639636 _ntuple->Branch (" crvcosmic." ,&_crvInference,_buffsize,_splitlevel);
@@ -1006,63 +1003,57 @@ namespace mu2e {
10061003 }
10071004 }
10081005
1009-
1010- // TODO we want MC information when we don't have a track
1011- // fill general CRV info
1006+ // fill CRV info
10121007 if (_fillcrvcoincs){
1013- // clear vectors
10141008 _crvcoincs.clear ();
10151009 _crvcoincsmc.clear ();
10161010 _crvcoincsmcplane.clear ();
1017- _crvpulses.clear ();
1018- _crvdigis.clear ();
1019- _crvpulsesmc.clear ();
10201011
10211012 event.getByLabel (_conf.crvCoincidencesTag (),_crvCoincidences);
10221013 event.getByLabel (_conf.crvRecoPulsesTag (),_crvRecoPulses);
10231014 event.getByLabel (_conf.crvStepsTag (),_crvSteps);
1024- event.getByLabel (_conf.crvDigisTag (),_crvDigis);
1025- if (_fillmc){
1026- event.getByLabel (_conf.crvCoincidenceMCsTag (),_crvCoincidenceMCs);
1027- event.getByLabel (_conf.crvDigiMCsTag (),_crvDigiMCs);
1028- }
1015+ if (_fillmc) event.getByLabel (_conf.crvCoincidenceMCsTag (),_crvCoincidenceMCs);
10291016 _crvHelper.FillCrvHitInfoCollections (
10301017 _crvCoincidences, _crvCoincidenceMCs,
10311018 _crvRecoPulses, _crvSteps, _mcTrajectories,_crvcoincs, _crvcoincsmc,
10321019 _crvsummary, _crvsummarymc, _crvcoincsmcplane, _crvPlaneY, _pph);
1033- if (_fillcrvpulses){
1034- _crvHelper.FillCrvPulseInfoCollections (_crvRecoPulses, _crvDigiMCs, _ewmh,
1035- _crvpulses, _crvpulsesmc);
1036- }
1037- if (_fillcrvdigis){
1038- _crvHelper.FillCrvDigiInfoCollections (_crvRecoPulses, _crvDigis,
1039- _crvdigis);
1040- }
1041-
1020+ }
1021+ if (_fillcrvpulses){
1022+ _crvpulses.clear ();
1023+ _crvpulsesmc.clear ();
1024+ event.getByLabel (_conf.crvRecoPulsesTag (),_crvRecoPulses);
1025+ if (_fillmc) event.getByLabel (_conf.crvDigiMCsTag (),_crvDigiMCs);
1026+ _crvHelper.FillCrvPulseInfoCollections (_crvRecoPulses, _crvDigiMCs, _ewmh,
1027+ _crvpulses, _crvpulsesmc);
1028+ }
1029+ if (_fillcrvdigis){
1030+ _crvdigis.clear ();
1031+ event.getByLabel (_conf.crvDigisTag (),_crvDigis);
1032+ _crvHelper.FillCrvDigiInfoCollections (_crvDigis,_crvdigis);
10421033 }
10431034
10441035 // fill CRV cosmic inference scores (T x C structure aligned with trk branches)
10451036 if (_fillCrvInference) {
10461037 _crvInference.clear ();
10471038 // Init associations from CrvInference module: KalSeed <-> CrvCoincidenceCluster with MVAResult data product
10481039 art::Handle<art::Assns<KalSeed, CrvCoincidenceCluster, MVAResult>> crvInfHandle;
1049- // grab the associations from the art::Event
1040+ // grab the associations from the art::Event
10501041 event.getByLabel (_crvInferenceTag, crvInfHandle);
10511042 // build a map from KalSeed ptr to scores
10521043 std::map<art::Ptr<KalSeed>, std::vector<MVAResultInfo>> crvInfMap;
10531044 // Get the scores from the associations and fill the map
1054- if (crvInfHandle.isValid ()) {
1045+ if (crvInfHandle.isValid ()) {
10551046 // loop through association
10561047 for (const auto & assn : *crvInfHandle) {
10571048 MVAResultInfo info;
10581049 info.result = assn.data ->_value ; // the model score
10591050 info.valid = true ; // true if assns is valid
1060- crvInfMap[assn.first ].push_back (info);
1051+ crvInfMap[assn.first ].push_back (info);
10611052 }
10621053 }
10631054 // fill the branch
10641055 // iterate over all tracks to keep alignment with trk branches
1065- // this means filling empty vectors for tracks with no coincidence
1056+ // this means filling empty vectors for tracks with no coincidence
10661057 const auto & kseedptr_coll = *_allKSPCHs.at (0 );
10671058 for (size_t i = 0 ; i < kseedptr_coll.size (); ++i) {
10681059 auto it = crvInfMap.find (kseedptr_coll[i]);
0 commit comments