Skip to content

Commit 851e176

Browse files
committed
Return false instead of exit
1 parent 064abd3 commit 851e176

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

sbncode/SinglePhotonAnalysis/NCDeltaRadiative_module.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ bool NCDeltaRadiative::filter(art::Event & e) {
161161
simb::MCParticle const & mcp = mct.GetParticle(i);
162162
if(mcp.TrackId() != i) {
163163
std::cout << "ERROR: " << __LINE__ << " " << __PRETTY_FUNCTION__ << "\nTrackId does not match index\n";
164-
exit(1);
164+
return false;
165165
}
166166
if(!(mcp.StatusCode() == 1 && mcp.PdgCode() == 22)) continue;
167167
exiting_photon_parents.push_back(mcp.Mother());
@@ -173,7 +173,7 @@ bool NCDeltaRadiative::filter(art::Event & e) {
173173
//CHEKC hardcode, TPC filter:
174174
if(abs(mcp.Vx())>210 || abs(mcp.Vy())>210||mcp.Vz()>510 || mcp.Vz()<-1){
175175
std::cout<<"OUTSIDE TPC x y z ="<<mcp.Vx()<<" "<<mcp.Vy()<<" "<<mcp.Vz()<<std::endl;
176-
exit(0);
176+
return false;
177177
}
178178
if(abs(mcp.PdgCode()) == 2114 || abs(mcp.PdgCode()) == 2214) {
179179
if(ftree) FillTree(e, i, mcp.PdgCode(), true);

sbncode/SinglePhotonAnalysis/NCRadiativeResonant_module.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ bool NCRadiativeResonant::filter(art::Event & e) {
185185
//CHEKC hardcode, TPC filter:
186186
if(abs(mcp.Vx())>210 || abs(mcp.Vy())>210||mcp.Vz()>510 || mcp.Vz()<-1){
187187
std::cout<<"OUTSIDE TPC x y z ="<<mcp.Vx()<<" "<<mcp.Vy()<<" "<<mcp.Vz()<<std::endl;
188-
exit(0);
188+
return false;
189189
}
190190

191191
if(mcp.TrackId() != jth) {
192192
std::cout << "ERROR: " << __LINE__ << " " << __PRETTY_FUNCTION__ << "\nTrackId does not match index\n";
193-
exit(1);
193+
return false;
194194
}
195195
if(!(mcp.StatusCode() == 1 && mcp.PdgCode() == 22)) continue;//next, if this is not a photon with StatusCode 1
196196
exiting_photon_parents.push_back(mcp.Mother());//collect photon's parents

0 commit comments

Comments
 (0)