Skip to content

Commit 4072a48

Browse files
committed
Changed analysis.cpp as hybrid case was bugged. The bug was that the first PMT type hits were double counted
1 parent 75216ea commit 4072a48

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

example/analysis.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626

2727
#include "LEAF.hh"
2828
#include "HKManager.hh"
29-
#define WITH_BONSAI
29+
//#define WITH_BONSAI
3030
#ifdef WITH_BONSAI
3131
#include "WCSimBonsai.hh"
3232
#endif
3333

3434
#define OLD_WCSIM // To be used if WCSim version is older than 1.8 (i.e. without multi vertex)
3535
#define mPMT // To be used if you are using mPMT
36-
3736
// HK_ASTROANALYSIS is an analysis class computing some informations like n50, or the bonsai-like goodness
3837
// Ask G. Pronost to have access to this class (you need to be a member of SK or HK collaboration)
3938
//#define WITH_HK_ASTROANALYSIS
@@ -612,6 +611,7 @@ bool AnalyseEvent(WCSimRootEvent * tEvent, int iEventType) {
612611
int nVertex = 0; // Number of Vertex in event
613612
int nTrack = 0; // Number of Track in event
614613
int nRawCherenkovHits = 0; // Number of Raw Cherenkov hits
614+
int startingCherenkovHitID = 0; // starting ID of Digitized Cherenkov hits. Usually starts at 0, but if there are two types of PMTs, it does not.
615615
int nDigitizedCherenkovHits = 0; // Number of Digitized Cherenkov hits
616616
double fTriggerTime = 0.;
617617

@@ -646,6 +646,7 @@ bool AnalyseEvent(WCSimRootEvent * tEvent, int iEventType) {
646646

647647
// Get number of hits
648648

649+
startingCherenkovHitID = digithit_pmtId.size();
649650
nDigitizedCherenkovHits = fRootTrigger->GetNcherenkovdigihits();
650651
fTriggerTime = fRootTrigger->GetTriggerInfo()[2] - fRootTrigger->GetTriggerInfo()[1];
651652

@@ -689,10 +690,10 @@ bool AnalyseEvent(WCSimRootEvent * tEvent, int iEventType) {
689690

690691
// Get number of hit
691692
rawhit_num = nRawCherenkovHits;
692-
693+
693694
// Loop on Digitized Hits
694695
for(int iDigitHit = 0; iDigitHit < nDigitizedCherenkovHits; iDigitHit++){
695-
696+
696697
TObject *Hit = (fRootTrigger->GetCherenkovDigiHits())->At(iDigitHit);
697698
WCSimRootCherenkovDigiHit *wcDigitHit = dynamic_cast<WCSimRootCherenkovDigiHit*>(Hit);
698699

@@ -707,15 +708,16 @@ bool AnalyseEvent(WCSimRootEvent * tEvent, int iEventType) {
707708
digithit_dark.push_back(false);
708709
digithit_Type.push_back(iEventType);
709710
}
710-
711+
711712
int iIdx_BS = 0;
712-
713+
713714
nDigitizedCherenkovHits = digithit_pmtId.size();
714715
digithit_num = nDigitizedCherenkovHits;
715-
716+
716717
// Feed fitter
717-
for(int iDigitHit = 0; iDigitHit < nDigitizedCherenkovHits; iDigitHit++){
718+
for(int iDigitHit = startingCherenkovHitID; iDigitHit < nDigitizedCherenkovHits; iDigitHit++){
718719

720+
//iDigitHit+=startingCherenkovHitID;
719721
times.push_back(digithit_T[iDigitHit]);
720722

721723
//std::cout << " Add Hit with " << digithit_pmtId[iDigitHit] << " Hybrid: " << iHybrid << std::endl;

0 commit comments

Comments
 (0)