diff --git a/src/THcAerogel.cxx b/src/THcAerogel.cxx index 1dc6285783b36c9c30caec922f0e39592917c4b0..3b53d464d25481e83701a50dec76ca3a64cd4a4d 100644 --- a/src/THcAerogel.cxx +++ b/src/THcAerogel.cxx @@ -716,10 +716,14 @@ Int_t THcAerogel::CoarseProcess( TClonesArray& ) //tracks Bool_t pulseTimeCut = adctdcdiffTime > fAdcPosTimeWindowMin[npmt] && adctdcdiffTime < fAdcPosTimeWindowMax[npmt]; // By default, the last hit within the timing cut will be considered "good" - if (!errorFlag && pulseTimeCut) { + if (!errorFlag) + { + fGoodPosAdcMult.at(npmt) += 1; + } + + if (!errorFlag && pulseTimeCut) { fGoodPosAdcPed.at(npmt) = pulsePed; - fGoodPosAdcMult.at(npmt) = frPosAdcPulseInt->GetEntries(); - // cout << " out = " << npmt << " " << frPosAdcPulseInt->GetEntries() << " " <<fGoodPosAdcMult.at(npmt); + // cout << " out = " << npmt << " " << frPosAdcPulseInt->GetEntries() << " " <<fGoodPosAdcMult.at(npmt); fGoodPosAdcPulseInt.at(npmt) = pulseInt; fGoodPosAdcPulseIntRaw.at(npmt) = pulseIntRaw; fGoodPosAdcPulseAmp.at(npmt) = pulseAmp; @@ -748,15 +752,18 @@ Int_t THcAerogel::CoarseProcess( TClonesArray& ) //tracks Bool_t errorFlag = ((THcSignalHit*) fNegAdcErrorFlag->ConstructedAt(ielem))->GetData(); //// Bool_t pulseTimeCut = adctdcdiffTime > fAdcTimeWindowMin && adctdcdiffTime < fAdcTimeWindowMax; Bool_t pulseTimeCut = adctdcdiffTime > fAdcNegTimeWindowMin[npmt] && adctdcdiffTime < fAdcNegTimeWindowMax[npmt]; - + if (!errorFlag) + { + fGoodNegAdcMult.at(npmt) += 1; + } + // By default, the last hit within the timing cut will be considered "good" if (!errorFlag && pulseTimeCut) { fGoodNegAdcPed.at(npmt) = pulsePed; - fGoodNegAdcMult.at(npmt) = frNegAdcPulseInt->GetEntries(); - fGoodNegAdcPulseInt.at(npmt) = pulseInt; fGoodNegAdcPulseIntRaw.at(npmt) = pulseIntRaw; fGoodNegAdcPulseAmp.at(npmt) = pulseAmp; - fGoodNegAdcPulseTime.at(npmt) = pulseTime; + fGoodNegAdcPulseInt.at(npmt) = pulseInt; + fGoodNegAdcPulseTime.at(npmt) = pulseTime; fGoodNegAdcTdcDiffTime.at(npmt) = adctdcdiffTime; fNegNpe.at(npmt) = fNegGain[npmt]*fGoodNegAdcPulseInt.at(npmt); diff --git a/src/THcDC.h b/src/THcDC.h index c4fe61a863ae8d79db9008d9abc99236672e7bd5..80918fd04db076d448d23d98310e115080a13e55 100644 --- a/src/THcDC.h +++ b/src/THcDC.h @@ -189,7 +189,7 @@ protected: // double tan_angle, sin_angle, cos_angle; // Intermediate structure for building - static const char MAXTRACKS = 10; + static const UInt_t MAXTRACKS = 10; std::vector<THcDriftChamberPlane*> fPlanes; // List of plane objects std::vector<THcDriftChamber*> fChambers; // List of chamber objects diff --git a/src/THcHelicityReader.cxx b/src/THcHelicityReader.cxx index e956fd1f07181a2e9815933917f20ea9bebb6507..66814306b5042725dfc65620b53b9c5e6b92657a 100644 --- a/src/THcHelicityReader.cxx +++ b/src/THcHelicityReader.cxx @@ -8,6 +8,8 @@ #include "THcHelicityReader.h" #include "THaEvData.h" +#include "THcGlobals.h" +#include "THcParmList.h" #include "TMath.h" #include "TError.h" #include "VarDef.h" @@ -59,6 +61,15 @@ Int_t THcHelicityReader::ReadDatabase( const char* /*dbfilename*/, SetROCinfo(kMPS,2,14,10); SetROCinfo(kQrt,2,14,7); SetROCinfo(kTime,2,21,2); + + fADCThreshold = 8000; + + DBRequest list[] = { + {"helicity_adcthreshold",&fADCThreshold, kInt, 0, 1}, + {0} + }; + + gHcParms->LoadParmValues(list, ""); return THaAnalysisObject::kOK; } @@ -124,27 +135,27 @@ Int_t THcHelicityReader::ReadData( const THaEvData& evdata ) // Get the helicity control signals. These are from the pedestals // acquired by FADC channels. - UInt_t helpraw = evdata.GetData(Decoder::kPulsePedestal, + Int_t helpraw = evdata.GetData(Decoder::kPulsePedestal, fROCinfo[kHel].roc, fROCinfo[kHel].slot, fROCinfo[kHel].index, 0); - UInt_t helmraw = evdata.GetData(Decoder::kPulsePedestal, + Int_t helmraw = evdata.GetData(Decoder::kPulsePedestal, fROCinfo[kHelm].roc, fROCinfo[kHelm].slot, fROCinfo[kHelm].index, 0); - UInt_t mpsraw = evdata.GetData(Decoder::kPulsePedestal, + Int_t mpsraw = evdata.GetData(Decoder::kPulsePedestal, fROCinfo[kMPS].roc, fROCinfo[kMPS].slot, fROCinfo[kMPS].index, 0); - UInt_t qrtraw = evdata.GetData(Decoder::kPulsePedestal, + Int_t qrtraw = evdata.GetData(Decoder::kPulsePedestal, fROCinfo[kQrt].roc, fROCinfo[kQrt].slot, fROCinfo[kQrt].index, 0); - fIsQrt = qrtraw > 1000; - fIsMPS = mpsraw > 1000; - fIsHelp = helpraw > 1000; - fIsHelm = helmraw > 1000; + fIsQrt = qrtraw > fADCThreshold; + fIsMPS = mpsraw > fADCThreshold; + fIsHelp = helpraw > fADCThreshold; + fIsHelm = helmraw > fADCThreshold; return 0; } diff --git a/src/THcHelicityReader.h b/src/THcHelicityReader.h index a65ad13d6abd9e3cd63b0d3eae70c2da73b23488..eef01503732231f90dfbca4132c3128e4dcf591f 100644 --- a/src/THcHelicityReader.h +++ b/src/THcHelicityReader.h @@ -21,8 +21,6 @@ public: THcHelicityReader(); virtual ~THcHelicityReader(); - void Print(); - struct ROCinfo { Int_t roc; // ROC to read out Int_t slot; // Headers to search for (0 = ignore) @@ -52,6 +50,8 @@ protected: Bool_t fIsHelp; Bool_t fIsHelm; + Int_t fADCThreshold; // Threshold for On/Off of helicity signals + ROCinfo fROCinfo[kCount]; Int_t fQWEAKDebug; // Debug level diff --git a/src/THcRun.cxx b/src/THcRun.cxx index 449a1f8afc868b7895a87d4daf8205a841ef7202..06f5593ac596c61e6e33317f77f9b27b7e213d62 100644 --- a/src/THcRun.cxx +++ b/src/THcRun.cxx @@ -40,7 +40,7 @@ THcRun::THcRun( const vector<TString>& pathList, const char* filename, } //_____________________________________________________________________________ -THcRun& THcRun::operator=(const THaRun& rhs) +THcRun& THcRun::operator=(const THaRunBase& rhs) { // Assignment operator. Not really sure what I (saw) am doing here. diff --git a/src/THcRun.h b/src/THcRun.h index fa9eadacca3a0e0c8cce1c5a039acb37f1cfe7b0..0fcd7771947c87c5eb7f777123fe7915b3d07220 100644 --- a/src/THcRun.h +++ b/src/THcRun.h @@ -17,7 +17,7 @@ class THcRun : public THaRun { THcRun( const THcRun& run ); THcRun( const std::vector<TString>& pathList, const char* filename, const char* description="" ); - virtual THcRun& operator=( const THaRun& rhs ); + THcRun& operator=( const THaRunBase& rhs ); virtual ~THcRun(); virtual void Print( Option_t* opt="" ) const; THcParmList* GetHCParms() const { return fHcParms; }