Skip to content
Snippets Groups Projects
Commit 12a6cef3 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: ../src/THcCherenkov.cxx

	modified:   ../src/THcCherenkov.h
	modified:   ../src/THcCherenkovHit.h
	modified:   ../src/THcHitList.cxx
	modified:   ../src/THcHitList.h
	modified:   ../src/THcRawAdcHit.h
	modified:   ../src/include/hcana/HallC_Data.h
parent 4d998950
No related branches found
No related tags found
No related merge requests found
...@@ -414,12 +414,16 @@ Int_t THcCherenkov::Decode(const THaEvData& evdata) { ...@@ -414,12 +414,16 @@ Int_t THcCherenkov::Decode(const THaEvData& evdata) {
Int_t ihit = 0; Int_t ihit = 0;
UInt_t nrAdcHits = 0; UInt_t nrAdcHits = 0;
_waveforms.clear();
while (ihit < fNhits) { while (ihit < fNhits) {
THcCherenkovHit* hit = (THcCherenkovHit*)fRawHitList->At(ihit); THcCherenkovHit* hit = (THcCherenkovHit*)fRawHitList->At(ihit);
Int_t npmt = hit->fCounter; Int_t npmt = hit->fCounter;
THcRawAdcHit& rawAdcHit = hit->GetRawAdcHitPos(); THcRawAdcHit& rawAdcHit = hit->GetRawAdcHitPos();
_waveforms.push_back({rawAdcHit.GetSampleBuffer()});
for (UInt_t thit = 0; thit < rawAdcHit.GetNPulses(); thit++) { for (UInt_t thit = 0; thit < rawAdcHit.GetNPulses(); thit++) {
......
...@@ -55,6 +55,7 @@ public: ...@@ -55,6 +55,7 @@ public:
static const Int_t MaxNumAdcPulse = 4; static const Int_t MaxNumAdcPulse = 4;
THcCherenkov(); // for ROOT I/O THcCherenkov(); // for ROOT I/O
protected: protected:
Bool_t* fPresentP; Bool_t* fPresentP;
Int_t fAnalyzePedestals; Int_t fAnalyzePedestals;
......
...@@ -8,10 +8,6 @@ class THcCherenkovHit : public THcRawHodoHit { ...@@ -8,10 +8,6 @@ class THcCherenkovHit : public THcRawHodoHit {
public: public:
friend class THcCherenkov; friend class THcCherenkov;
protected:
private:
ClassDef(THcCherenkovHit,0); // Raw Cherenkov hit ClassDef(THcCherenkovHit,0); // Raw Cherenkov hit
}; };
......
...@@ -237,7 +237,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni ...@@ -237,7 +237,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni
Bool_t tdcref_miss = kFALSE; Bool_t tdcref_miss = kFALSE;
Bool_t adcref_miss = kFALSE; Bool_t adcref_miss = kFALSE;
// Get the indexed reference times for this event //
/// Get the indexed reference times for this event
for(Int_t i=0;i<fNRefIndex;i++) { for(Int_t i=0;i<fNRefIndex;i++) {
if(fRefIndexMaps[i].defined) { if(fRefIndexMaps[i].defined) {
...@@ -299,6 +300,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni ...@@ -299,6 +300,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni
} }
} }
} }
//
for ( Int_t i=0; i < fdMap->GetSize(); i++ ) { for ( Int_t i=0; i < fdMap->GetSize(); i++ ) {
THaDetMap::Module* d = fdMap->GetModule(i); THaDetMap::Module* d = fdMap->GetModule(i);
...@@ -391,7 +394,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni ...@@ -391,7 +394,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni
} }
} }
} }
} else { // This is a Flash ADC } else {
// This is a Flash ADC
if (fPSE125) { if (fPSE125) {
if(!fHaveFADCInfo) { if(!fHaveFADCInfo) {
...@@ -414,8 +418,9 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni ...@@ -414,8 +418,9 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni
} }
// Now get the pulse mode data // Now get the pulse mode data
// Pulse area will go into regular SetData, others will use special hit methods // Pulse area will go into regular SetData, others will use special hit methods
Int_t npulses=evdata.GetNumEvents(Decoder::kPulseIntegral, d->crate, d->slot, chan); Int_t npulses = evdata.GetNumEvents(Decoder::kPulseIntegral, d->crate, d->slot, chan);
// Assume that the # of pulses for kPulseTime, kPulsePeak and kPulsePedestal are same;
// Assume that the # of pulses for kPulseTime, kPulsePeak and kPulsePedestal are same;
Int_t timeshift=0; Int_t timeshift=0;
if(fTISlot>0) { // Get the trigger time for this module if(fTISlot>0) { // Get the trigger time for this module
if(fTrigTimeShiftMap.find(d->slot) if(fTrigTimeShiftMap.find(d->slot)
......
...@@ -34,6 +34,13 @@ public: ...@@ -34,6 +34,13 @@ public:
THcHitList(); THcHitList();
/** Populate the hitlist from the raw event data.
* Clears the hit list then, finds all populated channels belonging to the detector and add
* sort it into the hitlist. A given counter in the detector can have
* at most one entry in the hit list. However, the raw "hit" can contain
* multiple signal types (e.g. ADC+, ADC-, TDC+, TDC-), or multiplehits for multihit tdcs.
* The hit list is sorted (by plane, counter) after filling.
*/
virtual Int_t DecodeToHitList( const THaEvData& evdata, Bool_t suppress=kFALSE ); virtual Int_t DecodeToHitList( const THaEvData& evdata, Bool_t suppress=kFALSE );
void InitHitList(THaDetMap* detmap, void InitHitList(THaDetMap* detmap,
const char *hitclass, Int_t maxhits, const char *hitclass, Int_t maxhits,
...@@ -44,15 +51,14 @@ public: ...@@ -44,15 +51,14 @@ public:
void MissReport(const char *name); void MissReport(const char *name);
void DisableSlipCorrection() {fDisableSlipCorrection = kTRUE;} void DisableSlipCorrection() {fDisableSlipCorrection = kTRUE;}
UInt_t fNRawHits; UInt_t fNRawHits;
Int_t fNMaxRawHits; Int_t fNMaxRawHits;
Int_t fTDC_RefTimeCut; Int_t fTDC_RefTimeCut;
Int_t fADC_RefTimeCut; Int_t fADC_RefTimeCut;
Bool_t fTDC_RefTimeBest; Bool_t fTDC_RefTimeBest;
Bool_t fADC_RefTimeBest; Bool_t fADC_RefTimeBest;
TClonesArray* fRawHitList; // List of raw hits TClonesArray* fRawHitList; // List of raw hits
TClass* fRawHitClass; // Class of raw hit object to use TClass* fRawHitClass; // Class of raw hit object to use
THaDetMap* fdMap; THaDetMap* fdMap;
protected: protected:
...@@ -69,24 +75,23 @@ protected: ...@@ -69,24 +75,23 @@ protected:
// Should this be a sparse list instead in case user // Should this be a sparse list instead in case user
// picks ridiculously large refindexes? // picks ridiculously large refindexes?
Int_t fNRefIndex; Int_t fNRefIndex;
UInt_t fNSignals; UInt_t fNSignals;
THcRawHit::ESignalType *fSignalTypes; THcRawHit::ESignalType* fSignalTypes;
THcConfigEvtHandler* fPSE125;
THcConfigEvtHandler* fPSE125; Bool_t fHaveFADCInfo;
Bool_t fHaveFADCInfo; Int_t fNSA;
Int_t fNSA; Int_t fNSB;
Int_t fNSB; Int_t fNPED;
Int_t fNPED;
Int_t fNTDCRef_miss; Int_t fNTDCRef_miss;
Int_t fNADCRef_miss; Int_t fNADCRef_miss;
Decoder::THaCrateMap* fMap; /* The Crate map */ Decoder::THaCrateMap* fMap; /* The Crate map */
Int_t fTISlot; Int_t fTISlot;
Int_t fTICrate; Int_t fTICrate;
Double_t fDisableSlipCorrection; Double_t fDisableSlipCorrection;
std::map<Int_t, Int_t> fTrigTimeShiftMap; std::map<Int_t, Int_t> fTrigTimeShiftMap;
std::map<Int_t, Decoder::Fadc250Module*> fFADCSlotMap; std::map<Int_t, Decoder::Fadc250Module*> fFADCSlotMap;
ClassDef(THcHitList,0); // List of raw hits sorted by plane, counter ClassDef(THcHitList,0); // List of raw hits sorted by plane, counter
......
...@@ -46,6 +46,9 @@ class THcRawAdcHit : public TObject { ...@@ -46,6 +46,9 @@ class THcRawAdcHit : public TObject {
Double_t GetPulseAmp(UInt_t iPulse=0) const; Double_t GetPulseAmp(UInt_t iPulse=0) const;
Double_t GetPulseTime(UInt_t iPulse=0) const; Double_t GetPulseTime(UInt_t iPulse=0) const;
//Int_t GetSample(UInt_t iSample=0) const; //Int_t GetSample(UInt_t iSample=0) const;
Int_t* GetSampleBuffer() { return fSample;}
Int_t GetSampleIntRaw() const; Int_t GetSampleIntRaw() const;
Double_t GetSampleInt() const; Double_t GetSampleInt() const;
...@@ -60,11 +63,12 @@ class THcRawAdcHit : public TObject { ...@@ -60,11 +63,12 @@ class THcRawAdcHit : public TObject {
static const UInt_t fMaxNSamples = 511; static const UInt_t fMaxNSamples = 511;
// FADC conversion factors // FADC conversion factors
static const Double_t fNAdcChan; // Number of FADC channels in units of ADC channels static const Double_t fNAdcChan; // Number of FADC channels in units of ADC channels
static const Double_t fAdcRange; // Dynamic range of FADCs in units of V, // TO-DO: Get fAdcRange from pre-start event static const Double_t fAdcRange; // Dynamic range of FADCs in units of V, // TO-DO: Get
static const Double_t fAdcImpedence; // FADC input impedence in units of Ohms // fAdcRange from pre-start event
static const Double_t fAdcTimeSample; // Length of FADC time sample in units of ps static const Double_t fAdcImpedence; // FADC input impedence in units of Ohms
static const Double_t fAdcTimeRes; // FADC time resolution in units of ns static const Double_t fAdcTimeSample; // Length of FADC time sample in units of ps
static const Double_t fAdcTimeRes; // FADC time resolution in units of ns
Int_t fNPedestalSamples; // TODO: Get this from prestart event... Int_t fNPedestalSamples; // TODO: Get this from prestart event...
Int_t fNPeakSamples; Int_t fNPeakSamples;
...@@ -75,7 +79,7 @@ class THcRawAdcHit : public TObject { ...@@ -75,7 +79,7 @@ class THcRawAdcHit : public TObject {
Int_t fPulseInt[fMaxNPulses]; Int_t fPulseInt[fMaxNPulses];
Int_t fPulseAmp[fMaxNPulses]; Int_t fPulseAmp[fMaxNPulses];
Int_t fPulseTime[fMaxNPulses]; Int_t fPulseTime[fMaxNPulses];
Int_t fSample[fMaxNSamples]; Int_t fSample[fMaxNSamples]; // the big buffer
Int_t fRefTime; Int_t fRefTime;
Bool_t fHasMulti; Bool_t fHasMulti;
......
...@@ -2,15 +2,26 @@ ...@@ -2,15 +2,26 @@
#define hallc_HallC_Data_HH #define hallc_HallC_Data_HH
#include <array> #include <array>
#include <algorithm>
namespace hallc { namespace hallc {
namespace data { namespace data {
/** Stores the digitized pulse data in a fixed size array.
*/
struct PulseWaveForm { struct PulseWaveForm {
std::array<float,200> _buffer; static const UInt_t MaxNPulses = 4;
ClassDef(PulseWaveForm,1) static const UInt_t MaxNSamples = 511;
}; // From THcRawAdcHit.h
PulseWaveForm() {}
PulseWaveForm(Int_t* buf, Int_t size = MaxNSamples) { std::copy_n(buf, MaxNSamples, std::begin(_buffer)); }
virtual ~PulseWaveForm() {}
std::array<Int_t, MaxNSamples> _buffer;
ClassDef(PulseWaveForm, 1)
};
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment