Skip to content

Commit f8ea8c9

Browse files
author
benjamin Quilain
committed
Added possibility to run the code without BONSAI
1 parent 46eb766 commit f8ea8c9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

example/analysis.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
#include "LEAF.hh"
2828
#include "HKManager.hh"
29+
#ifdef WITH_BONSAI
2930
#include "WCSimBonsai.hh"
31+
#endif
3032

3133
#define OLD_WCSIM // To be used if WCSim version is older than 1.8 (i.e. without multi vertex)
3234
#define mPMT // To be used if you are using mPMT
@@ -256,10 +258,11 @@ int main(int argc, char** argv){
256258
HKAstroAnalysis::GetME()->Initialize(HKManager::GetME()->GetGeometry());
257259
#endif
258260

261+
#ifdef WITH_BONSAI
259262
// Initialize Bonsai
260263
WCSimBonsai* fBonsai = new WCSimBonsai();
261264
fBonsai->Init(fGeometry);
262-
265+
#endif
263266
// Read Input Tree
264267
int nPrimaryEvents = fInputTree->GetEntries();
265268
int iWrite = 0;
@@ -330,14 +333,15 @@ int main(int argc, char** argv){
330333
Hit_OD_400 = 0;
331334

332335

336+
#ifdef WITH_BONSAI
333337
// re-initialize Bonsai input
334338
for ( int iHit = 0; iHit < 2000; iHit++ ) {
335339
bsCAB[iHit] = 0;
336340
bsT [iHit] = 0.;
337341
bsQ [iHit] = 0.;
338342
}
339343
bsnhit[0] = 0;
340-
344+
#endif
341345
leaf_output.Vtx[0] = 0.;
342346
leaf_output.Vtx[1] = 0.;
343347
leaf_output.Vtx[2] = 0.;
@@ -470,6 +474,7 @@ int main(int argc, char** argv){
470474
//std::cout << " n50 " << leaf_output_ana.n50[0] << " " << leaf_output_ana.n50[1] << " " << leaf_output_ana.n50[2] << std::endl;
471475
std::cout << " LEAF took: " << timerLF.RealTime() << " for " << HKManager::GetME()->GetHitCollection()->Size() << " Hits"<< std::endl;
472476

477+
#ifdef WITH_BONSAI
473478
/****************************************************************************************/
474479
/* Bonsai */
475480
/****************************************************************************************/
@@ -529,7 +534,7 @@ int main(int argc, char** argv){
529534

530535
fBSTime = timerBS.RealTime();
531536
}
532-
537+
#endif
533538
/****************************************************************************************/
534539
/* Fill output tree */
535540
/****************************************************************************************/

0 commit comments

Comments
 (0)