Skip to content

Commit 5247e6e

Browse files
authored
Merge pull request #897 from SBNSoftware/feature/gputnam-dirt-workflows
Add in double ampersand, add a few fixes.
2 parents e5bc7b1 + 7216b77 commit 5247e6e

4 files changed

Lines changed: 25 additions & 13 deletions

File tree

icaruscode/Filters/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ cet_build_plugin(FilterParticlesActiveVolume art::module LIBRARIES ${MODULE_LIBR
4646
cet_build_plugin(TriggerTypeFilter art::module LIBRARIES ${MODULE_LIBRARIES})
4747
cet_build_plugin(FilterCRTPMTMatching art::module LIBRARIES ${MODULE_LIBRARIES})
4848
cet_build_plugin(FilterDirts art::module LIBRARIES ${MODULE_LIBRARIES})
49+
cet_build_plugin(SimEnergyDepFakeTriggerFilterICARUS art::module LIBRARIES ${MODULE_LIBRARIES})
50+
cet_build_plugin(FilterMCTruthVolume art::module LIBRARIES ${MODULE_LIBRARIES})
4951

5052
# install_headers()
5153
install_fhicl()

icaruscode/Filters/SimEnergyDepFakeTriggerFilterICARUS_module.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool SimEnergyDepFakeTriggerFilterICARUS::filter(art::Event& e)
4949

5050
std::cout << "SAW E= " << energy << " inside window. Threshold is: " << fEnergyDeposit << std::endl;
5151
// If the energy deposit within the beam time is greater than some limit then trigger the event
52-
return (energy > fEnergyDeposit) & (energy < fMaxEnergyDeposit);
52+
return (energy > fEnergyDeposit) && (energy < fMaxEnergyDeposit);
5353
}
5454

5555
DEFINE_ART_MODULE(SimEnergyDepFakeTriggerFilterICARUS)

icaruscode/Overlays/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ cet_build_plugin(
2323
gallery::gallery
2424
)
2525

26+
cet_build_plugin(
27+
SubRunPOTInEvent art::EDProducer
28+
LIBRARIES
29+
PRIVATE
30+
larcoreobj::SummaryData
31+
)
32+
2633
# This is what's needed for building the WireCellubsim WCT component
2734
art_make_library(
2835
LIBRARY_NAME WireCellICARUSDrifter

icaruscode/Overlays/SimInfoOverlayFilter_module.cc

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ void mix::SimInfoOverlayFilter::MakePOTMap(){
742742
fSR_SpillsPerEvent.clear();
743743
fSR_GoodSpillsPerEvent.clear();
744744

745-
unsigned int current_sr = 0;
745+
int current_sr = -1;
746746
unsigned int events_in_sr = 0;
747747

748748
double current_sr_POT = 0;
@@ -752,16 +752,17 @@ void mix::SimInfoOverlayFilter::MakePOTMap(){
752752

753753
// Iterate through all events in auxillary file, count how many are in each subrun
754754
while(!gEvent.atEnd()){
755+
if (current_sr == -1) current_sr = gEvent.eventAuxiliary().subRun();
755756

756-
if(gEvent.eventAuxiliary().subRun() != current_sr){
757-
if(current_sr != 0){
758-
fSR_POTPerEvent[current_sr] = current_sr_POT/events_in_sr;
759-
fSR_GoodPOTPerEvent[current_sr] = current_sr_GoodPOT/events_in_sr;
760-
fSR_SpillsPerEvent[current_sr] = (double)current_sr_Spills/events_in_sr;
761-
fSR_GoodSpillsPerEvent[current_sr] = (double)current_sr_GoodSpills/events_in_sr;
762-
}
757+
if((int)gEvent.eventAuxiliary().subRun() != current_sr){
758+
fSR_POTPerEvent[current_sr] = current_sr_POT/events_in_sr;
759+
fSR_GoodPOTPerEvent[current_sr] = current_sr_GoodPOT/events_in_sr;
760+
fSR_SpillsPerEvent[current_sr] = (double)current_sr_Spills/events_in_sr;
761+
fSR_GoodSpillsPerEvent[current_sr] = (double)current_sr_GoodSpills/events_in_sr;
763762
events_in_sr = 0;
764763
current_sr = gEvent.eventAuxiliary().subRun();
764+
765+
std::cout << "Label: " << fPOTSummaryTag << " with POT: " << current_sr_POT << " from NEvent: " << events_in_sr << " in SubRun: " << current_sr << std::endl;
765766
}
766767

767768
gallery::Handle< sumdata::POTSummary > potsum_handle;
@@ -779,15 +780,17 @@ void mix::SimInfoOverlayFilter::MakePOTMap(){
779780
}
780781

781782
// Add the last sr
782-
if(current_sr != 0){
783+
if(current_sr != -1){
783784
fSR_POTPerEvent[current_sr] = current_sr_POT/events_in_sr;
784785
fSR_GoodPOTPerEvent[current_sr] = current_sr_GoodPOT/events_in_sr;
785786
fSR_SpillsPerEvent[current_sr] = (double)current_sr_Spills/events_in_sr;
786787
fSR_GoodSpillsPerEvent[current_sr] = (double)current_sr_GoodSpills/events_in_sr;
788+
789+
std::cout << "Label: " << fPOTSummaryTag << " with POT: " << current_sr_POT << " from NEvent: " << events_in_sr << " in SubRun: " << current_sr << std::endl;
787790
}
788791

789-
// std::map<unsigned int,double>::iterator it;
790-
// for (it = fSR_POTPerEvent.begin(); it != fSR_POTPerEvent.end(); it++) std::cout << "SR=" << it->first << " POT/Event=" << it->second << std::endl;
792+
std::map<unsigned int,double>::iterator it;
793+
for (it = fSR_POTPerEvent.begin(); it != fSR_POTPerEvent.end(); it++) std::cout << "SR=" << it->first << " POT/Event=" << it->second << std::endl;
791794

792795
gEvent.first();
793796
}
@@ -850,4 +853,4 @@ void mix::SimInfoOverlayFilter::respondToOpenOutputFiles(art::FileBlock const &
850853
{
851854
}
852855

853-
DEFINE_ART_MODULE(mix::SimInfoOverlayFilter)
856+
DEFINE_ART_MODULE(mix::SimInfoOverlayFilter)

0 commit comments

Comments
 (0)