diff --git a/src/libraries/FMWPC/DFMWPCHit_factory.cc b/src/libraries/FMWPC/DFMWPCHit_factory.cc index 13dff0165..b4186f2fb 100644 --- a/src/libraries/FMWPC/DFMWPCHit_factory.cc +++ b/src/libraries/FMWPC/DFMWPCHit_factory.cc @@ -24,7 +24,8 @@ using namespace jana; jerror_t DFMWPCHit_factory::init(void) { - hit_threshold = 0.; + hit_amp_threshold = 0.; + hit_int_threshold = 0.; t_raw_min = -10000.; t_raw_max = 10000.; @@ -70,15 +71,22 @@ jerror_t DFMWPCHit_factory::brun(jana::JEventLoop *eventLoop, int32_t runnumber) if(print_messages) jout << "In DFMWPCHit_factory, loading constants..." << std::endl; - if (eventLoop->GetCalib("/FMWPC/hit_threshold", hit_threshold)){ - hit_threshold = 0.; + vector fmwpc_hit_thresholds; + + if (eventLoop->GetCalib("/FMWPC/hit_threshold", hit_amp_threshold)){ + hit_amp_threshold = 0.; + hit_int_threshold = 0.; jout << "Error loading /FMWPC/hit_threshold ! set default value to 0." << endl; } else { - jout << "FMWPC Hit Threshold: " << hit_threshold << endl; + hit_amp_threshold = fmwpc_hit_thresholds[0]; + hit_int_threshold = fmwpc_hit_thresholds[1]; + jout << "FMWPC Hit Thresholds: Amplitude = " << hit_amp_threshold << " Integral = " << hit_int_threshold << endl; } - gPARMS->SetDefaultParameter("FMWPC:FMWPC_HIT_THRESHOLD", hit_threshold, - "Remove FMWPC Hits with peak amplitudes smaller than FMWPC_HIT_THRESHOLD"); + gPARMS->SetDefaultParameter("FMWPC:FMWPC_hit_amp_threshold", hit_amp_threshold, + "Remove FMWPC Hits with peak amplitudes smaller than FMWPC_hit_amp_threshold"); + gPARMS->SetDefaultParameter("FMWPC:FMWPC_hit_int_threshold", hit_amp_threshold, + "Remove FMWPC Hits with total integral smaller than FMWPC_hit_int_threshold"); vector fmwpc_timing_cuts; @@ -263,8 +271,12 @@ jerror_t DFMWPCHit_factory::evnt(JEventLoop *loop, uint64_t eventnumber) maxamp = maxamp - scaled_ped; */ - - if (maxamppulse_integral < hit_int_threshold) { continue; } diff --git a/src/libraries/FMWPC/DFMWPCHit_factory.h b/src/libraries/FMWPC/DFMWPCHit_factory.h index 7c8da02eb..1d2a24366 100644 --- a/src/libraries/FMWPC/DFMWPCHit_factory.h +++ b/src/libraries/FMWPC/DFMWPCHit_factory.h @@ -29,7 +29,8 @@ class DFMWPCHit_factory:public jana::JFactory{ // const char* Tag(void){return "";} // hit threshold - double hit_threshold; + double hit_amp_threshold; + double hit_int_threshold; // timing cut limits double t_raw_min; diff --git a/src/libraries/HDDM/DEventSourceHDDM.cc b/src/libraries/HDDM/DEventSourceHDDM.cc index d5466dd91..5e2b9c3ac 100644 --- a/src/libraries/HDDM/DEventSourceHDDM.cc +++ b/src/libraries/HDDM/DEventSourceHDDM.cc @@ -3009,7 +3009,10 @@ jerror_t DEventSourceHDDM::Extract_DFMWPCHit(hddm_s::HDDM *record, JFactoryt = iter->getT(); const hddm_s::FmwpcHitQList &charges=iter->getFmwpcHitQs(); hit->q = (charges.size()) ? charges.begin()->getQ() : 0.; - hit->amp = (charges.size()) ? hit->q/28.8 : 0.; // copied from CDC + const hddm_s::FmwpcDigiHitList &digis=iter->getFmwpcDigiHits(); + hit->amp = (digis.size()) ? digis.begin()->getAmp() : 0.; + hit->QF = (digis.size()) ? digis.begin()->getQf() : 0.; + hit->ped = (digis.size()) ? digis.begin()->getPed() : 0.; data.push_back(hit); } diff --git a/src/libraries/HDDM/DEventWriterHDDM.cc b/src/libraries/HDDM/DEventWriterHDDM.cc index ff62379da..9e259dbf2 100644 --- a/src/libraries/HDDM/DEventWriterHDDM.cc +++ b/src/libraries/HDDM/DEventWriterHDDM.cc @@ -833,34 +833,41 @@ bool DEventWriterHDDM::Write_HDDMEvent(JEventLoop* locEventLoop, string locOutpu } //=============================================FMWPC================================================ for(uint i=0;iaddForwardMWPCs(); - } + } bool foundChamber=false; hddm_s::FmwpcChamberList* FMWPC_ChamberList = &hitv->getForwardMWPC().getFmwpcChambers(); hddm_s::FmwpcChamberList::iterator FMWPC_ChamberIterator = FMWPC_ChamberList->begin(); for(FMWPC_ChamberIterator = FMWPC_ChamberList->begin(); FMWPC_ChamberIterator != FMWPC_ChamberList->end(); FMWPC_ChamberIterator++) - { - if(FMWPCHits[i]->layer == FMWPC_ChamberIterator->getLayer() && - FMWPCHits[i]->wire == FMWPC_ChamberIterator->getWire()) - { - foundChamber = true; - break; - } - } + { + if(FMWPCHits[i]->layer == FMWPC_ChamberIterator->getLayer() && + FMWPCHits[i]->wire == FMWPC_ChamberIterator->getWire()) + { + foundChamber = true; + break; + } + } if(foundChamber == false) - { - hitv->getForwardMWPC().addFmwpcChambers(); - FMWPC_ChamberIterator = FMWPC_ChamberList->end()-1; - FMWPC_ChamberIterator->setLayer(FMWPCHits[i]->layer); - FMWPC_ChamberIterator->setWire(FMWPCHits[i]->wire); - } + { + hitv->getForwardMWPC().addFmwpcChambers(); + FMWPC_ChamberIterator = FMWPC_ChamberList->end()-1; + FMWPC_ChamberIterator->setLayer(FMWPCHits[i]->layer); + FMWPC_ChamberIterator->setWire(FMWPCHits[i]->wire); + } FMWPC_ChamberIterator->addFmwpcHits(); hddm_s::FmwpcHitList* fmwpchitl=&FMWPC_ChamberIterator->getFmwpcHits(); hddm_s::FmwpcHitList::iterator fmwpchitit=fmwpchitl->end()-1; fmwpchitit->setT(FMWPCHits[i]->t); + fmwpchitit->addFmwpcHitQs(); + fmwpchitit->getFmwpcHitQs().begin()->setQ(FMWPCHits[i]->q); + fmwpchitit->addFmwpcDigiHits(); + fmwpchitit->getFmwpcDigiHits().begin()->setAmp(FMWPCHits[i]->amp); + fmwpchitit->getFmwpcDigiHits().begin()->setPed(FMWPCHits[i]->ped); + fmwpchitit->getFmwpcDigiHits().begin()->setQf(FMWPCHits[i]->QF); + } diff --git a/src/libraries/HDDM/event.xml b/src/libraries/HDDM/event.xml index 86063165c..395b9f65d 100644 --- a/src/libraries/HDDM/event.xml +++ b/src/libraries/HDDM/event.xml @@ -246,6 +246,7 @@ +