Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/spectwriter' into develop
- Loading branch information
Showing
7 changed files
with
418 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
Source/IO/ROOTSpectrogramWriter/KTROOTSpectrogramTypeWriterEventAnalysis.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* KTROOTSpectrogramTypeWriterEventAnalysis.cc | ||
* | ||
* Created on: Aug 8, 2017 | ||
* Author: nsoblath | ||
*/ | ||
|
||
#include "KTROOTSpectrogramTypeWriterEventAnalysis.hh" | ||
|
||
#include "KTProcessedTrackData.hh" | ||
|
||
#include "TLine.h" | ||
#include "TOrdCollection.h" | ||
|
||
#include "KTLogger.hh" | ||
|
||
namespace Katydid | ||
{ | ||
KTLOGGER(publog, "KTROOTSpectrogramTypeWriterEventAnalysis"); | ||
|
||
static Nymph::KTTIRegistrar< KTROOTSpectrogramTypeWriter, KTROOTSpectrogramTypeWriterEventAnalysis > sRSTWEARegistrar; | ||
|
||
KTROOTSpectrogramTypeWriterEventAnalysis::KTROOTSpectrogramTypeWriterEventAnalysis() : | ||
KTROOTSpectrogramTypeWriter(), | ||
//KTTypeWriterEventAnalysis() | ||
fLineCollection(NULL) | ||
{ | ||
} | ||
|
||
KTROOTSpectrogramTypeWriterEventAnalysis::~KTROOTSpectrogramTypeWriterEventAnalysis() | ||
{ | ||
delete fLineCollection; | ||
} | ||
|
||
void KTROOTSpectrogramTypeWriterEventAnalysis::ClearLines() | ||
{ | ||
delete fLineCollection; | ||
fLineCollection = NULL; | ||
} | ||
|
||
void KTROOTSpectrogramTypeWriterEventAnalysis::OutputSpectrograms() | ||
{ | ||
if (! fWriter->OpenAndVerifyFile()) return; | ||
|
||
KTDEBUG("calling output lines") | ||
OutputLines(); | ||
|
||
return; | ||
} | ||
|
||
void KTROOTSpectrogramTypeWriterEventAnalysis::OutputLines() | ||
{ | ||
KTDEBUG(publog, "Outputing lines"); | ||
fWriter->GetFile()->WriteTObject(fLineCollection, "AllLines", "SingleKey"); | ||
fLineCollection = NULL; | ||
return; | ||
} | ||
|
||
void KTROOTSpectrogramTypeWriterEventAnalysis::RegisterSlots() | ||
{ | ||
fWriter->RegisterSlot("proc-track", this, &KTROOTSpectrogramTypeWriterEventAnalysis::AddProcessedTrackData); | ||
return; | ||
} | ||
|
||
|
||
//********************* | ||
// Processed Track Data | ||
//********************* | ||
|
||
void KTROOTSpectrogramTypeWriterEventAnalysis::AddProcessedTrackData(Nymph::KTDataPtr data) | ||
{ | ||
KTProcessedTrackData thisLine = data->Of< KTProcessedTrackData >(); | ||
|
||
// if( thisLine.GetIsCut() ) | ||
// { | ||
// KTINFO("The track is cut! Will not add it to the Line Collection"); | ||
// return; | ||
// } | ||
|
||
if (fLineCollection == NULL) | ||
{ | ||
fLineCollection = new TOrdCollection(); | ||
} | ||
TLine* rootLine = new TLine(thisLine.GetStartTimeInRunC(), thisLine.GetStartFrequency(), thisLine.GetEndTimeInRunC(), thisLine.GetEndFrequency()); | ||
fLineCollection->Add(rootLine); | ||
|
||
return; | ||
} | ||
|
||
} /* namespace Katydid */ |
41 changes: 41 additions & 0 deletions
41
Source/IO/ROOTSpectrogramWriter/KTROOTSpectrogramTypeWriterEventAnalysis.hh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* KTROOTSpectrogramTypeWriterEventAnalysis.hh | ||
* | ||
* Created on: Aug 8, 2017 | ||
* Author: nsoblath | ||
*/ | ||
|
||
#ifndef KTROOTSPECTROGRAMTYPEWRITEREVENTANALYSIS_HH_ | ||
#define KTROOTSPECTROGRAMTYPEWRITEREVENTANALYSIS_HH_ | ||
|
||
#include "KTROOTSpectrogramWriter.hh" | ||
|
||
class TOrdCollection; | ||
|
||
namespace Katydid | ||
{ | ||
|
||
class KTROOTSpectrogramTypeWriterEventAnalysis : public KTROOTSpectrogramTypeWriter//, public KTTypeWriterEventAnalysis | ||
{ | ||
public: | ||
KTROOTSpectrogramTypeWriterEventAnalysis(); | ||
virtual ~KTROOTSpectrogramTypeWriterEventAnalysis(); | ||
|
||
void RegisterSlots(); | ||
|
||
public: | ||
void AddProcessedTrackData(Nymph::KTDataPtr data); | ||
|
||
private: | ||
TOrdCollection *fLineCollection; | ||
|
||
public: | ||
void OutputSpectrograms(); | ||
void OutputLines(); | ||
void ClearLines(); | ||
|
||
}; | ||
|
||
|
||
} /* namespace Katydid */ | ||
#endif /* KTROOTSPECTROGRAMTYPEWRITEREVENTANALYSIS_HH_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.