From bc2837351951383ff9086b2effdd67b1a9dde1a2 Mon Sep 17 00:00:00 2001 From: Paul King Date: Wed, 18 Jul 2018 11:05:44 -0400 Subject: [PATCH 1/6] Added a typedef for the ROC ID and Bank ID variables, to enable expanding the bank ID definition to include marker words within a bank. This commit just has the change in variable type, without any added functionality. --- Analysis/include/MQwF1TDC.h | 10 +++---- Analysis/include/MQwV775TDC.h | 5 ++-- Analysis/include/QwEventBuffer.h | 2 +- Analysis/include/QwF1TDContainer.h | 2 +- Analysis/include/QwOmnivore.h | 6 ++-- Analysis/include/QwSubsystemArray.h | 6 ++-- Analysis/include/QwTypes.h | 5 ++++ Analysis/include/VQwSubsystem.h | 35 ++++++++++++++-------- Analysis/src/MQwF1TDC.cc | 10 +++---- Analysis/src/MQwV775TDC.cc | 4 +-- Analysis/src/QwF1TDContainer.cc | 2 +- Analysis/src/QwSubsystemArray.cc | 8 ++--- Analysis/src/VQwSubsystem.cc | 20 +++---------- Parity/include/MollerMainDetector.h | 4 +-- Parity/include/QwBeamLine.h | 4 +-- Parity/include/QwBeamMod.h | 4 +-- Parity/include/QwComptonElectronDetector.h | 4 +-- Parity/include/QwHelicity.h | 6 ++-- Parity/include/QwIntegratedRaster.h | 4 +-- Parity/include/QwLumi.h | 4 +-- Parity/include/QwMainCerenkovDetector.h | 4 +-- Parity/include/QwMollerDetector.h | 8 ++--- Parity/include/QwRegressionSubsystem.h | 4 +-- Parity/include/QwScaler.h | 4 +-- Parity/src/MollerMainDetector.cc | 4 +-- Parity/src/QwBeamLine.cc | 4 +-- Parity/src/QwComptonElectronDetector.cc | 4 +-- Parity/src/QwHelicity.cc | 4 +-- Parity/src/QwLumi.cc | 4 +-- Parity/src/QwMainCerenkovDetector.cc | 4 +-- Parity/src/QwMollerDetector.cc | 9 +++--- Parity/src/QwRegressionSubsystem.cc | 4 +-- Parity/src/QwScaler.cc | 4 +-- 33 files changed, 106 insertions(+), 100 deletions(-) diff --git a/Analysis/include/MQwF1TDC.h b/Analysis/include/MQwF1TDC.h index 89d17a20e..7f6b98c45 100755 --- a/Analysis/include/MQwF1TDC.h +++ b/Analysis/include/MQwF1TDC.h @@ -36,7 +36,7 @@ class MQwF1TDC{ friend std::ostream& operator<<(std::ostream& os, const MQwF1TDC &f1tdc); - void DecodeTDCWord(UInt_t &word, const UInt_t roc_id); + void DecodeTDCWord(UInt_t &word, const ROCID_t roc_id); Bool_t IsValidDataword() const; const Bool_t& IsHeaderword() const {return fF1HeaderFlag;}; @@ -63,7 +63,7 @@ class MQwF1TDC{ /* Double_t SubtractReference(Double_t rawtime, Double_t reftime); */ /* Double_t ActualTimeDifference(Double_t raw_time, Double_t ref_time); */ - /* Bool_t CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words); */ + /* Bool_t CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t num_words); */ void PrintTDCHeader(Bool_t flag); void PrintTDCData(Bool_t flag); void Print(Bool_t flag); @@ -181,9 +181,9 @@ class MQwF1TDC{ // MQwV775TDC. I think "IsSlotRegistered()" can do instead of this // - void PrintHitFIFOStatus(const UInt_t roc_id); - void PrintOutputFIFOStatus(const UInt_t roc_id); - void PrintResolutionLockStatus(const UInt_t roc_id); + void PrintHitFIFOStatus(const ROCID_t roc_id); + void PrintOutputFIFOStatus(const ROCID_t roc_id); + void PrintResolutionLockStatus(const ROCID_t roc_id); diff --git a/Analysis/include/MQwV775TDC.h b/Analysis/include/MQwV775TDC.h index 8b81d701d..f20e1f29f 100755 --- a/Analysis/include/MQwV775TDC.h +++ b/Analysis/include/MQwV775TDC.h @@ -11,6 +11,7 @@ #define __MQwV775TDC__ #include "Rtypes.h" +#include "QwTypes.h" #include #include @@ -34,7 +35,7 @@ class MQwV775TDC{ MQwV775TDC(); ~MQwV775TDC(); - void DecodeTDCWord(UInt_t &word, const UInt_t roc_id=0); + void DecodeTDCWord(UInt_t &word, const ROCID_t roc_id=0); Bool_t IsValidDataword() {return fV775ValidFlag;}; Bool_t IsHeaderword() {return fV775HeaderFlag;}; @@ -54,7 +55,7 @@ class MQwV775TDC{ }; Double_t SubtractReference(Double_t rawtime, Double_t reftime); - Bool_t CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words); + Bool_t CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t num_words); void PrintTDCHeader(Bool_t flag) ; void PrintTDCData(Bool_t flag) ; diff --git a/Analysis/include/QwEventBuffer.h b/Analysis/include/QwEventBuffer.h index ac32ead07..31b2ea055 100755 --- a/Analysis/include/QwEventBuffer.h +++ b/Analysis/include/QwEventBuffer.h @@ -268,7 +268,7 @@ template < class T > Bool_t QwEventBuffer::FillObjectWithEventData(T &object){ /// - Bool_t T::CanUseThisEventType(const UInt_t event_type); /// - Bool_t T::ClearEventData(const UInt_t event_type); /// - Int_t T::ProcessBuffer(const UInt_t event_type, - /// const UInt_t roc_id, const UInt_t bank_id, + /// const ROCID_t roc_id, const BankID_t bank_id, /// const UInt_t banktype, UInt_t* buffer, UInt_t num_words); /// Bool_t okay = kFALSE; diff --git a/Analysis/include/QwF1TDContainer.h b/Analysis/include/QwF1TDContainer.h index c8c851f50..13a6cb186 100755 --- a/Analysis/include/QwF1TDContainer.h +++ b/Analysis/include/QwF1TDContainer.h @@ -323,7 +323,7 @@ class QwF1TDContainer : public TObject void AddS30(Int_t roc, Int_t slot, Int_t channel); - Bool_t CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words); + Bool_t CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t num_words); const MQwF1TDC GetF1TDCDecoder() const {return fF1TDCDecoder;}; diff --git a/Analysis/include/QwOmnivore.h b/Analysis/include/QwOmnivore.h index f69408a2e..f8c239abb 100755 --- a/Analysis/include/QwOmnivore.h +++ b/Analysis/include/QwOmnivore.h @@ -60,7 +60,7 @@ class QwOmnivore: public VQwSubsystem_t { void ClearEventData() { }; /// Process the configuration events - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) { + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { /// Om nom nom nom // TODO (wdc) configuration events seem to have num_words = 0xffffffff //UInt_t cheeseburger; @@ -70,13 +70,13 @@ class QwOmnivore: public VQwSubsystem_t { }; /// Process the event buffer - Int_t ProcessEvBuffer(const UInt_t event_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) { + Int_t ProcessEvBuffer(const UInt_t event_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { /// TODO: Subsystems should be changing their ProcessEvBuffer routines to take the event_type as the first /// arguement. But in the meantime, default to just calling the non-event-type-aware ProcessEvBuffer routine. return this->ProcessEvBuffer(roc_id, bank_id, buffer, num_words); }; /// TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version. - Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) { + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { /// Om nom nom nom UInt_t cheeseburger; for (UInt_t word = 0; word < num_words; word++) diff --git a/Analysis/include/QwSubsystemArray.h b/Analysis/include/QwSubsystemArray.h index 82b951642..ffdef54ef 100755 --- a/Analysis/include/QwSubsystemArray.h +++ b/Analysis/include/QwSubsystemArray.h @@ -124,12 +124,12 @@ class QwSubsystemArray: public std::vector > { void ClearEventData(); /// \brief Process the event buffer for configuration events - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words); /// \brief Process the event buffer for events - Int_t ProcessEvBuffer(const UInt_t event_type, const UInt_t roc_id, - const UInt_t bank_id, UInt_t *buffer, + Int_t ProcessEvBuffer(const UInt_t event_type, const ROCID_t roc_id, + const BankID_t bank_id, UInt_t *buffer, UInt_t num_words); /// \brief Randomize the data in this event diff --git a/Analysis/include/QwTypes.h b/Analysis/include/QwTypes.h index 2a0cd8101..d57e4e608 100755 --- a/Analysis/include/QwTypes.h +++ b/Analysis/include/QwTypes.h @@ -12,6 +12,11 @@ class TString; // Qweak headers #include "QwUnits.h" +// Types for the ROC_ID and Bank_ID used in decoding and destributing data +typedef UInt_t ROCID_t; +typedef ULong64_t BankID_t; /// Bank ID will combine both bank and marker words + + // Enumerator types for regions and directions enum EQwRegionID { kRegionIDNull = 0, diff --git a/Analysis/include/VQwSubsystem.h b/Analysis/include/VQwSubsystem.h index 6f3efedb0..28ef70c38 100755 --- a/Analysis/include/VQwSubsystem.h +++ b/Analysis/include/VQwSubsystem.h @@ -168,16 +168,16 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { virtual void ClearEventData() = 0; - virtual Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) = 0; + virtual Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) = 0; - virtual Int_t ProcessEvBuffer(const UInt_t event_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words){ + virtual Int_t ProcessEvBuffer(const UInt_t event_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words){ /// TODO: Subsystems should be changing their ProcessEvBuffer routines to take the event_type as the first /// argument. But in the meantime, default to just calling the non-event-type-aware ProcessEvBuffer routine. if (((0x1 << (event_type - 1)) & this->GetEventTypeMask()) == 0) return 0; else return this->ProcessEvBuffer(roc_id, bank_id, buffer, num_words); }; /// TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version. - virtual Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) = 0; + virtual Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) = 0; virtual void ProcessEvent() = 0; /*! \brief Request processed data from other subsystems for internal @@ -292,22 +292,33 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { /*! \brief Tell the object that it will decode data from this ROC and sub-bank */ - virtual Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id = 0); + virtual Int_t RegisterROCNumber(const ROCID_t roc_id, const BankID_t bank_id = 0); /*! \brief Tell the object that it will decode data from this sub-bank in the ROC currently open for registration */ - Int_t RegisterSubbank(const UInt_t bank_id); + Int_t RegisterSubbank(const BankID_t bank_id); Int_t GetSubbankIndex() const { return GetSubbankIndex(fCurrentROC_ID, fCurrentBank_ID); } - Int_t GetSubbankIndex(const UInt_t roc_id, const UInt_t bank_id) const; + Int_t GetSubbankIndex(const ROCID_t roc_id, const BankID_t bank_id) const; void SetDataLoaded(Bool_t flag){fIsDataLoaded = flag;}; protected: - Int_t FindIndex(const std::vector &myvec, const UInt_t value) const ; - + template < class T > + Int_t FindIndex(const std::vector &myvec, const T value) const + { + Int_t index = -1; + for (size_t i=0 ; i < myvec.size(); i++ ){ + if (myvec[i]==value){ + index=i; + break; + } + } + return index; + }; + protected: TString fSystemName; ///< Name of this subsystem @@ -320,13 +331,13 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { std::map fDetectorMaps; protected: - Int_t fCurrentROC_ID; ///< ROC ID that is currently being processed - Int_t fCurrentBank_ID; ///< Bank ID that is currently being processed + ROCID_t fCurrentROC_ID; ///< ROC ID that is currently being processed + BankID_t fCurrentBank_ID; ///< Bank ID that is currently being processed /// Vector of ROC IDs associated with this subsystem - std::vector fROC_IDs; + std::vector fROC_IDs; /// Vector of Bank IDs per ROC ID associated with this subsystem - std::vector< std::vector > fBank_IDs; + std::vector< std::vector > fBank_IDs; /// Vector of pointers to subsystem arrays that contain this subsystem std::vector fArrays; diff --git a/Analysis/src/MQwF1TDC.cc b/Analysis/src/MQwF1TDC.cc index 1363f429a..edb94d6d8 100755 --- a/Analysis/src/MQwF1TDC.cc +++ b/Analysis/src/MQwF1TDC.cc @@ -81,7 +81,7 @@ MQwF1TDC::MQwF1TDC() MQwF1TDC::~MQwF1TDC() { } -void MQwF1TDC::DecodeTDCWord(UInt_t &word, const UInt_t roc_id) +void MQwF1TDC::DecodeTDCWord(UInt_t &word, const ROCID_t roc_id) { fF1ROCNumber = roc_id; @@ -290,7 +290,7 @@ void MQwF1TDC::PrintTDCData(Bool_t flag) -void MQwF1TDC::PrintResolutionLockStatus(const UInt_t roc_id) +void MQwF1TDC::PrintResolutionLockStatus(const ROCID_t roc_id) { if (not fF1ResolutionLockFlag) { QwWarning << "F1TDC board RESOULTION LOCK FAIL at Ch " @@ -302,7 +302,7 @@ void MQwF1TDC::PrintResolutionLockStatus(const UInt_t roc_id) -void MQwF1TDC::PrintHitFIFOStatus(const UInt_t roc_id) +void MQwF1TDC::PrintHitFIFOStatus(const ROCID_t roc_id) { if (fF1HitFIFOFlag) { QwWarning << "F1TDC board HIT FIFO FULL at Ch " @@ -314,7 +314,7 @@ void MQwF1TDC::PrintHitFIFOStatus(const UInt_t roc_id) -void MQwF1TDC::PrintOutputFIFOStatus(const UInt_t roc_id) +void MQwF1TDC::PrintOutputFIFOStatus(const ROCID_t roc_id) { if (fF1OutputFIFOFlag) { QwWarning << "F1TDC board OUTPUT FIFO FULL at Ch " @@ -340,7 +340,7 @@ Bool_t MQwF1TDC::IsValidDataword() const } -// Bool_t MQwF1TDC::CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words) +// Bool_t MQwF1TDC::CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t num_words) // { // UInt_t reference_trig_time = 0; // UInt_t reference_event_num = 0; diff --git a/Analysis/src/MQwV775TDC.cc b/Analysis/src/MQwV775TDC.cc index 3f81ca9b5..10ae88a64 100755 --- a/Analysis/src/MQwV775TDC.cc +++ b/Analysis/src/MQwV775TDC.cc @@ -50,7 +50,7 @@ MQwV775TDC::~MQwV775TDC() { } // See page 43 at https://qweak.jlab.org/wiki/images/V775.pdf -void MQwV775TDC::DecodeTDCWord(UInt_t &word, const UInt_t roc_id) +void MQwV775TDC::DecodeTDCWord(UInt_t &word, const ROCID_t roc_id) { @@ -104,7 +104,7 @@ UInt_t MQwV775TDC::GetTDCTriggerTime() } -Bool_t MQwV775TDC::CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words) +Bool_t MQwV775TDC::CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t num_words) { // will be investigated later. return kFALSE; diff --git a/Analysis/src/QwF1TDContainer.cc b/Analysis/src/QwF1TDContainer.cc index 0fcfdcd2f..f9ee1261a 100755 --- a/Analysis/src/QwF1TDContainer.cc +++ b/Analysis/src/QwF1TDContainer.cc @@ -1397,7 +1397,7 @@ QwF1TDContainer::GetErrorSummary() // S30 : Slot 30 dataword when the F1 chip has no response within "a reasonable time" Bool_t -QwF1TDContainer::CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words) +QwF1TDContainer::CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t num_words) { diff --git a/Analysis/src/QwSubsystemArray.cc b/Analysis/src/QwSubsystemArray.cc index 16c699175..0ddb399e3 100755 --- a/Analysis/src/QwSubsystemArray.cc +++ b/Analysis/src/QwSubsystemArray.cc @@ -324,8 +324,8 @@ void QwSubsystemArray::ClearEventData() } Int_t QwSubsystemArray::ProcessConfigurationBuffer( - const UInt_t roc_id, - const UInt_t bank_id, + const ROCID_t roc_id, + const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { @@ -338,8 +338,8 @@ Int_t QwSubsystemArray::ProcessConfigurationBuffer( Int_t QwSubsystemArray::ProcessEvBuffer( const UInt_t event_type, - const UInt_t roc_id, - const UInt_t bank_id, + const ROCID_t roc_id, + const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { diff --git a/Analysis/src/VQwSubsystem.cc b/Analysis/src/VQwSubsystem.cc index 20f35dbb4..e05baae6b 100755 --- a/Analysis/src/VQwSubsystem.cc +++ b/Analysis/src/VQwSubsystem.cc @@ -239,19 +239,7 @@ void VQwSubsystem::ClearAllBankRegistrations() fCurrentBank_ID = -1; } -Int_t VQwSubsystem::FindIndex(const std::vector &myvec, const UInt_t value) const -{ - Int_t index = -1; - for (size_t i=0 ; i < myvec.size(); i++ ){ - if (myvec[i]==value){ - index=i; - break; - } - } - return index; -} - -Int_t VQwSubsystem::GetSubbankIndex(const UInt_t roc_id, const UInt_t bank_id) const +Int_t VQwSubsystem::GetSubbankIndex(const ROCID_t roc_id, const BankID_t bank_id) const { // Bool_t lDEBUG=kTRUE; Int_t index = -1; @@ -277,7 +265,7 @@ Int_t VQwSubsystem::GetSubbankIndex(const UInt_t roc_id, const UInt_t bank_id) c return index; } -Int_t VQwSubsystem::RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id) +Int_t VQwSubsystem::RegisterROCNumber(const ROCID_t roc_id, const BankID_t bank_id) { Int_t stat = 0; Int_t roc_index = 0; @@ -287,7 +275,7 @@ Int_t VQwSubsystem::RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id) if (roc_index==-1){ fROC_IDs.push_back(roc_id); // new ROC number is added. roc_index = (fROC_IDs.size() - 1); - std::vector tmpvec(1,bank_id); + std::vector tmpvec(1,bank_id); fBank_IDs.push_back(tmpvec); } else { Int_t bank_index = FindIndex(fBank_IDs[roc_index],bank_id); @@ -313,7 +301,7 @@ Int_t VQwSubsystem::RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id) return stat; } -Int_t VQwSubsystem::RegisterSubbank(const UInt_t bank_id) +Int_t VQwSubsystem::RegisterSubbank(const BankID_t bank_id) { Int_t stat = 0; if (fCurrentROC_ID != -1){ diff --git a/Parity/include/MollerMainDetector.h b/Parity/include/MollerMainDetector.h index 3f7e2ecc6..dd3d30930 100755 --- a/Parity/include/MollerMainDetector.h +++ b/Parity/include/MollerMainDetector.h @@ -79,8 +79,8 @@ class MollerMainDetector: void UpdateErrorFlag(const VQwSubsystem *ev_error); - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); void ClearEventData(); Bool_t IsGoodEvent(); diff --git a/Parity/include/QwBeamLine.h b/Parity/include/QwBeamLine.h index 2a242dd9b..14b892622 100755 --- a/Parity/include/QwBeamLine.h +++ b/Parity/include/QwBeamLine.h @@ -81,8 +81,8 @@ class QwBeamLine : public VQwSubsystemParity, public MQwSubsystemCloneable { void DeaccumulateRunningSum(VQwSubsystem* value); void CalculateRunningAverage(); - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); void PrintDetectorID() const; void ClearEventData(); diff --git a/Parity/include/QwMainCerenkovDetector.h b/Parity/include/QwMainCerenkovDetector.h index 25b064154..61c0487ca 100755 --- a/Parity/include/QwMainCerenkovDetector.h +++ b/Parity/include/QwMainCerenkovDetector.h @@ -79,8 +79,8 @@ class QwMainCerenkovDetector: void UpdateErrorFlag(const VQwSubsystem *ev_error); - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); void ClearEventData(); Bool_t IsGoodEvent(); diff --git a/Parity/include/QwMollerDetector.h b/Parity/include/QwMollerDetector.h index 37f69eaec..63bd5af85 100755 --- a/Parity/include/QwMollerDetector.h +++ b/Parity/include/QwMollerDetector.h @@ -87,10 +87,10 @@ class QwMollerDetector: Int_t LoadInputParameters(TString pedestalfile); Int_t LoadEventCuts(TString & filename); Bool_t SingleEventCuts(); - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessConfigurationBuffer(UInt_t ev_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t *buffer, UInt_t num_words); - Int_t ProcessEvBuffer(UInt_t ev_type, UInt_t roc_id, UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessConfigurationBuffer(UInt_t ev_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words); + Int_t ProcessEvBuffer(UInt_t ev_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); void ClearEventData(); void ProcessEvent(); diff --git a/Parity/include/QwRegressionSubsystem.h b/Parity/include/QwRegressionSubsystem.h index 2d43e6e67..b6a33c867 100755 --- a/Parity/include/QwRegressionSubsystem.h +++ b/Parity/include/QwRegressionSubsystem.h @@ -114,8 +114,8 @@ class QwRegressionSubsystem: public VQwSubsystemParity, element->second->ClearEventData(); } }; - Int_t ProcessConfigurationBuffer(UInt_t, UInt_t, UInt_t*, UInt_t); - Int_t ProcessEvBuffer(UInt_t, UInt_t, UInt_t*, UInt_t); + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); void ProcessEvent(){}; Bool_t ApplySingleEventCuts(); diff --git a/Parity/include/QwScaler.h b/Parity/include/QwScaler.h index 6bb1daaff..5051a7380 100755 --- a/Parity/include/QwScaler.h +++ b/Parity/include/QwScaler.h @@ -51,8 +51,8 @@ class QwScaler: public VQwSubsystemParity, public MQwSubsystemCloneable &buffer) } //*****************************************************************// -Int_t QwBeamLine::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwBeamLine::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { Bool_t lkDEBUG=kFALSE; @@ -1596,7 +1596,7 @@ void QwBeamLine::ProcessEvent() //*****************************************************************// -Int_t QwBeamLine::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwBeamLine::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { return 0; diff --git a/Parity/src/QwComptonElectronDetector.cc b/Parity/src/QwComptonElectronDetector.cc index f111895d4..249e3f5cc 100755 --- a/Parity/src/QwComptonElectronDetector.cc +++ b/Parity/src/QwComptonElectronDetector.cc @@ -220,7 +220,7 @@ Int_t QwComptonElectronDetector::LoadInputParameters(TString pedestalfile) * @return Number of words read */ //***************************************************************** -Int_t QwComptonElectronDetector::ProcessEvBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwComptonElectronDetector::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { const Int_t numberofWordPerEv = 5; UInt_t words_read = 0; @@ -425,7 +425,7 @@ void QwComptonElectronDetector::ProcessEvent() * @return Number of words read */ //***************************************************************** -Int_t QwComptonElectronDetector::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwComptonElectronDetector::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { // sub-bank 0x207 & 0x208, eDAQinfo for this slave board for all planes and strips ///the total number of words in these subbanks was fixed at 8, though the meaning carried by a word has diff --git a/Parity/src/QwHelicity.cc b/Parity/src/QwHelicity.cc index 33d62cf11..70082c3fd 100755 --- a/Parity/src/QwHelicity.cc +++ b/Parity/src/QwHelicity.cc @@ -383,7 +383,7 @@ void QwHelicity::ClearEventData() return; } -Int_t QwHelicity::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwHelicity::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { //stub function // QwError << " this function QwHelicity::ProcessConfigurationBuffer does nothing yet " << QwLog::endl; @@ -1018,7 +1018,7 @@ Int_t QwHelicity::LoadEventCuts(TString filename){ return 0; } -Int_t QwHelicity::ProcessEvBuffer(UInt_t event_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwHelicity::ProcessEvBuffer(UInt_t event_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { Bool_t lkDEBUG = kFALSE; diff --git a/Parity/src/QwLumi.cc b/Parity/src/QwLumi.cc index 36a61b443..ae0c28894 100755 --- a/Parity/src/QwLumi.cc +++ b/Parity/src/QwLumi.cc @@ -541,7 +541,7 @@ void QwLumi::EncodeEventData(std::vector &buffer) } //***************************************************************** -Int_t QwLumi::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwLumi::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { Bool_t lkDEBUG=kFALSE; Bool_t firsttime=kTRUE; @@ -785,7 +785,7 @@ Bool_t QwLumi::PublishByRequest(TString device_name) } //***************************************************************** -Int_t QwLumi::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwLumi::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { return 0; } diff --git a/Parity/src/QwMainCerenkovDetector.cc b/Parity/src/QwMainCerenkovDetector.cc index b015f128b..c2187728a 100755 --- a/Parity/src/QwMainCerenkovDetector.cc +++ b/Parity/src/QwMainCerenkovDetector.cc @@ -659,7 +659,7 @@ void QwMainCerenkovDetector::EncodeEventData(std::vector &buffer) -Int_t QwMainCerenkovDetector::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwMainCerenkovDetector::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { /* Int_t index = GetSubbankIndex(roc_id,bank_id); @@ -675,7 +675,7 @@ Int_t QwMainCerenkovDetector::ProcessConfigurationBuffer(const UInt_t roc_id, co } -Int_t QwMainCerenkovDetector::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwMainCerenkovDetector::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { Bool_t lkDEBUG=kFALSE; diff --git a/Parity/src/QwMollerDetector.cc b/Parity/src/QwMollerDetector.cc index bd2e9234c..c33a0367b 100755 --- a/Parity/src/QwMollerDetector.cc +++ b/Parity/src/QwMollerDetector.cc @@ -137,21 +137,22 @@ Int_t QwMollerDetector::LoadInputParameters(TString){ return 0;} void QwMollerDetector::ClearEventData(){} -Int_t QwMollerDetector::ProcessConfigurationBuffer(UInt_t, UInt_t, UInt_t*, UInt_t){ +Int_t QwMollerDetector::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) +{ return 0; } -Int_t QwMollerDetector::ProcessConfigurationBuffer(UInt_t ev_type, UInt_t, UInt_t, UInt_t*, UInt_t) +Int_t QwMollerDetector::ProcessConfigurationBuffer(UInt_t ev_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { return 0; } -Int_t QwMollerDetector::ProcessEvBuffer(UInt_t ev_type, UInt_t roc_id, UInt_t bank_id, UInt_t *buffer, UInt_t num_words) +Int_t QwMollerDetector::ProcessEvBuffer(UInt_t ev_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) { return ProcessEvBuffer(roc_id, bank_id, buffer, num_words); } -Int_t QwMollerDetector::ProcessEvBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t *buffer, UInt_t num_words) +Int_t QwMollerDetector::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) { Int_t index = 0; // GetSubbankIndex(roc_id, bank_id); diff --git a/Parity/src/QwRegressionSubsystem.cc b/Parity/src/QwRegressionSubsystem.cc index a847dab63..2fbfff24b 100755 --- a/Parity/src/QwRegressionSubsystem.cc +++ b/Parity/src/QwRegressionSubsystem.cc @@ -228,14 +228,14 @@ Int_t QwRegressionSubsystem::LoadEventCuts(TString) } -Int_t QwRegressionSubsystem::ProcessConfigurationBuffer(UInt_t, UInt_t, UInt_t*, UInt_t) +Int_t QwRegressionSubsystem::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { Int_t sample = 0; return sample; } -Int_t QwRegressionSubsystem::ProcessEvBuffer(UInt_t, UInt_t, UInt_t*, UInt_t) +Int_t QwRegressionSubsystem::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { Int_t sample = 0; return sample; diff --git a/Parity/src/QwScaler.cc b/Parity/src/QwScaler.cc index f0bf67af1..0160be357 100755 --- a/Parity/src/QwScaler.cc +++ b/Parity/src/QwScaler.cc @@ -275,7 +275,7 @@ void QwScaler::ClearEventData() * @param num_words Number of words left in buffer * @return Number of words read */ -Int_t QwScaler::ProcessConfigurationBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwScaler::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { return 0; } @@ -288,7 +288,7 @@ Int_t QwScaler::ProcessConfigurationBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t * @param num_words Number of words left in buffer * @return Number of words read */ -Int_t QwScaler::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwScaler::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) { // TODO fix :-) From 7338d92241cec64e417e5bbed0a14242cf0d6170 Mon Sep 17 00:00:00 2001 From: Paul King Date: Wed, 18 Jul 2018 13:32:39 -0400 Subject: [PATCH 2/6] The channel map files for a subsystem can now include "marker words" to look for in the data stream. A marker word will indicate the beginning of portion of the datastream within the current bank, and will be treated internally as if that portion of the datastream is a sub-bank. A sub-bank can contain marker words, if desired. A set of parameter files which are (nearly) appropriate to the PREX injector data stream are included. The VQWK channel map is probably not correct, as the module ordering was just carried forward from the final Qweak injector channel map. --- Analysis/include/QwEventBuffer.h | 23 +- Analysis/include/QwSubsystemArray.h | 3 + Analysis/include/VQwSubsystem.h | 25 +- Analysis/src/QwEventBuffer.cc | 184 ++++++--- Analysis/src/QwSubsystemArray.cc | 16 + Analysis/src/VQwSubsystem.cc | 42 +++ Parity/prminput/prexinj.conf | 20 + Parity/prminput/prexinj_beamline.map | 147 ++++++++ .../prminput/prexinj_beamline_eventcuts.map | 100 +++++ Parity/prminput/prexinj_beamline_geometry.map | 58 +++ Parity/prminput/prexinj_beamline_pedestal.map | 142 +++++++ Parity/prminput/prexinj_detectors.map | 12 + Parity/prminput/prexinj_helicity.map | 83 +++++ Parity/src/MollerMainDetector.cc | 43 +-- Parity/src/QwBeamLine.cc | 14 +- Parity/src/QwHelicity.cc | 349 ++++++++---------- Parity/src/QwLumi.cc | 46 +-- Parity/src/QwMainCerenkovDetector.cc | 13 +- Parity/src/QwMollerDetector.cc | 13 +- Parity/src/QwScaler.cc | 23 +- 20 files changed, 1010 insertions(+), 346 deletions(-) create mode 100644 Parity/prminput/prexinj.conf create mode 100644 Parity/prminput/prexinj_beamline.map create mode 100644 Parity/prminput/prexinj_beamline_eventcuts.map create mode 100644 Parity/prminput/prexinj_beamline_geometry.map create mode 100644 Parity/prminput/prexinj_beamline_pedestal.map create mode 100644 Parity/prminput/prexinj_detectors.map create mode 100644 Parity/prminput/prexinj_helicity.map diff --git a/Analysis/include/QwEventBuffer.h b/Analysis/include/QwEventBuffer.h index 31b2ea055..bc6fc0389 100755 --- a/Analysis/include/QwEventBuffer.h +++ b/Analysis/include/QwEventBuffer.h @@ -20,6 +20,8 @@ #include "MQwCodaControlEvent.h" #include "QwParameterFile.h" +#include + class QwOptions; class QwEPICSEvent; class VQwSubsystem; @@ -207,9 +209,9 @@ class QwEventBuffer: public MQwCodaControlEvent{ const TString& DataFile(const UInt_t run, const Short_t seg); - void SetEventLength(const ULong_t tmplength) {fEvtLength = tmplength;}; - void SetEventType(const UInt_t tmptype) {fEvtType = tmptype;}; - void SetWordsSoFar(const ULong_t tmpwords) {fWordsSoFar = tmpwords;}; + // void SetEventLength(const ULong_t tmplength) {fEvtLength = tmplength;}; + // void SetEventType(const UInt_t tmptype) {fEvtType = tmptype;}; + // void SetWordsSoFar(const ULong_t tmpwords) {fWordsSoFar = tmpwords;}; @@ -245,14 +247,25 @@ class QwEventBuffer: public MQwCodaControlEvent{ Double_t fCleanParameter[3]; ///< Scan data/clean data from the green monster UInt_t fFragLength; - UInt_t fSubbankTag; + BankID_t fSubbankTag; UInt_t fSubbankType; UInt_t fSubbankNum; - UInt_t fROC; + ROCID_t fROC; TStopwatch fRunTimer; ///< Timer used for runlet processing loop TStopwatch fStopwatch; ///< Timer used for internal timing + protected: + /// Methods and data members needed to find marker words + typedef ULong64_t RocBankLabel_t; + std::unordered_map > fMarkerList; + std::unordered_map > fOffsetList; + + Int_t CheckForMarkerWords(QwSubsystemArray &subsystems); + RocBankLabel_t fThisRocBankLabel; + UInt_t FindMarkerWord(UInt_t markerID, UInt_t* buffer, UInt_t num_words); + UInt_t GetMarkerWord(UInt_t markerID); + protected: UInt_t fNumPhysicsEvents; UInt_t fStartingPhysicsEvent; diff --git a/Analysis/include/QwSubsystemArray.h b/Analysis/include/QwSubsystemArray.h index ffdef54ef..439597161 100755 --- a/Analysis/include/QwSubsystemArray.h +++ b/Analysis/include/QwSubsystemArray.h @@ -259,6 +259,9 @@ class QwSubsystemArray: public std::vector > { protected: void LoadSubsystemsFromParameterFile(QwParameterFile& detectors); + public: + void GetMarkerWordList(const ROCID_t roc_id, const BankID_t bank_id, std::vector& marker) const; + protected: size_t fTreeArrayIndex; //! Index of this data element in root tree diff --git a/Analysis/include/VQwSubsystem.h b/Analysis/include/VQwSubsystem.h index 28ef70c38..c25895dc2 100755 --- a/Analysis/include/VQwSubsystem.h +++ b/Analysis/include/VQwSubsystem.h @@ -72,7 +72,8 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { : MQwHistograms(orig), fPublishList(orig.fPublishList), fROC_IDs(orig.fROC_IDs), - fBank_IDs(orig.fBank_IDs) + fBank_IDs(orig.fBank_IDs), + fMarkerWords(orig.fMarkerWords) { fSystemName = orig.fSystemName; fIsDataLoaded = orig.fIsDataLoaded; @@ -298,12 +299,25 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { */ Int_t RegisterSubbank(const BankID_t bank_id); + Int_t RegisterMarkerWord(const UInt_t markerword); + + void RegisterRocBankMarker(QwParameterFile &mapstr); + Int_t GetSubbankIndex() const { return GetSubbankIndex(fCurrentROC_ID, fCurrentBank_ID); } Int_t GetSubbankIndex(const ROCID_t roc_id, const BankID_t bank_id) const; void SetDataLoaded(Bool_t flag){fIsDataLoaded = flag;}; - - + public: + void GetMarkerWordList(const ROCID_t roc_id, const BankID_t bank_id, std::vector &marker)const{ + Int_t rocindex = FindIndex(fROC_IDs, roc_id); + if (rocindex>=0){ + Int_t bankindex = FindIndex(fBank_IDs[rocindex],bank_id); + if (bankindex>=0 && fMarkerWords.at(rocindex).at(bankindex).size()>0){ + std::vector m = fMarkerWords.at(rocindex).at(bankindex); + marker.insert(marker.end(), m.begin(), m.end()); + } + } + } protected: template < class T > @@ -332,12 +346,15 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { protected: ROCID_t fCurrentROC_ID; ///< ROC ID that is currently being processed - BankID_t fCurrentBank_ID; ///< Bank ID that is currently being processed + BankID_t fCurrentBank_ID; ///< Bank ID (and Marker word) that is currently being processed; /// Vector of ROC IDs associated with this subsystem std::vector fROC_IDs; /// Vector of Bank IDs per ROC ID associated with this subsystem std::vector< std::vector > fBank_IDs; + /// Vector of marker words per ROC & subbank associated with this subsystem + std::vector< std::vector< std::vector > > fMarkerWords; + /// Vector of pointers to subsystem arrays that contain this subsystem std::vector fArrays; diff --git a/Analysis/src/QwEventBuffer.cc b/Analysis/src/QwEventBuffer.cc index 3e1fe0726..8a446a685 100755 --- a/Analysis/src/QwEventBuffer.cc +++ b/Analysis/src/QwEventBuffer.cc @@ -587,13 +587,21 @@ void QwEventBuffer::DecodeEventIDBank(UInt_t *buffer) fPhysicsEventFlag = kFALSE; + QwDebug << "QwEventBuffer::DecodeEventIDBank: " << std::hex + << buffer[0] << " " + << buffer[1] << " " + << buffer[2] << " " + << buffer[3] << " " + << buffer[4] << std::dec << " " + << QwLog::endl; + if ( buffer[0] == 0 ){ /***************************************************************** * This buffer is empty. * *****************************************************************/ - SetEventLength(1); // Pretend that there is one word. - SetWordsSoFar(1); // Mark that we've read the word already. - SetEventType(0); + fEvtLength = (1); // Pretend that there is one word. + fWordsSoFar = (1); // Mark that we've read the word already. + fEvtType = (0); fEvtTag = 0; fBankDataType = 0; fIDBankNum = 0; @@ -605,7 +613,7 @@ void QwEventBuffer::DecodeEventIDBank(UInt_t *buffer) * This buffer contains data; fill the event ID parameters. * *****************************************************************/ // First word is the number of long-words in the buffer. - SetEventLength(buffer[0]+1); + fEvtLength = (buffer[0]+1); // Second word contains the event type, for CODA events. fEvtTag = (buffer[1] & 0xFFFF0000) >> 16; // (bits(31-16)); @@ -615,7 +623,7 @@ void QwEventBuffer::DecodeEventIDBank(UInt_t *buffer) // This is a CODA event bank; the event type is equal to // the event tag. local_eventtype = fEvtTag; - SetEventType(local_eventtype); + fEvtType = (local_eventtype); fBankDataType = local_datatype; // local_eventtype is unsigned int and always positive @@ -627,14 +635,14 @@ void QwEventBuffer::DecodeEventIDBank(UInt_t *buffer) fStatSum = buffer[6]; fPhysicsEventFlag = kTRUE; // Now skip to the first ROC data bank. - SetWordsSoFar(7); + fWordsSoFar = (7); } else { // This is not a physics event, but is still in the CODA // event format. The first two words have been examined. fEvtNumber = 0; fEvtClass = 0; fStatSum = 0; - SetWordsSoFar(2); + fWordsSoFar = (2); // Run this event through the Control event processing. // If it is not a control event, nothing will happen. ProcessControlEvent(fEvtType, &buffer[fWordsSoFar]); @@ -644,20 +652,26 @@ void QwEventBuffer::DecodeEventIDBank(UInt_t *buffer) // but it still follows the CEBAF common event format. // Arbitrarily set the event type to "fEvtTag". // The first two words have been examined. - SetEventType(fEvtTag); + fEvtType = (fEvtTag); + fBankDataType = local_datatype; fEvtNumber = 0; fEvtClass = 0; fStatSum = 0; - SetWordsSoFar(2); + fWordsSoFar = (2); } } - // std::cout<< Form("Length: %d; Tag: 0x%x; Bank ID num: 0x%x; ", - // fEvtLength, fEvtTag, fIDBankNum) - // << Form("Evt type: 0x%x; Evt number %d; Evt Class 0x%.8x; ", - // fEvtType, fEvtNumber, fEvtClass) - // << Form("Status Summary: 0x%.8x; Words so far %d", - // fStatSum, fWordsSoFar) - // << std::endl; + // Initialize the fragment size to the event size, in case the + // event is not subbanked. + fFragLength = fEvtLength-fWordsSoFar; + QwDebug << Form("buffer[0-1] 0x%x 0x%x ; ", + buffer[0], buffer[1]) + << Form("Length: %d; Tag: 0x%x; Bank data type: 0x%x; Bank ID num: 0x%x; ", + fEvtLength, fEvtTag, fBankDataType, fIDBankNum) + << Form("Evt type: 0x%x; Evt number %d; Evt Class 0x%.8x; ", + fEvtType, fEvtNumber, fEvtClass) + << Form("Status Summary: 0x%.8x; Words so far %d", + fStatSum, fWordsSoFar) + << QwLog::endl; } @@ -675,11 +689,14 @@ Bool_t QwEventBuffer::FillSubsystemConfigurationData(QwSubsystemArray &subsystem << "Found configuration event for ROC" << rocnum << QwLog::endl; - QwMessage << Form("Evt type: 0x%x; Evt number %d; Evt Class 0x%.8x; ", - fEvtType, fEvtNumber, fEvtClass) + QwMessage << Form("Length: %d; Tag: 0x%x; Bank data type: 0x%x; Bank ID num: 0x%x; ", + fEvtLength, fEvtTag, fBankDataType, fIDBankNum) + << Form("Evt type: 0x%x; Evt number %d; Evt Class 0x%.8x; ", + fEvtType, fEvtNumber, fEvtClass) << QwLog::endl; // Loop through the data buffer in this event. UInt_t *localbuff = (UInt_t*)(fEvStream->getEvBuffer()); + DecodeEventIDBank(localbuff); while ((okay = DecodeSubbankHeader(&localbuff[fWordsSoFar]))){ // If this bank has further subbanks, restart the loop. if (fSubbankType == 0x10) { @@ -710,6 +727,7 @@ Bool_t QwEventBuffer::FillSubsystemConfigurationData(QwSubsystemArray &subsystem << "Ending loop: fWordsSoFar=="<0) { + // There are markerwords for this ROC/Bank + for (size_t i=0; igetEvBuffer()); if (fBankDataType==0x10){ while ((okay = DecodeSubbankHeader(&localbuff[fWordsSoFar]))){ - // If this bank has further subbanks, restart the loop. - if (fSubbankType == 0x10) continue; - // If this bank only contains the word 'NULL' then skip - // this bank. - if (fFragLength==1 && localbuff[fWordsSoFar]==kNullDataWord){ - fWordsSoFar += fFragLength; - continue; - } - - if (fSubbankType == 0x3){ - // This is an ASCII string bank. Try to decode it and - // pass it to the EPICS class. - char* tmpchar = (Char_t*)&localbuff[fWordsSoFar]; - - epics.ExtractEPICSValues(string(tmpchar), GetEventNumber()); - QwVerbose << "test for GetEventNumber =" << GetEventNumber() << QwLog::endl;// always zero, wrong. + // If this bank has further subbanks, restart the loop. + if (fSubbankType == 0x10) continue; + // If this bank only contains the word 'NULL' then skip + // this bank. + if (fFragLength==1 && localbuff[fWordsSoFar]==kNullDataWord){ + fWordsSoFar += fFragLength; + continue; + } - } + if (fSubbankType == 0x3){ + // This is an ASCII string bank. Try to decode it and + // pass it to the EPICS class. + char* tmpchar = (Char_t*)&localbuff[fWordsSoFar]; + + epics.ExtractEPICSValues(string(tmpchar), GetEventNumber()); + QwVerbose << "test for GetEventNumber =" << GetEventNumber() << QwLog::endl;// always zero, wrong. + + } - fWordsSoFar += fFragLength; + fWordsSoFar += fFragLength; // QwDebug << "QwEventBuffer::FillEPICSData: " // << "Ending loop: fWordsSoFar=="<= fEvtLength){ // We have reached the end of this event. okay = kFALSE; - } else { + } else if (fBankDataType == 0x10) { + // This bank has subbanks, so decode the subbank header. fFragLength = buffer[0] - 1; // This is the number of words in the data block fSubbankTag = (buffer[1]&0xFFFF0000)>>16; // Bits 16-31 fSubbankType = (buffer[1]&0xFF00)>>8; // Bits 8-15 @@ -903,6 +941,16 @@ Bool_t QwEventBuffer::DecodeSubbankHeader(UInt_t *buffer){ } fWordsSoFar += 2; } + QwDebug << "QwEventBuffer::DecodeSubbankHeader: " << std::hex + << buffer[0] << " " + << buffer[1] << " " + << buffer[2] << " " + << buffer[3] << " " + << buffer[4] << std::dec << " " + << fWordsSoFar << " "<< fEvtLength + << QwLog::endl; + // There is no final else, because any bank type other than + // 0x10 should just return okay. return okay; } @@ -1196,3 +1244,47 @@ Int_t QwEventBuffer::CloseETStream() } return status; } + +//------------------------------------------------------------ +Int_t QwEventBuffer::CheckForMarkerWords(QwSubsystemArray &subsystems) +{ + QwDebug << "QwEventBuffer::GetMarkerWordList: start function" < tmpvec; + subsystems.GetMarkerWordList(fROC, fSubbankTag, tmpvec); + fMarkerList.emplace(fThisRocBankLabel, tmpvec); + fOffsetList.emplace(fThisRocBankLabel, std::vector(tmpvec.size(),0)); + } + QwDebug << "QwEventBuffer::GetMarkerWordList: fMarkerList.count(fThisRocBankLabel)==" + << fMarkerList.count(fThisRocBankLabel) + << " fMarkerList.at(fThisRocBankLabel).size()==" + << fMarkerList.at(fThisRocBankLabel).size() + << QwLog::endl; + return fMarkerList.at(fThisRocBankLabel).size(); +} + +UInt_t QwEventBuffer::GetMarkerWord(UInt_t markerID){ + return fMarkerList.at(fThisRocBankLabel).at(markerID); +}; + + +UInt_t QwEventBuffer::FindMarkerWord(UInt_t markerindex, UInt_t* buffer, UInt_t num_words){ + UInt_t markerpos = fOffsetList.at(fThisRocBankLabel).at(markerindex); + UInt_t markerval = fMarkerList.at(fThisRocBankLabel).at(markerindex); + if (markerpos < num_words && buffer[markerpos] == markerval){ + // The marker word is where it was last time + return markerpos; + } else { + for (size_t i=0; i& marker) const +{ + if (!empty()){ + for (const_iterator subsys = begin(); subsys != end(); ++subsys) { + (*subsys)->GetMarkerWordList(roc_id, bank_id, marker); + } + } +} + + Int_t QwSubsystemArray::ProcessEvBuffer( const UInt_t event_type, const ROCID_t roc_id, diff --git a/Analysis/src/VQwSubsystem.cc b/Analysis/src/VQwSubsystem.cc index e05baae6b..1cf1a76a6 100755 --- a/Analysis/src/VQwSubsystem.cc +++ b/Analysis/src/VQwSubsystem.cc @@ -277,10 +277,13 @@ Int_t VQwSubsystem::RegisterROCNumber(const ROCID_t roc_id, const BankID_t bank_ roc_index = (fROC_IDs.size() - 1); std::vector tmpvec(1,bank_id); fBank_IDs.push_back(tmpvec); + fMarkerWords.resize(fROC_IDs.size()); + fMarkerWords.at(roc_index).resize(1); } else { Int_t bank_index = FindIndex(fBank_IDs[roc_index],bank_id); if (bank_index==-1) { // if the bank_id is not registered then register it. fBank_IDs[roc_index].push_back(bank_id); + fMarkerWords.at(roc_index).resize(fBank_IDs.at(roc_index).size()); } else { // This subbank in this ROC has already been registered! QwError << std::hex << "VQwSubsystem::RegisterROCNumber: " @@ -321,6 +324,45 @@ Int_t VQwSubsystem::RegisterSubbank(const BankID_t bank_id) return stat; } + +Int_t VQwSubsystem::RegisterMarkerWord(const UInt_t markerword) +{ + static BankID_t bankIDmask = 0xffffffff; + Int_t stat = 0; + if (fCurrentROC_ID != -1){ + Int_t roc_index = FindIndex(fROC_IDs, fCurrentROC_ID); + Int_t bank_index = FindIndex(fBank_IDs[roc_index],(fCurrentBank_ID&bankIDmask)); + fMarkerWords.at(roc_index).at(bank_index).push_back(markerword); + BankID_t tmpbank = markerword; + tmpbank = (tmpbank)<<32 + (fCurrentBank_ID&bankIDmask); + RegisterSubbank(tmpbank); + } else { + // There is not a ROC registered yet! + QwError << std::hex << "VQwSubsystem::RegisterSubbank: " + << "This Marker word (" << markerword << ") " + << "does not have an associated ROC! " + << "Add a 'ROC=#' line to the map file." + << std::dec << QwLog::endl; + stat = ERROR; + fCurrentROC_ID = -1; + fCurrentBank_ID = -1; + } + return stat; +} + +void VQwSubsystem::RegisterRocBankMarker(QwParameterFile &mapstr){ + UInt_t value = 0; + if (mapstr.PopValue("roc",value)) { + RegisterROCNumber(value,0); + } + if (mapstr.PopValue("bank",value)) { + RegisterSubbank(value); + } + if (mapstr.PopValue("markerword",value)) { + RegisterMarkerWord(value); + } +} + void VQwSubsystem::PrintInfo() const { std::cout << "Name of this subsystem: " << fSystemName << std::endl; diff --git a/Parity/prminput/prexinj.conf b/Parity/prminput/prexinj.conf new file mode 100644 index 000000000..a13cd255d --- /dev/null +++ b/Parity/prminput/prexinj.conf @@ -0,0 +1,20 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +detectors = prexinj_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexinj_ +codafile-stem = parity18_injector_ +codafile-ext = dat + +ring.size = 200 +ring.stability_cut = -1 \ No newline at end of file diff --git a/Parity/prminput/prexinj_beamline.map b/Parity/prminput/prexinj_beamline.map new file mode 100644 index 000000000..29368e3bf --- /dev/null +++ b/Parity/prminput/prexinj_beamline.map @@ -0,0 +1,147 @@ + +ROC=24 +MarkerWord=0xff902902 +!!!Bank=0x3102 +!same sample size for ADCs in a given bank +sample_size=464 +! +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + + +!ADC0 +! VQWK, 0, 0, bpmstripline, QWK_0I01XP +! VQWK, 0, 1, bpmstripline, QWK_0I01XM +! VQWK, 0, 2, bpmstripline, QWK_0I01YP +! VQWK, 0, 3, bpmstripline, QWK_0I01YM +! VQWK, 0, 4, bpmstripline, QWK_0I01AXP +! VQWK, 0, 5, bpmstripline, QWK_0I01AXM +! VQWK, 0, 6, bpmstripline, QWK_0I01AYP +! VQWK, 0, 7, bpmstripline, QWK_0I01AYM + +!ADC11 + VQWK, 0, 0, bpmstripline, QWK_0R06XP + VQWK, 0, 1, bpmstripline, QWK_0R06XM + VQWK, 0, 2, bpmstripline, QWK_0R06YP + VQWK, 0, 3, bpmstripline, QWK_0R06YM + VQWK, 0, 4, bcm, QWK_BCM0L02 + VQWK, 0, 5, bcm, QWK_Batery6 + VQWK, 0, 6, bcm, QWK_Batery7 + VQWK, 0, 7, bcm, PhaseMonitor + + +!ADC1 + VQWK, 1, 0, bpmstripline, QWK_1I02XP, UNROTATED + VQWK, 1, 1, bpmstripline, QWK_1I02XM, UNROTATED + VQWK, 1, 2, bpmstripline, QWK_1I02YP, UNROTATED + VQWK, 1, 3, bpmstripline, QWK_1I02YM, UNROTATED + VQWK, 1, 4, bpmstripline, QWK_1I04XP, UNROTATED + VQWK, 1, 5, bpmstripline, QWK_1I04XM, UNROTATED + VQWK, 1, 6, bpmstripline, QWK_1I04YP, UNROTATED + VQWK, 1, 7, bpmstripline, QWK_1I04YM, UNROTATED + + +!ADC2 + VQWK, 2, 0, bpmstripline, QWK_1I06XP, UNROTATED + VQWK, 2, 1, bpmstripline, QWK_1I06XM, UNROTATED + VQWK, 2, 2, bpmstripline, QWK_1I06YP, UNROTATED + VQWK, 2, 3, bpmstripline, QWK_1I06YM, UNROTATED + VQWK, 2, 4, bpmstripline, QWK_0I02XP, UNROTATED + VQWK, 2, 5, bpmstripline, QWK_0I02XM, UNROTATED + VQWK, 2, 6, bpmstripline, QWK_0I02YP, UNROTATED + VQWK, 2, 7, bpmstripline, QWK_0I02YM, UNROTATED + +!ADC3 + VQWK, 3, 0, bpmstripline, QWK_0I02AXP, UNROTATED + VQWK, 3, 1, bpmstripline, QWK_0I02AXM, UNROTATED + VQWK, 3, 2, bpmstripline, QWK_0I02AYP, UNROTATED + VQWK, 3, 3, bpmstripline, QWK_0I02AYM, UNROTATED + VQWK, 3, 4, bpmstripline, QWK_0I05XP, UNROTATED + VQWK, 3, 5, bpmstripline, QWK_0I05XM, UNROTATED + VQWK, 3, 6, bpmstripline, QWK_0I05YP, UNROTATED + VQWK, 3, 7, bpmstripline, QWK_0I05YM, UNROTATED + +!ADC4 + VQWK, 4, 0, bpmstripline, QWK_0I07XP, UNROTATED + VQWK, 4, 1, bpmstripline, QWK_0I07XM, UNROTATED + VQWK, 4, 2, bpmstripline, QWK_0I07YP, UNROTATED + VQWK, 4, 3, bpmstripline, QWK_0I07YM, UNROTATED + VQWK, 4, 4, bpmstripline, QWK_0L01XP + VQWK, 4, 5, bpmstripline, QWK_0L01XM + VQWK, 4, 6, bpmstripline, QWK_0L01YP + VQWK, 4, 7, bpmstripline, QWK_0L01YM + + +!ADC5 + VQWK, 5, 0, bpmstripline, QWK_0L02XP + VQWK, 5, 1, bpmstripline, QWK_0L02XM + VQWK, 5, 2, bpmstripline, QWK_0L02YP + VQWK, 5, 3, bpmstripline, QWK_0L02YM + VQWK, 5, 4, bpmstripline, QWK_0L03XP + VQWK, 5, 5, bpmstripline, QWK_0L03XM + VQWK, 5, 6, bpmstripline, QWK_0L03YP + VQWK, 5, 7, bpmstripline, QWK_0L03YM + +!ADC6 + VQWK, 6, 0, bpmstripline, QWK_0L04XP + VQWK, 6, 1, bpmstripline, QWK_0L04XM + VQWK, 6, 2, bpmstripline, QWK_0L04YP + VQWK, 6, 3, bpmstripline, QWK_0L04YM + VQWK, 6, 4, bpmstripline, QWK_0L05XP + VQWK, 6, 5, bpmstripline, QWK_0L05XM + VQWK, 6, 6, bpmstripline, QWK_0L05YP + VQWK, 6, 7, bpmstripline, QWK_0L05YM + +!ADC7 + VQWK, 7, 0, bpmstripline, QWK_0L06XP + VQWK, 7, 1, bpmstripline, QWK_0L06XM + VQWK, 7, 2, bpmstripline, QWK_0L06YP + VQWK, 7, 3, bpmstripline, QWK_0L06YM + VQWK, 7, 4, bpmstripline, QWK_0L07XP + VQWK, 7, 5, bpmstripline, QWK_0L07XM + VQWK, 7, 6, bpmstripline, QWK_0L07YP + VQWK, 7, 7, bpmstripline, QWK_0L07YM + +!ADC8 + VQWK, 8, 0, bpmstripline, QWK_0L08XP + VQWK, 8, 1, bpmstripline, QWK_0L08XM + VQWK, 8, 2, bpmstripline, QWK_0L08YP + VQWK, 8, 3, bpmstripline, QWK_0L08YM + VQWK, 8, 4, bpmstripline, QWK_0L09XP + VQWK, 8, 5, bpmstripline, QWK_0L09XM + VQWK, 8, 6, bpmstripline, QWK_0L09YP + VQWK, 8, 7, bpmstripline, QWK_0L09YM + +!ADC9 + VQWK, 9, 0, bpmstripline, QWK_0L10XP + VQWK, 9, 1, bpmstripline, QWK_0L10XM + VQWK, 9, 2, bpmstripline, QWK_0L10YP + VQWK, 9, 3, bpmstripline, QWK_0L10YM + VQWK, 9, 4, bpmstripline, QWK_0R03XP + VQWK, 9, 5, bpmstripline, QWK_0R03XM + VQWK, 9, 6, bpmstripline, QWK_0R03YP + VQWK, 9, 7, bpmstripline, QWK_0R03YM + +!ADC10 + VQWK, 10, 0, bpmstripline, QWK_0R04XP + VQWK, 10, 1, bpmstripline, QWK_0R04XM + VQWK, 10, 2, bpmstripline, QWK_0R04YP + VQWK, 10, 3, bpmstripline, QWK_0R04YM + VQWK, 10, 4, bpmstripline, QWK_0R05XP + VQWK, 10, 5, bpmstripline, QWK_0R05XM + VQWK, 10, 6, bpmstripline, QWK_0R05YP + VQWK, 10, 7, bpmstripline, QWK_0R05YM + +!ADC11 +! VQWK, 11, 0, bpmstripline, QWK_0R06XP +! VQWK, 11, 1, bpmstripline, QWK_0R06XM +! VQWK, 11, 2, bpmstripline, QWK_0R06YP +! VQWK, 11, 3, bpmstripline, QWK_0R06YM +! VQWK, 11, 4, bcm, QWK_BCM0L02 +! VQWK, 11, 5, bcm, QWK_Batery6 +! VQWK, 11, 6, bcm, QWK_Batery7 +! VQWK, 11, 7, bcm, PhaseMonitor + + +[PUBLISH] + q_targ, bcm, qwk_bcm0l02, c diff --git a/Parity/prminput/prexinj_beamline_eventcuts.map b/Parity/prminput/prexinj_beamline_eventcuts.map new file mode 100644 index 000000000..b92e41436 --- /dev/null +++ b/Parity/prminput/prexinj_beamline_eventcuts.map @@ -0,0 +1,100 @@ + +!This file contains beamline event cut properties last updated 10/27/2009 based on run 752/755 + +!********************************************************************************************* +!Global switch to turn ON and OFF eventcut check +!Available settings +!*************************************************** +!To turn OFF all checks +! EVENTCUTS = 0 + +!*************************************************** +!To turn OFF event cuts and perform only HW checks +!EVENTCUTS = 1 + +!*************************************************** +!To turn ON both event cuts and HW checks +! EVENTCUTS = 2 + +!*************************************************** +!To turn do both event cuts and HW checks and only flag event cut failed events +EVENTCUTS = 3 + +!IMPORTANT +!--------- +!Make sure when puting tabs in the map file entries, always put ", " before inserting a tab. +!Otherwise the routine QwParameterFile::GetNextToken(", ") will get confuse. + +!*************************************************** +!for bcm devices +!device_type, device_name, lower limit, upper limit, local(l)/global(g), stability percentage + +bcm, qwk_bcm0l02, 1, 1000000, l, 0 +!bcm, empty1, -2.420e+6, -2.390e+6 +!bcm, empty1, 0, 0, 1, 0 +!bcm, empty2, 0, 0, 1, 0 + +!bcm, qwk_batext1, 0, 0, 1, 0 + +!bcm, qwk_batext2, 0, 0, 1, 0 +!for 752 & 755 +!for parity mock data run 1000 9.98608e+06 +!bcm, qwk_bcm0l03, 8.00e+06, 1.20e+07, 1, 0 + + +!bcm, qwk_batery6, 0, 0, 1, 0 +!bcm, qwk_batery7, 95.57778e+9, 95.5788e+9, 1, 0 +!bcm, phasemonitor, 0, 0, 1, 0 + +!**************************************************** +!for bpmstrpline devices +!device_type, device_name, channel_name, lower limit, upper limit +!channel_name can be relx, rely, absx, absy, wsum, xp, xm, yp, ym +!Cuts are applied after the VQwSubsystem::ProcessEvent() routine. +!So pedestals are applied before appyling the cuts. + +!device_type, device_name, channel_name, lower limit, upper limit, local(l)/global(g), stability percentage + +!bpmstripline, qwk_qpd, relx, 2.67319, 4.45531 +!bpmstripline, qwk_qpd, rely, 1.31491, 2.19152 + +!bpmstripline, qwk_1i02, absx, 10, 100000, l, 0 +!bpmstripline, qwk_1i02, xp, 1, 3, l, 0 +!bpmstripline, qwk_1i02, yp, 10, 20, l, 0 +!bpmstripline, qwk_1i04, relx, 0, 0, l, 0 +!bpmstripline, qwk_1i06, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i02, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i02a, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i05, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i07, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l01, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l02, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l03, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l04, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l05, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l06, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l07, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l08, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l09, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l1, relx0, 0, 0, l, 0 +!bpmstripline, qwk_0r01, relx, 0, 0, l, 0 +!bpmstripline, qwk_0r02, relx, 0, 0, l, 0 +!bpmstripline, qwk_0r05, relx, 0, 0, l, 0 +!bpmstripline, qwk_0r06, relx, 0, 0, l, 0 + + + +!This file contains beamline event cut properties + +!IMPORTANT +!--------- +!Make sure when puting tabs in the map file entries, always put ", " before inserting a tab. +!Otherwise the routine QwParameterFile::GetNextToken(", ") will extract the entry with the tab character. + +!Comments +!-------- +!Devices that are not in the list are not subjected event cut checks +!All devices will be tested for HW checks. +! +!For device_type =bcm only upper and lower limit of the calibrated charge on the ADC HW sum. (QwVQWK_Channel::fHardwareBlockSum) + diff --git a/Parity/prminput/prexinj_beamline_geometry.map b/Parity/prminput/prexinj_beamline_geometry.map new file mode 100644 index 000000000..d8dfab85d --- /dev/null +++ b/Parity/prminput/prexinj_beamline_geometry.map @@ -0,0 +1,58 @@ +!************************************************************************** +! Geometry information for the BPMs in injector beamline. +!************************************************************************** +! +! X/Yoffset - The difference in the ideal position and the surveyed position of a BPM in X/Y axis. +! +! Z offset - The location of the BPM in the hallC beamline (alog Z axis) from the begining of the beamline +! to the center of the device/ origin of device coordinate system. +! +! BSEN scaling factor - Bpm SENsitivity scaling factor is the ratio of general BSEN = 18.81 adc counts/mm +! seen in most of the BPMs in the injector and the actual BSEN of a BPM. +! Almost all the BPMs in the injector beamline except 1I02,1I04,1I06,0I01,0I01A.0I02,0I02A,0I05,0I07 +! who has BSEN=13.7 adc counts/mm +! So we use this factor to apply such changes. +! +! AlphaX/Y - Relative gains of the individual XM,YM pairs compared to XP,YP pairs. +! +! The units of the offsets are in millemeters to be comparable with the units of the anaysis results. +! +! BSEN, ALPHAX and ALPHA Y were obtained from EPICS. +! +! For BPMs that don't have factors or offsets given in the list below, default values will +! be assigned. +! default offset (X/Y/Z) = 0.0 +! default BSEN scaling factor = 18.81 +! default AlphaX/AlphaY = 1.0 +! +! device type, device_name, Xoffset, Yoffset, Zoffset, BSEN scaling factor, AlpaX, AlpaY +! + + bpmstripline, QWK_1I02, 0.0, 0.0, 0.0, 0.734, 1.085410, 0.977843 + bpmstripline, QWK_1I04, 0.0, 0.0, 0.0, 0.734, 0.959589, 0.955868 + bpmstripline, QWK_1I06, 0.0, 0.0, 0.0, 0.734, 1.052820, 0.964797 + bpmstripline, QWK_0I01, 0.0, 0.0, 0.0, 0.734, 1.006630, 0.923753 + bpmstripline, QWK_0I01A, 0.0, 0.0, 0.0, 0.734, 1.053700, 1.032170 + bpmstripline, QWK_0I02, 0.0, 0.0, 0.0, 0.734, 0.985505, 0.900560 + bpmstripline, QWK_0I02A, 0.0, 0.0, 0.0, 0.734, 1.015710, 1.053130 + bpmstripline, QWK_0I05, 0.0, 0.0, 0.0, 0.734, 1.278300, 0.976040 + bpmstripline, QWK_0I07, 0.0, 0.0, 0.0, 0.734, 0.983711, 1.075580 + bpmstripline, QWK_0L01, 0.0, 0.0, 0.0, 1.0, 0.998108, 0.961697 + bpmstripline, QWK_0L02, 0.0, 0.0, 0.0, 1.0, 0.995747, 1.002760 + bpmstripline, QWK_0L03, 0.0, 0.0, 0.0, 1.0, 0.922851, 0.938417 + bpmstripline, QWK_0L04, 0.0, 0.0, 0.0, 1.0, 1.009110, 0.952050 + bpmstripline, QWK_0L05, 0.0, 0.0, 0.0, 1.0, 1.084810, 0.997621 + bpmstripline, QWK_0L06, 0.0, 0.0, 0.0, 1.0, 1.002530, 1.080990 + bpmstripline, QWK_0L07, 0.0, 0.0, 0.0, 1.0, 1.059450, 0.980722 + bpmstripline, QWK_0L08, 0.0, 0.0, 0.0, 1.0, 0.949430, 1.037000 + bpmstripline, QWK_0L09, 0.0, 0.0, 0.0, 1.0, 0.993488, 1.002960 + bpmstripline, QWK_0L10, 0.0, 0.0, 0.0, 1.0, 0.981602, 1.008690 + bpmstripline, QWK_0R01, 0.0, 0.0, 0.0, 1.0, 1.049370, 0.942922 + bpmstripline, QWK_0R02, 0.0, 0.0, 0.0, 1.0, 1.084550, 1.081500 + bpmstripline, QWK_0R03, 0.0, 0.0, 0.0, 1.0, 0.966298, 0.982757 + bpmstripline, QWK_0R04, 0.0, 0.0, 0.0, 1.0, 1.065620, 1.079380 + bpmstripline, QWK_0R05, 0.0, 0.0, 0.0, 1.0, 0.949244, 0.995147 + bpmstripline, QWK_0R06, 0.0, 0.0, 0.0, 1.0, 0.987571, 1.006590 + bpmstripline, QWK_0R07, 0.0, 0.0, 0.0, 1.0, 1.041250, 0.914155 + +!END diff --git a/Parity/prminput/prexinj_beamline_pedestal.map b/Parity/prminput/prexinj_beamline_pedestal.map new file mode 100644 index 000000000..e96b81d77 --- /dev/null +++ b/Parity/prminput/prexinj_beamline_pedestal.map @@ -0,0 +1,142 @@ +! Pedestal file of run 2205 +! adc sample size 468 +! curent range in calibration 90 to 155 +! fit is linear +! date of analysis =Tue Feb 22 19:02:59 2011 +! The pedestal run was taken with F2 cup inserted. +! Therefore only bpms up to 0i05 have the correct pedestals +! for this high current calibration. +C20AXM , 0 , 1 +C20AXP , 0 , 1 +C20AYP , 0 , 1 +C20AYM , 0 , 1 +H00_XP , 0 , 1 +H00_XM , 0 , 1 +H00_YP , 0 , 1 +H00_YM , 0 , 1 +BattDn , 0 , 1 +TermUp , 0 , 1 +SpareA , 0 , 1 +SpareB , 0 , 1 +AmpCh1 , 0 , 1 +AmpCh2 , 0 , 1 +SpareE , 0 , 1 +TermDn , 0 , 1 +SEBattDn , 0 , 1 +SETermUp , 0 , 1 +SESpareA , 0 , 1 +SESpareB , 0 , 1 +SEAmpCh1 , 0 , 1 +SEAmpCh2 , 0 , 1 +SESpareE , 0 , 1 +SETermDn , 0 , 1 +qwk_1i02XP , 1204.2 , 1. +qwk_1i02XM , 1558.9 , 1. +qwk_1i02YP , 1362.8 , 1. +qwk_1i02YM , 1646.9 , 1. +qwk_1i04XP , 2122.8 , 1. +qwk_1i04XM , 2005.0 , 1. +qwk_1i04YP , 2295.0 , 1. +qwk_1i04YM , 2076.7 , 1. +qwk_1i06XP , 2825.9 , 1. +qwk_1i06XM , 2324.1 , 1. +qwk_1i06YP , 1740.8 , 1. +qwk_1i06YM , 1715.8 , 1. +qwk_0i01XP , 2502.5 , 1. +qwk_0i01XM , 2844.5 , 1. +qwk_0i01YP , 2753.1 , 1. +qwk_0i01YM , 3063.6 , 1. +qwk_0i01aXP , -3923.0 , 1. +qwk_0i01aXM , -3831.3 , 1. +qwk_0i01aYP , -1691.8 , 1. +qwk_0i01aYM , -1594.1 , 1. +qwk_0i02XP , 1712.6 , 1. +qwk_0i02XM , 2214.3 , 1. +qwk_0i02YP , 3218.1 , 1. +qwk_0i02YM , 3345.5 , 1. +qwk_0i02aXP , 2653.2 , 1. +qwk_0i02aXM , 2465.1 , 1. +qwk_0i02aYP , 2217.7 , 1. +qwk_0i02aYM , 3000.3 , 1. +qwk_0i05XP , 3347.8 , 1. +qwk_0i05XM , 3863.6 , 1. +qwk_0i05YP , 2394.2 , 1. +qwk_0i05YM , 2744.4 , 1. +qwk_0i07XP , 3198.4 , 1. +qwk_0i07XM , 3639.1 , 1. +qwk_0i07YP , 2093.4 , 1. +qwk_0i07YM , 1951.3 , 1. +qwk_0l01XP , 2526.4 , 1. +qwk_0l01XM , 3733.2 , 1. +qwk_0l01YP , 2442.4 , 1. +qwk_0l01YM , 4121.0 , 1. +qwk_0l02XP , 2424.8 , 1. +qwk_0l02XM , 2660.1 , 1. +qwk_0l02YP , 1987.7 , 1. +qwk_0l02YM , 1256.0 , 1. +qwk_0l03XP , 2907.4 , 1. +qwk_0l03XM , 4915.4 , 1. +qwk_0l03YP , 3032.9 , 1. +qwk_0l03YM , 4397.2 , 1. +! The pedestals after this point are for BPMs after FC2, +! so they are "beam off" pedestals. +qwk_0l04XP , -141.4 , 1. +qwk_0l04XM , -236.0 , 1. +qwk_0l04YP , -89.2 , 1. +qwk_0l04YM , 28.3 , 1. +qwk_0l05XP , 566.1 , 1. +qwk_0l05XM , 627.5 , 1. +qwk_0l05YP , 713.4 , 1. +qwk_0l05YM , 678.0 , 1. +qwk_0l06XP , -473.4 , 1. +qwk_0l06XM , -223.0 , 1. +qwk_0l06YP , -42.6 , 1. +qwk_0l06YM , 136.5 , 1. +qwk_0l07XP , 594.5 , 1. +qwk_0l07XM , 718.4 , 1. +qwk_0l07YP , -993.1 , 1. +qwk_0l07YM , -927.4 , 1. +qwk_0l08XP , -358.9 , 1. +qwk_0l08XM , -176.4 , 1. +qwk_0l08YP , 359.0 , 1. +qwk_0l08YM , 755.6 , 1. +qwk_0l09XP , -1341.6 , 1. +qwk_0l09XM , -825.5 , 1. +qwk_0l09YP , -576.3 , 1. +qwk_0l09YM , -616.0 , 1. +qwk_0l10XP , 334.3 , 1. +qwk_0l10XM , 366.2 , 1. +qwk_0l10YP , 349.4 , 1. +qwk_0l10YM , 302.5 , 1. +QWK_0r01XP , 1914.3 , 1.0 +QWK_0r01XM , 2019.5 , 1.0 +QWK_0r01YP , 1786.1 , 1.0 +QWK_0r01YM , 2379.9 , 1.0 +QWK_0r01aXP , -1 , 1.0 +QWK_0r01aXM , -1 , 1.0 +QWK_0r01aYP , -1 , 1.0 +QWK_0r01aYM , -1 , 1.0 +qwk_0r03XP , -163.2 , 1. +qwk_0r03XM , -549.4 , 1. +qwk_0r03YP , 325.9 , 1. +qwk_0r03YM , 384.5 , 1. +qwk_0r04XP , 488.1 , 1. +qwk_0r04XM , 442.6 , 1. +qwk_0r04YP , -59.3 , 1. +qwk_0r04YM , 36.6 , 1. +qwk_0r05XP , -236.1 , 1. +qwk_0r05XM , -288.7 , 1. +qwk_0r05YP , -1193.8 , 1. +qwk_0r05YM , -1088.4 , 1. +qwk_0r06XP , 276.8 , 1. +qwk_0r06XM , 701.3 , 1. +qwk_0r06YP , 768.6 , 1. +qwk_0r06YM , 738.3 , 1. +QWK_BCM0l02, -1989.81, 0.00150841 +QWK_Batery6 , -2.496e+06 , 1.0 +QWK_Batery7 , -5.735e+06 , 1.0 +QWK_Batext1 , -7.740e+06 , 1.0 +QWK_Batext2 , -3.733e+06 , 1.0 +QWK_PhaseMo , 0.0 1 , +!END + diff --git a/Parity/prminput/prexinj_detectors.map b/Parity/prminput/prexinj_detectors.map new file mode 100644 index 000000000..ca40e41ae --- /dev/null +++ b/Parity/prminput/prexinj_detectors.map @@ -0,0 +1,12 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = Injector + map = prexinj_beamline.map + geom = prexinj_beamline_geometry.map + eventcut = prexinj_beamline_eventcuts.map + param = prexinj_beamline_pedestal.map + +[QwHelicity] + name = Helicity info + map = prexinj_helicity.map diff --git a/Parity/prminput/prexinj_helicity.map b/Parity/prminput/prexinj_helicity.map new file mode 100644 index 000000000..fd97d3c16 --- /dev/null +++ b/Parity/prminput/prexinj_helicity.map @@ -0,0 +1,83 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=4 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +MarkerWord=0x00003103 + +! +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END diff --git a/Parity/src/MollerMainDetector.cc b/Parity/src/MollerMainDetector.cc index 470d49054..a31e6e9c1 100755 --- a/Parity/src/MollerMainDetector.cc +++ b/Parity/src/MollerMainDetector.cc @@ -153,38 +153,22 @@ Int_t MollerMainDetector::LoadChannelMap(TString mapfile) // Open the file QwParameterFile mapstr(mapfile.Data()); - TString varname, varvalue; - fDetectorMaps.insert(mapstr.GetParamFileNameContents()); + mapstr.EnableGreediness(); + mapstr.SetCommentChars("!"); + + UInt_t value; + while (mapstr.ReadNextLine()) { + RegisterRocBankMarker(mapstr); + if (mapstr.PopValue("sample_size",value)) { + sample_size=value; + } mapstr.TrimComment('!'); // Remove everything after a '!' character. mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. if (mapstr.LineIsEmpty()) continue; - if (mapstr.HasVariablePair("=",varname,varvalue)) - { - // This is a declaration line. Decode it. - varname.ToLower(); - UInt_t value = QwParameterFile::GetUInt(varvalue); - - if (varname=="roc") - { - currentrocread=value; - RegisterROCNumber(value,0); - } - else if (varname=="bank") - { - currentbankread=value; - RegisterSubbank(value); - } - else if (varname=="sample_size") - { - sample_size=value; - } - } - else - { Bool_t lineok = kTRUE; TString keyword = ""; TString keyword2 = ""; @@ -237,9 +221,9 @@ Int_t MollerMainDetector::LoadChannelMap(TString mapfile) } - if (currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread)) + if (currentsubbankindex!=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID)) { - currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread); + currentsubbankindex=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID); wordsofar=0; } @@ -333,9 +317,7 @@ Int_t MollerMainDetector::LoadChannelMap(TString mapfile) if (lineok) fMainDetID.push_back(localMainDetID); - } - } - + } // End of "while (mapstr.ReadNextLine())" //std::cout<<"linking combined channels"< publishinfo; + TString varvalue; while ((section = mapstr.ReadNextSection(varvalue))) { if (varvalue == "PUBLISH") { fPublishList.clear(); diff --git a/Parity/src/QwBeamLine.cc b/Parity/src/QwBeamLine.cc index fb6e2fee8..4d528bca6 100755 --- a/Parity/src/QwBeamLine.cc +++ b/Parity/src/QwBeamLine.cc @@ -130,17 +130,9 @@ Int_t QwBeamLine::LoadChannelMap(TString mapfile) * be relisted for each bank. */ while (mapstr.ReadNextLine() && mapstr.SkipSection("PUBLISH")) { - UInt_t value = 0; - if (mapstr.PopValue("roc",value)) { - // currentrocread=value; - RegisterROCNumber(value,0); - } - if (mapstr.PopValue("bank",value)) { - // currentbankread=value; - RegisterSubbank(value); - // Remove the "vqwk_buffer_offset" and "scaler_buffer_offset" - // keywords from the parameter file's listing - } + RegisterRocBankMarker(mapstr); + // Remove the "vqwk_buffer_offset" and "scaler_buffer_offset" + // keywords from the parameter file's listing if (mapstr.ReturnValue("vqwk_buffer_offset",buffer_offset)) { QwDebug << "QwBeamLine::LoadChannelMap: " << "ROC " << fCurrentROC_ID diff --git a/Parity/src/QwHelicity.cc b/Parity/src/QwHelicity.cc index 70082c3fd..4b2f4bc7d 100755 --- a/Parity/src/QwHelicity.cc +++ b/Parity/src/QwHelicity.cc @@ -43,6 +43,7 @@ QwHelicity::QwHelicity(const TString& name) : VQwSubsystem(name), VQwSubsystemParity(name), fHelicityBitPattern(kDefaultHelicityBitPattern), + kPatternCounter(-1), kMpsCounter(-1), kPatternPhase(-1), fMinPatternPhase(1), fUsePredictor(kTRUE), fIgnoreHelicity(kFALSE), fEventNumberFirst(-1),fPatternNumberFirst(-1), fSuppressMPSErrorMsgs(kFALSE) @@ -82,6 +83,9 @@ QwHelicity::QwHelicity(const QwHelicity& source) : VQwSubsystem(source.GetSubsystemName()), VQwSubsystemParity(source.GetSubsystemName()), fHelicityBitPattern(kDefaultHelicityBitPattern), + kPatternCounter(source.kPatternCounter), + kMpsCounter(source.kMpsCounter), + kPatternPhase(source.kPatternPhase), fMinPatternPhase(1), fUsePredictor(kTRUE), fIgnoreHelicity(kFALSE), fEventNumberFirst(-1),fPatternNumberFirst(-1), fSuppressMPSErrorMsgs(kFALSE) @@ -520,41 +524,49 @@ void QwHelicity::ProcessEventUserbitMode() void QwHelicity::ProcessEventInputRegisterMode() { static Bool_t firstpattern = kTRUE; - Bool_t fake_the_counters=kFALSE; + static Bool_t fake_the_counters=kFALSE; UInt_t thisinputregister=fWord[kInputRegister].fValue; - /** - In the Input Register Mode, - the event number is obtained straight from the wordkMPSCounter. - */ - fEventNumber=fWord[kMpsCounter].fValue; - + if (firstpattern){ + // If any of the special counters are negative or zero, setup to + // generate the counters internally. + fake_the_counters |= (kPatternCounter<=0) + || ( kMpsCounter<=0) || (kPatternPhase<=0); + } + if (CheckIORegisterMask(thisinputregister,fInputReg_FakeMPS)) fIgnoreHelicity = kTRUE; else fIgnoreHelicity = kFALSE; - // When we have the minimum phase from the pattern phase word - // and the input register minimum phase bit is set - // we can select the second pattern as below. - if(fWord[kPatternPhase].fValue - fPatternPhaseOffset == 0) - if (firstpattern && CheckIORegisterMask(thisinputregister,kInputReg_PatternSync)){ - firstpattern = kFALSE; - } - - // If firstpattern is still TRUE, we are still searching for the first - // pattern of the data stream. So set the pattern number = 0 - if (firstpattern) - fPatternNumber = -1; - else { - fPatternNumber = fWord[kPatternCounter].fValue; - fPatternPhaseNumber = fWord[kPatternPhase].fValue - fPatternPhaseOffset + fMinPatternPhase; - } - - /** Tf we get junk for the mps and pattern information from the run - we can enable fake counters for mps, pattern number and pattern phase to get the job done. + /** If we get junk for the mps and pattern information from the run + we can enable fake counters for mps, pattern number and pattern + phase to get the job done. */ - if (fake_the_counters){ + if (!fake_the_counters){ + /** + In the Input Register Mode, + the event number is obtained straight from the wordkMPSCounter. + */ + fEventNumber=fWord[kMpsCounter].fValue; + // When we have the minimum phase from the pattern phase word + // and the input register minimum phase bit is set + // we can select the second pattern as below. + if(fWord[kPatternPhase].fValue - fPatternPhaseOffset == 0) + if (firstpattern && CheckIORegisterMask(thisinputregister,kInputReg_PatternSync)){ + firstpattern = kFALSE; + } + + // If firstpattern is still TRUE, we are still searching for the first + // pattern of the data stream. So set the pattern number = 0 + if (firstpattern) + fPatternNumber = -1; + else { + fPatternNumber = fWord[kPatternCounter].fValue; + fPatternPhaseNumber = fWord[kPatternPhase].fValue - fPatternPhaseOffset + fMinPatternPhase; + } + } else { + // Use internal variables for all the counters. fEventNumber = fEventNumberOld+1; if (CheckIORegisterMask(thisinputregister,kInputReg_PatternSync)) { fPatternPhaseNumber = fMinPatternPhase; @@ -807,10 +819,8 @@ Int_t QwHelicity::LoadChannelMap(TString mapfile) { Bool_t ldebug=kFALSE; - Int_t currentrocread=0; - Int_t currentbankread=0; Int_t wordsofar=0; - Int_t currentsubbankindex=-1; + Int_t bankindex=-1; fPatternPhaseOffset=1;//Phase number offset is set to 1 by default and will be set to 0 if phase number starts from 0 @@ -821,172 +831,141 @@ Int_t QwHelicity::LoadChannelMap(TString mapfile) QwParameterFile mapstr(mapfile.Data()); //Open the file fDetectorMaps.insert(mapstr.GetParamFileNameContents()); + mapstr.EnableGreediness(); + mapstr.SetCommentChars("!"); + UInt_t value = 0; + TString valuestr; + while (mapstr.ReadNextLine()){ - mapstr.TrimComment('!'); // Remove everything after a '!' character. + RegisterRocBankMarker(mapstr); + + if (mapstr.PopValue("patternphase",value)) { + fMaxPatternPhase=value; + //QwMessage << " fMaxPatternPhase " << fMaxPatternPhase << QwLog::endl; + } + if (mapstr.PopValue("patternbits",value)) { + SetHelicityBitPattern(value); + } + if (mapstr.PopValue("fakempsbit",value)) { + fInputReg_FakeMPS = value; + QwWarning << " fInputReg_FakeMPS 0x" << std::hex << fInputReg_FakeMPS << std::dec << QwLog::endl; + } + if (mapstr.PopValue("numberpatternsdelayed",value)) { + SetHelicityDelay(value); + } + if (mapstr.PopValue("randseedbits",value)) { + if (value==24 || value==30) + fRandBits = value; + } + if (mapstr.PopValue("patternphaseoffset",value)) { + fPatternPhaseOffset=value; + } + if (mapstr.PopValue("helpluseventtype",value)) { + kEventTypeHelPlus = value; + } + if (mapstr.PopValue("helminuseventtype",value)) { + kEventTypeHelMinus = value; + } + if (mapstr.PopValue("helicitydecodingmode",valuestr)) { + if (valuestr=="InputRegisterMode") { + QwMessage << " **** Input Register Mode **** " << QwLog::endl; + fHelicityDecodingMode=kHelInputRegisterMode; + } else if (valuestr=="UserbitMode"){ + QwMessage << " **** Userbit Mode **** " << QwLog::endl; + fHelicityDecodingMode=kHelUserbitMode; + } else if (valuestr=="HelLocalyMadeUp"){ + QwMessage << "**** Helicity Locally Made Up ****" << QwLog::endl; + fHelicityDecodingMode=kHelLocalyMadeUp; + } else if (valuestr=="InputMollerMode") { + QwMessage << "**** Input Moller Mode ****" << QwLog::endl; + fHelicityDecodingMode=kHelInputMollerMode; + } else { + QwError << "The helicity decoding mode read in file " << mapfile + << " is not recognized in function QwHelicity::LoadChannelMap \n" + << " Quiting this execution." << QwLog::endl; + } + } + + if(bankindex!=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID)) { + bankindex=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID); + if (fWordsPerSubbank.size()(fWord.size(),fWord.size())); + } + wordsofar=0; + } mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. if (mapstr.LineIsEmpty()) continue; - TString varname, varvalue; - if (mapstr.HasVariablePair("=",varname,varvalue)){ - // This is a declaration line. Decode it. - varname.ToLower(); - UInt_t value = QwParameterFile::GetUInt(varvalue); - - if (varname=="roc") - { - currentrocread=value; - RegisterROCNumber(value,0); - fWordsPerSubbank.push_back( std::pair(fWord.size(),fWord.size())); - } - else if (varname=="bank") - { - currentbankread=value; - RegisterSubbank(value); - fWordsPerSubbank.push_back( std::pair(fWord.size(),fWord.size())); - } - else if (varname=="patternphase") - { - fMaxPatternPhase=value; - //QwMessage << " fMaxPatternPhase " << fMaxPatternPhase << QwLog::endl; - } - else if (varname=="patternbits") - { - SetHelicityBitPattern(value); - } - else if (varname=="fakempsbit") - { - fInputReg_FakeMPS = value; - QwWarning << " fInputReg_FakeMPS 0x" << std::hex << fInputReg_FakeMPS << std::dec << QwLog::endl; - } - else if (varname=="numberpatternsdelayed") - { - SetHelicityDelay(value); - } - else if (varname=="randseedbits") - { - if (value==24 || value==30) - fRandBits = value; - } - else if (varname=="patternphaseoffset") - { - fPatternPhaseOffset=value; - } - else if(varname=="helpluseventtype") - { - kEventTypeHelPlus = value; - } - else if(varname=="helminuseventtype") - { - kEventTypeHelMinus = value; - } - else if (varname=="helicitydecodingmode") + // Break this line into tokens to process it. + TString modtype = mapstr.GetTypedNextToken(); // module type + Int_t modnum = mapstr.GetTypedNextToken(); //slot number + /* Int_t channum = */ mapstr.GetTypedNextToken(); //channel number /* unused */ + TString dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector + dettype.ToLower(); + TString namech = mapstr.GetTypedNextToken(); //name of the detector + namech.ToLower(); + TString keyword = mapstr.GetTypedNextToken(); + keyword.ToLower(); + // Notice that "namech" and "keyword" are now forced to lower-case. + + if(modtype=="SKIP"){ + if (modnum<=0) wordsofar+=1; + else wordsofar+=modnum; + } else if(modtype!="WORD"|| dettype!="helicitydata") { + QwError << "QwHelicity::LoadChannelMap: Unknown detector type: " + << dettype << ", the detector " << namech << " will not be decoded " + << QwLog::endl; + continue; + } else { + QwWord localword; + localword.fSubbankIndex=bankindex; + localword.fWordInSubbank=wordsofar; + wordsofar+=1; + // I assume that one data = one word here. But it is not always the case, for + // example the triumf adc gives 6 words per channel + localword.fModuleType=modtype; + localword.fWordName=namech; + localword.fWordType=dettype; + fWord.push_back(localword); + fWordsPerSubbank.at(bankindex).second = fWord.size(); + + // Notice that "namech" is in lower-case, so these checks + // should all be in lower-case + switch (fHelicityDecodingMode) { - if (varvalue=="InputRegisterMode") { - QwMessage << " **** Input Register Mode **** " << QwLog::endl; - fHelicityDecodingMode=kHelInputRegisterMode; - } - else if (varvalue=="UserbitMode"){ - QwMessage << " **** Userbit Mode **** " << QwLog::endl; - fHelicityDecodingMode=kHelUserbitMode; - } - else if (varvalue=="HelLocalyMadeUp"){ - QwMessage << "**** Helicity Locally Made Up ****" << QwLog::endl; - fHelicityDecodingMode=kHelLocalyMadeUp; + case kHelUserbitMode : + if(namech.Contains("userbit")) kUserbit=fWord.size()-1; + if(namech.Contains("scalercounter")) kScalerCounter=fWord.size()-1; + break; + case kHelInputRegisterMode : + if(namech.Contains("input_register")) kInputRegister= fWord.size()-1; + if(namech.Contains("mps_counter")) kMpsCounter= fWord.size()-1; + if(namech.Contains("pat_counter")) kPatternCounter= fWord.size()-1; + if(namech.Contains("pat_phase")) kPatternPhase= fWord.size()-1; + break; + case kHelInputMollerMode : + if(namech.Contains("mps_counter")) { + kMpsCounter= fWord.size()-1; } - else if (varvalue=="InputMollerMode") { - QwMessage << "**** Input Moller Mode ****" << QwLog::endl; - fHelicityDecodingMode=kHelInputMollerMode; + if(namech.Contains("pat_counter")) { + kPatternCounter = fWord.size()-1; } - else { - QwError << "The helicity decoding mode read in file " << mapfile - << " is not recognized in function QwHelicity::LoadChannelMap \n" - << " Quiting this execution." << QwLog::endl; - } - } - } else { - // Break this line into tokens to process it. - TString modtype = mapstr.GetTypedNextToken(); // module type - Int_t modnum = mapstr.GetTypedNextToken(); //slot number - /* Int_t channum = */ mapstr.GetTypedNextToken(); //channel number /* unused */ - TString dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector - dettype.ToLower(); - TString namech = mapstr.GetTypedNextToken(); //name of the detector - namech.ToLower(); - TString keyword = mapstr.GetTypedNextToken(); - keyword.ToLower(); - // Notice that "namech" and "keyword" are now forced to lower-case. - - if(currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread)) - { - currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread); - wordsofar=0; - } - - if(modtype=="SKIP"){ - if (modnum<=0) wordsofar+=1; - else wordsofar+=modnum; - } - else if(modtype!="WORD"|| dettype!="helicitydata") - { - QwError << "QwHelicity::LoadChannelMap: Unknown detector type: " - << dettype << ", the detector " << namech << " will not be decoded " - << QwLog::endl; - continue; - } - else - { - QwWord localword; - localword.fSubbankIndex=currentsubbankindex; - localword.fWordInSubbank=wordsofar; - wordsofar+=1; - // I assume that one data = one word here. But it is not always the case, for - // example the triumf adc gives 6 words per channel - localword.fModuleType=modtype; - localword.fWordName=namech; - localword.fWordType=dettype; - fWord.push_back(localword); - fWordsPerSubbank[currentsubbankindex].second = fWord.size(); - QwDebug << "--" << namech << "--" << fWord.size()-1 << QwLog::endl; - - // Notice that "namech" is in lower-case, so these checks - // should all be in lower-case - switch (fHelicityDecodingMode) - { - case kHelUserbitMode : - if(namech.Contains("userbit")) kUserbit=fWord.size()-1; - if(namech.Contains("scalercounter")) kScalerCounter=fWord.size()-1; - break; - case kHelInputRegisterMode : - if(namech.Contains("input_register")) kInputRegister= fWord.size()-1; - if(namech.Contains("mps_counter")) kMpsCounter= fWord.size()-1; - if(namech.Contains("pat_counter")) kPatternCounter= fWord.size()-1; - if(namech.Contains("pat_phase")) kPatternPhase= fWord.size()-1; - break; - case kHelInputMollerMode : - if(namech.Contains("mps_counter")) { - kMpsCounter= fWord.size()-1; - } - if(namech.Contains("pat_counter")) { - kPatternCounter = fWord.size()-1; - } - break; - } + break; } } } + - if(ldebug) - { - std::cout << "Done with Load map channel \n"; - for(size_t i=0;i= fSubbank_Map[subbank].size()) fSubbank_Map[subbank].resize(modnum+1); if (channum >= fSubbank_Map[subbank].at(modnum).size()) @@ -158,7 +157,7 @@ Int_t QwScaler::LoadChannelMap(TString mapfile) if (fSubbank_Map[subbank].at(modnum).at(channum) < 0) { QwVerbose << "Registering " << modtype << " " << keyword << std::hex - << " in ROC 0x" << current_roc_id << ", bank 0x" << current_bank_id + << " in ROC 0x" << fCurrentROC_ID << ", bank 0x" << fCurrentBank_ID << std::dec << " at mod " << modnum << ", chan " << channum << QwLog::endl; From 035e045bd49064a6cfa4598397db4282b32bd98e Mon Sep 17 00:00:00 2001 From: Hall A Online Date: Mon, 30 Jul 2018 10:29:03 -0400 Subject: [PATCH 3/6] Parameter files needed to analyze the summer 2018 PREX injector data files using marker words, beginning with about run 4000. --- Parity/prminput/prexinj_beamline.4000-.map | 127 ++++++++++ Parity/prminput/prexinj_beamline_geometry.map | 53 ++-- .../prexinj_beamline_pedestal.4000-.map | 134 ++++++++++ Parity/prminput/prexinj_beamline_pedestal.map | 236 ++++++++---------- Parity/prminput/prexinj_helicity.4000-.map | 83 ++++++ 5 files changed, 476 insertions(+), 157 deletions(-) create mode 100644 Parity/prminput/prexinj_beamline.4000-.map create mode 100644 Parity/prminput/prexinj_beamline_pedestal.4000-.map create mode 100644 Parity/prminput/prexinj_helicity.4000-.map diff --git a/Parity/prminput/prexinj_beamline.4000-.map b/Parity/prminput/prexinj_beamline.4000-.map new file mode 100644 index 000000000..4ad2d12b2 --- /dev/null +++ b/Parity/prminput/prexinj_beamline.4000-.map @@ -0,0 +1,127 @@ + +ROC=24 +MarkerWord=0xff902902 +!!!Bank=0x3102 +!same sample size for ADCs in a given bank +sample_size=2048 +! +! +! module.type, module.num chan.num, det.type, det.name + + +!ADC0 + VQWK, 0, 0, bpmstripline, bpm0I01Axp + VQWK, 0, 1, bpmstripline, bpm0I01Axm + VQWK, 0, 2, bpmstripline, bpm0I01Ayp + VQWK, 0, 3, bpmstripline, bpm0I01Aym + VQWK, 0, 4, bpmstripline, bpm1I04xp + VQWK, 0, 5, bpmstripline, bpm1I04xm + VQWK, 0, 6, bpmstripline, bpm1I04yp + VQWK, 0, 7, bpmstripline, bpm1I04ym + +!ADC1 + VQWK, 1, 0, bpmstripline, bpm1I02xp + VQWK, 1, 1, bpmstripline, bpm1I02xm + VQWK, 1, 2, bpmstripline, bpm1I02yp + VQWK, 1, 3, bpmstripline, bpm1I02ym + VQWK, 1, 4, bpmstripline, bpm0I01xp + VQWK, 1, 5, bpmstripline, bpm0I01xm + VQWK, 1, 6, bpmstripline, bpm0I01yp + VQWK, 1, 7, bpmstripline, bpm0I01ym + + +!ADC2 + VQWK, 2, 0, bpmstripline, bpm1I06xp + VQWK, 2, 1, bpmstripline, bpm1I06xm + VQWK, 2, 2, bpmstripline, bpm1I06yp + VQWK, 2, 3, bpmstripline, bpm1I06ym + VQWK, 2, 4, bpmstripline, bpm0I02xp + VQWK, 2, 5, bpmstripline, bpm0I02xm + VQWK, 2, 6, bpmstripline, bpm0I02yp + VQWK, 2, 7, bpmstripline, bpm0I02ym + +!ADC3 + VQWK, 3, 0, bpmstripline, bpm0I02Axp + VQWK, 3, 1, bpmstripline, bpm0I02Axm + VQWK, 3, 2, bpmstripline, bpm0I02Ayp + VQWK, 3, 3, bpmstripline, bpm0I02Aym + VQWK, 3, 4, bpmstripline, bpm0I05xp + VQWK, 3, 5, bpmstripline, bpm0I05xm + VQWK, 3, 6, bpmstripline, bpm0I05yp + VQWK, 3, 7, bpmstripline, bpm0I05ym + +!ADC4 + VQWK, 4, 0, bpmstripline, bpm0I07xp + VQWK, 4, 1, bpmstripline, bpm0I07xm + VQWK, 4, 2, bpmstripline, bpm0I07yp + VQWK, 4, 3, bpmstripline, bpm0I07ym + VQWK, 4, 4, bpmstripline, bpm0L01xp + VQWK, 4, 5, bpmstripline, bpm0L01xm + VQWK, 4, 6, bpmstripline, bpm0L01yp + VQWK, 4, 7, bpmstripline, bpm0L01ym + + +!ADC5 + VQWK, 5, 0, bpmstripline, bpm0L02xp + VQWK, 5, 1, bpmstripline, bpm0L02xm + VQWK, 5, 2, bpmstripline, bpm0L02yp + VQWK, 5, 3, bpmstripline, bpm0L02ym + VQWK, 5, 4, bpmstripline, bpm0L03xp + VQWK, 5, 5, bpmstripline, bpm0L03xm + VQWK, 5, 6, bpmstripline, bpm0L03yp + VQWK, 5, 7, bpmstripline, bpm0L03ym + +!ADC6 + VQWK, 6, 0, bpmstripline, bpm0L04xp + VQWK, 6, 1, bpmstripline, bpm0L04xm + VQWK, 6, 2, bpmstripline, bpm0L04yp + VQWK, 6, 3, bpmstripline, bpm0L04ym + VQWK, 6, 4, bpmstripline, bpm0L05xp + VQWK, 6, 5, bpmstripline, bpm0L05xm + VQWK, 6, 6, bpmstripline, bpm0L05yp + VQWK, 6, 7, bpmstripline, bpm0L05ym + +!ADC7 + VQWK, 7, 0, bpmstripline, bpm0L06xp + VQWK, 7, 1, bpmstripline, bpm0L06xm + VQWK, 7, 2, bpmstripline, bpm0L06yp + VQWK, 7, 3, bpmstripline, bpm0L06ym + VQWK, 7, 4, bpmstripline, bpm0L07xp + VQWK, 7, 5, bpmstripline, bpm0L07xm + VQWK, 7, 6, bpmstripline, bpm0L07yp + VQWK, 7, 7, bpmstripline, bpm0L07ym + +!ADC8 + VQWK, 8, 0, bpmstripline, bpm0L08xp + VQWK, 8, 1, bpmstripline, bpm0L08xm + VQWK, 8, 2, bpmstripline, bpm0L08yp + VQWK, 8, 3, bpmstripline, bpm0L08ym + VQWK, 8, 4, bpmstripline, bpm0L09xp + VQWK, 8, 5, bpmstripline, bpm0L09xm + VQWK, 8, 6, bpmstripline, bpm0L09yp + VQWK, 8, 7, bpmstripline, bpm0L09ym + +!ADC9 + VQWK, 9, 0, bpmstripline, bpm0L10xp + VQWK, 9, 1, bpmstripline, bpm0L10xm + VQWK, 9, 2, bpmstripline, bpm0L10yp + VQWK, 9, 3, bpmstripline, bpm0L10ym + VQWK, 9, 4, bpmstripline, bpm2I02xp + VQWK, 9, 5, bpmstripline, bpm2I02xm + VQWK, 9, 6, bpmstripline, bpm2I02yp + VQWK, 9, 7, bpmstripline, bpm2I02ym + +!ADC10 + VQWK, 10, 0, bpmstripline, bpm2I01xp + VQWK, 10, 1, bpmstripline, bpm2I01xm + VQWK, 10, 2, bpmstripline, bpm2I01yp + VQWK, 10, 3, bpmstripline, bpm2I01ym + VQWK, 10, 4, bcm, BCM0L02 + VQWK, 10, 5, bcm, Batery6 + VQWK, 10, 6, bcm, Batery7 + VQWK, 10, 7, bcm, PhaseMonitor + + +[PUBLISH] +# q_targ, bcm, bcm0l02, c +q_targ, bpmstripline, bpm0i02, ef ### Effective charge of BPM0i02 \ No newline at end of file diff --git a/Parity/prminput/prexinj_beamline_geometry.map b/Parity/prminput/prexinj_beamline_geometry.map index d8dfab85d..26835304a 100644 --- a/Parity/prminput/prexinj_beamline_geometry.map +++ b/Parity/prminput/prexinj_beamline_geometry.map @@ -27,32 +27,31 @@ ! ! device type, device_name, Xoffset, Yoffset, Zoffset, BSEN scaling factor, AlpaX, AlpaY ! - - bpmstripline, QWK_1I02, 0.0, 0.0, 0.0, 0.734, 1.085410, 0.977843 - bpmstripline, QWK_1I04, 0.0, 0.0, 0.0, 0.734, 0.959589, 0.955868 - bpmstripline, QWK_1I06, 0.0, 0.0, 0.0, 0.734, 1.052820, 0.964797 - bpmstripline, QWK_0I01, 0.0, 0.0, 0.0, 0.734, 1.006630, 0.923753 - bpmstripline, QWK_0I01A, 0.0, 0.0, 0.0, 0.734, 1.053700, 1.032170 - bpmstripline, QWK_0I02, 0.0, 0.0, 0.0, 0.734, 0.985505, 0.900560 - bpmstripline, QWK_0I02A, 0.0, 0.0, 0.0, 0.734, 1.015710, 1.053130 - bpmstripline, QWK_0I05, 0.0, 0.0, 0.0, 0.734, 1.278300, 0.976040 - bpmstripline, QWK_0I07, 0.0, 0.0, 0.0, 0.734, 0.983711, 1.075580 - bpmstripline, QWK_0L01, 0.0, 0.0, 0.0, 1.0, 0.998108, 0.961697 - bpmstripline, QWK_0L02, 0.0, 0.0, 0.0, 1.0, 0.995747, 1.002760 - bpmstripline, QWK_0L03, 0.0, 0.0, 0.0, 1.0, 0.922851, 0.938417 - bpmstripline, QWK_0L04, 0.0, 0.0, 0.0, 1.0, 1.009110, 0.952050 - bpmstripline, QWK_0L05, 0.0, 0.0, 0.0, 1.0, 1.084810, 0.997621 - bpmstripline, QWK_0L06, 0.0, 0.0, 0.0, 1.0, 1.002530, 1.080990 - bpmstripline, QWK_0L07, 0.0, 0.0, 0.0, 1.0, 1.059450, 0.980722 - bpmstripline, QWK_0L08, 0.0, 0.0, 0.0, 1.0, 0.949430, 1.037000 - bpmstripline, QWK_0L09, 0.0, 0.0, 0.0, 1.0, 0.993488, 1.002960 - bpmstripline, QWK_0L10, 0.0, 0.0, 0.0, 1.0, 0.981602, 1.008690 - bpmstripline, QWK_0R01, 0.0, 0.0, 0.0, 1.0, 1.049370, 0.942922 - bpmstripline, QWK_0R02, 0.0, 0.0, 0.0, 1.0, 1.084550, 1.081500 - bpmstripline, QWK_0R03, 0.0, 0.0, 0.0, 1.0, 0.966298, 0.982757 - bpmstripline, QWK_0R04, 0.0, 0.0, 0.0, 1.0, 1.065620, 1.079380 - bpmstripline, QWK_0R05, 0.0, 0.0, 0.0, 1.0, 0.949244, 0.995147 - bpmstripline, QWK_0R06, 0.0, 0.0, 0.0, 1.0, 0.987571, 1.006590 - bpmstripline, QWK_0R07, 0.0, 0.0, 0.0, 1.0, 1.041250, 0.914155 +!!!!! BSEN scale values adapted from Caryn's pan control.db file, 2018jul26 +!!!!! 0i and 1i BPMS, BSEN scale = 13.7/18.81 = 0.728336 +!!!!! 0L and 0R BPMs, BSEN scale = 18.76/18.81 = 0.99734184 +!!!!! 2i BPMs, BSEN scale = 25.67 /18.81 = 1.3647 + + bpmstripline, bpm0I01A, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm1I04, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm1I02, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I01, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm1I06, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I02, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I02A, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I05, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I07, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0L01, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L02, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L03, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L04, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L05, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L06, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L07, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L08, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L09, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L10, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm2I02, 0.0, 0.0, 0.0, 1.3647, 1.000000, 1.000000 unrotated + bpmstripline, bpm2I01, 0.0, 0.0, 0.0, 1.3647, 1.000000, 1.000000 unrotated !END diff --git a/Parity/prminput/prexinj_beamline_pedestal.4000-.map b/Parity/prminput/prexinj_beamline_pedestal.4000-.map new file mode 100644 index 000000000..e7a2867e7 --- /dev/null +++ b/Parity/prminput/prexinj_beamline_pedestal.4000-.map @@ -0,0 +1,134 @@ +! Pedestal file of run 2205 +! adc sample size 468 +! curent range in calibration 90 to 155 +! fit is linear +! date of analysis =Tue Feb 22 19:02:59 2011 +! The pedestal run was taken with F2 cup inserted. +! Therefore only bpms up to 0i05 have the correct pedestals +! for this high current calibration. +bpm0I01Axp , -3646.06, 1. +bpm0I01Axm , -4068.67, 1. +bpm0I01Ayp , -3127.05, 1. +bpm0I01Aym , -2631.79, 1. +bpm1I04xp , -3939.86, 1. +bpm1I04xm , -4222.50, 1. +bpm1I04yp , -2370.04, 1. +bpm1I04ym , -2259.99, 1. +bpm1I02xp , -3853.94, 1. +bpm1I02xm , -4222.28, 1. +bpm1I02yp , -3967.45, 1. +bpm1I02ym , -4343.31, 1. +bpm0I01xp , -3469.19, 1. +bpm0I01xm , -3187.83, 1. +bpm0I01yp , -3368.43, 1. +bpm0I01ym , -3659.07, 1. +bpm1I06xp , -2863.20, 1. +bpm1I06xm , -2797.80, 1. +bpm1I06yp , -3260.17, 1. +bpm1I06ym , -3282.10, 1. +bpm0I02xp , -3087.75, 1. +bpm0I02xm , -2762.77, 1. +bpm0I02yp , -2642.40, 1. +bpm0I02ym , -3485.67, 1. +bpm0I02Axp , 1190.23, 1. +bpm0I02Axm , 460.41, 1. +bpm0I02Ayp , 1129.83, 1. +bpm0I02Aym , 414.07, 1. +bpm0I05xp , 138.90, 1. +bpm0I05xm , 1603.09, 1. +bpm0I05yp , 584.87, 1. +bpm0I05ym , 1155.56, 1. +bpm0I07xp , -1117.61, 1. +bpm0I07xm , -383.13, 1. +bpm0I07yp , -304.90, 1. +bpm0I07ym , 247.43, 1. +bpm0L01xp , -598.90, 1. +bpm0L01xm , -273.06, 1. +bpm0L01yp , -997.02, 1. +bpm0L01ym , -1170.01, 1. +bpm0L02xp , 49.36, 1. +bpm0L02xm , -303.47, 1. +bpm0L02yp , -396.25, 1. +bpm0L02ym , -269.01, 1. +bpm0L03xp , 31.44, 1. +bpm0L03xm , 1274.60, 1. +bpm0L03yp , 442.68, 1. +bpm0L03ym , 492.62, 1. + +!!!!! +bpm2I01xm , -3636.38, 1. +bpm2I01xp , -3919.71, 1. +bpm2I01ym , -2898.74, 1. +bpm2I01yp , -1595.36, 1. +bpm2I02xm , -4951.91, 1. +bpm2I02xp , -4540.29, 1. +bpm2I02ym , -4336.13, 1. +bpm2I02yp , -4319.98, 1. + + +! The pedestals after this point are for BPMs after FC2, +! so they are "beam off" pedestals. +bpm0l04XP , -141.4 , 1. +bpm0l04XM , -236.0 , 1. +bpm0l04YP , -89.2 , 1. +bpm0l04YM , 28.3 , 1. +bpm0l05XP , 566.1 , 1. +bpm0l05XM , 627.5 , 1. +bpm0l05YP , 713.4 , 1. +bpm0l05YM , 678.0 , 1. +bpm0l06XP , -473.4 , 1. +bpm0l06XM , -223.0 , 1. +bpm0l06YP , -42.6 , 1. +bpm0l06YM , 136.5 , 1. +bpm0l07XP , 594.5 , 1. +bpm0l07XM , 718.4 , 1. +bpm0l07YP , -993.1 , 1. +bpm0l07YM , -927.4 , 1. +bpm0l08XP , -358.9 , 1. +bpm0l08XM , -176.4 , 1. +bpm0l08YP , 359.0 , 1. +bpm0l08YM , 755.6 , 1. +bpm0l09XP , -1341.6 , 1. +bpm0l09XM , -825.5 , 1. +bpm0l09YP , -576.3 , 1. +bpm0l09YM , -616.0 , 1. +bpm0l10XP , 334.3 , 1. +bpm0l10XM , 366.2 , 1. +bpm0l10YP , 349.4 , 1. +bpm0l10YM , 302.5 , 1. +BPM0r01XP , 1914.3 , 1.0 +BPM0r01XM , 2019.5 , 1.0 +BPM0r01YP , 1786.1 , 1.0 +BPM0r01YM , 2379.9 , 1.0 +BPM0r01aXP , -1 , 1.0 +BPM0r01aXM , -1 , 1.0 +BPM0r01aYP , -1 , 1.0 +BPM0r01aYM , -1 , 1.0 +bpm0r03XP , -163.2 , 1. +bpm0r03XM , -549.4 , 1. +bpm0r03YP , 325.9 , 1. +bpm0r03YM , 384.5 , 1. +bpm0r04XP , 488.1 , 1. +bpm0r04XM , 442.6 , 1. +bpm0r04YP , -59.3 , 1. +bpm0r04YM , 36.6 , 1. +bpm0r05XP , -236.1 , 1. +bpm0r05XM , -288.7 , 1. +bpm0r05YP , -1193.8 , 1. +bpm0r05YM , -1088.4 , 1. +bpm0r06XP , 276.8 , 1. +bpm0r06XM , 701.3 , 1. +bpm0r06YP , 768.6 , 1. +bpm0r06YM , 738.3 , 1. + + + + +BCM0l02, -1989.81, 0.00150841 +Batery6 , -2.496e+06 , 1.0 +Batery7 , -5.735e+06 , 1.0 +Batext1 , -7.740e+06 , 1.0 +Batext2 , -3.733e+06 , 1.0 +PhaseMo , 0.0 1 , +!END + diff --git a/Parity/prminput/prexinj_beamline_pedestal.map b/Parity/prminput/prexinj_beamline_pedestal.map index e96b81d77..0374fc4f8 100644 --- a/Parity/prminput/prexinj_beamline_pedestal.map +++ b/Parity/prminput/prexinj_beamline_pedestal.map @@ -6,137 +6,113 @@ ! The pedestal run was taken with F2 cup inserted. ! Therefore only bpms up to 0i05 have the correct pedestals ! for this high current calibration. -C20AXM , 0 , 1 -C20AXP , 0 , 1 -C20AYP , 0 , 1 -C20AYM , 0 , 1 -H00_XP , 0 , 1 -H00_XM , 0 , 1 -H00_YP , 0 , 1 -H00_YM , 0 , 1 -BattDn , 0 , 1 -TermUp , 0 , 1 -SpareA , 0 , 1 -SpareB , 0 , 1 -AmpCh1 , 0 , 1 -AmpCh2 , 0 , 1 -SpareE , 0 , 1 -TermDn , 0 , 1 -SEBattDn , 0 , 1 -SETermUp , 0 , 1 -SESpareA , 0 , 1 -SESpareB , 0 , 1 -SEAmpCh1 , 0 , 1 -SEAmpCh2 , 0 , 1 -SESpareE , 0 , 1 -SETermDn , 0 , 1 -qwk_1i02XP , 1204.2 , 1. -qwk_1i02XM , 1558.9 , 1. -qwk_1i02YP , 1362.8 , 1. -qwk_1i02YM , 1646.9 , 1. -qwk_1i04XP , 2122.8 , 1. -qwk_1i04XM , 2005.0 , 1. -qwk_1i04YP , 2295.0 , 1. -qwk_1i04YM , 2076.7 , 1. -qwk_1i06XP , 2825.9 , 1. -qwk_1i06XM , 2324.1 , 1. -qwk_1i06YP , 1740.8 , 1. -qwk_1i06YM , 1715.8 , 1. -qwk_0i01XP , 2502.5 , 1. -qwk_0i01XM , 2844.5 , 1. -qwk_0i01YP , 2753.1 , 1. -qwk_0i01YM , 3063.6 , 1. -qwk_0i01aXP , -3923.0 , 1. -qwk_0i01aXM , -3831.3 , 1. -qwk_0i01aYP , -1691.8 , 1. -qwk_0i01aYM , -1594.1 , 1. -qwk_0i02XP , 1712.6 , 1. -qwk_0i02XM , 2214.3 , 1. -qwk_0i02YP , 3218.1 , 1. -qwk_0i02YM , 3345.5 , 1. -qwk_0i02aXP , 2653.2 , 1. -qwk_0i02aXM , 2465.1 , 1. -qwk_0i02aYP , 2217.7 , 1. -qwk_0i02aYM , 3000.3 , 1. -qwk_0i05XP , 3347.8 , 1. -qwk_0i05XM , 3863.6 , 1. -qwk_0i05YP , 2394.2 , 1. -qwk_0i05YM , 2744.4 , 1. -qwk_0i07XP , 3198.4 , 1. -qwk_0i07XM , 3639.1 , 1. -qwk_0i07YP , 2093.4 , 1. -qwk_0i07YM , 1951.3 , 1. -qwk_0l01XP , 2526.4 , 1. -qwk_0l01XM , 3733.2 , 1. -qwk_0l01YP , 2442.4 , 1. -qwk_0l01YM , 4121.0 , 1. -qwk_0l02XP , 2424.8 , 1. -qwk_0l02XM , 2660.1 , 1. -qwk_0l02YP , 1987.7 , 1. -qwk_0l02YM , 1256.0 , 1. -qwk_0l03XP , 2907.4 , 1. -qwk_0l03XM , 4915.4 , 1. -qwk_0l03YP , 3032.9 , 1. -qwk_0l03YM , 4397.2 , 1. +bpm1i02XP , 1204.2 , 1. +bpm1i02XM , 1558.9 , 1. +bpm1i02YP , 1362.8 , 1. +bpm1i02YM , 1646.9 , 1. +bpm1i04XP , 2122.8 , 1. +bpm1i04XM , 2005.0 , 1. +bpm1i04YP , 2295.0 , 1. +bpm1i04YM , 2076.7 , 1. +bpm1i06XP , 2825.9 , 1. +bpm1i06XM , 2324.1 , 1. +bpm1i06YP , 1740.8 , 1. +bpm1i06YM , 1715.8 , 1. +bpm0i01XP , 2502.5 , 1. +bpm0i01XM , 2844.5 , 1. +bpm0i01YP , 2753.1 , 1. +bpm0i01YM , 3063.6 , 1. +bpm0i01aXP , -3923.0 , 1. +bpm0i01aXM , -3831.3 , 1. +bpm0i01aYP , -1691.8 , 1. +bpm0i01aYM , -1594.1 , 1. +bpm0i02XP , 1712.6 , 1. +bpm0i02XM , 2214.3 , 1. +bpm0i02YP , 3218.1 , 1. +bpm0i02YM , 3345.5 , 1. +bpm0i02aXP , 2653.2 , 1. +bpm0i02aXM , 2465.1 , 1. +bpm0i02aYP , 2217.7 , 1. +bpm0i02aYM , 3000.3 , 1. +bpm0i05XP , 3347.8 , 1. +bpm0i05XM , 3863.6 , 1. +bpm0i05YP , 2394.2 , 1. +bpm0i05YM , 2744.4 , 1. +bpm0i07XP , 3198.4 , 1. +bpm0i07XM , 3639.1 , 1. +bpm0i07YP , 2093.4 , 1. +bpm0i07YM , 1951.3 , 1. +bpm0l01XP , 2526.4 , 1. +bpm0l01XM , 3733.2 , 1. +bpm0l01YP , 2442.4 , 1. +bpm0l01YM , 4121.0 , 1. +bpm0l02XP , 2424.8 , 1. +bpm0l02XM , 2660.1 , 1. +bpm0l02YP , 1987.7 , 1. +bpm0l02YM , 1256.0 , 1. +bpm0l03XP , 2907.4 , 1. +bpm0l03XM , 4915.4 , 1. +bpm0l03YP , 3032.9 , 1. +bpm0l03YM , 4397.2 , 1. ! The pedestals after this point are for BPMs after FC2, ! so they are "beam off" pedestals. -qwk_0l04XP , -141.4 , 1. -qwk_0l04XM , -236.0 , 1. -qwk_0l04YP , -89.2 , 1. -qwk_0l04YM , 28.3 , 1. -qwk_0l05XP , 566.1 , 1. -qwk_0l05XM , 627.5 , 1. -qwk_0l05YP , 713.4 , 1. -qwk_0l05YM , 678.0 , 1. -qwk_0l06XP , -473.4 , 1. -qwk_0l06XM , -223.0 , 1. -qwk_0l06YP , -42.6 , 1. -qwk_0l06YM , 136.5 , 1. -qwk_0l07XP , 594.5 , 1. -qwk_0l07XM , 718.4 , 1. -qwk_0l07YP , -993.1 , 1. -qwk_0l07YM , -927.4 , 1. -qwk_0l08XP , -358.9 , 1. -qwk_0l08XM , -176.4 , 1. -qwk_0l08YP , 359.0 , 1. -qwk_0l08YM , 755.6 , 1. -qwk_0l09XP , -1341.6 , 1. -qwk_0l09XM , -825.5 , 1. -qwk_0l09YP , -576.3 , 1. -qwk_0l09YM , -616.0 , 1. -qwk_0l10XP , 334.3 , 1. -qwk_0l10XM , 366.2 , 1. -qwk_0l10YP , 349.4 , 1. -qwk_0l10YM , 302.5 , 1. -QWK_0r01XP , 1914.3 , 1.0 -QWK_0r01XM , 2019.5 , 1.0 -QWK_0r01YP , 1786.1 , 1.0 -QWK_0r01YM , 2379.9 , 1.0 -QWK_0r01aXP , -1 , 1.0 -QWK_0r01aXM , -1 , 1.0 -QWK_0r01aYP , -1 , 1.0 -QWK_0r01aYM , -1 , 1.0 -qwk_0r03XP , -163.2 , 1. -qwk_0r03XM , -549.4 , 1. -qwk_0r03YP , 325.9 , 1. -qwk_0r03YM , 384.5 , 1. -qwk_0r04XP , 488.1 , 1. -qwk_0r04XM , 442.6 , 1. -qwk_0r04YP , -59.3 , 1. -qwk_0r04YM , 36.6 , 1. -qwk_0r05XP , -236.1 , 1. -qwk_0r05XM , -288.7 , 1. -qwk_0r05YP , -1193.8 , 1. -qwk_0r05YM , -1088.4 , 1. -qwk_0r06XP , 276.8 , 1. -qwk_0r06XM , 701.3 , 1. -qwk_0r06YP , 768.6 , 1. -qwk_0r06YM , 738.3 , 1. -QWK_BCM0l02, -1989.81, 0.00150841 -QWK_Batery6 , -2.496e+06 , 1.0 -QWK_Batery7 , -5.735e+06 , 1.0 -QWK_Batext1 , -7.740e+06 , 1.0 -QWK_Batext2 , -3.733e+06 , 1.0 -QWK_PhaseMo , 0.0 1 , +bpm0l04XP , -141.4 , 1. +bpm0l04XM , -236.0 , 1. +bpm0l04YP , -89.2 , 1. +bpm0l04YM , 28.3 , 1. +bpm0l05XP , 566.1 , 1. +bpm0l05XM , 627.5 , 1. +bpm0l05YP , 713.4 , 1. +bpm0l05YM , 678.0 , 1. +bpm0l06XP , -473.4 , 1. +bpm0l06XM , -223.0 , 1. +bpm0l06YP , -42.6 , 1. +bpm0l06YM , 136.5 , 1. +bpm0l07XP , 594.5 , 1. +bpm0l07XM , 718.4 , 1. +bpm0l07YP , -993.1 , 1. +bpm0l07YM , -927.4 , 1. +bpm0l08XP , -358.9 , 1. +bpm0l08XM , -176.4 , 1. +bpm0l08YP , 359.0 , 1. +bpm0l08YM , 755.6 , 1. +bpm0l09XP , -1341.6 , 1. +bpm0l09XM , -825.5 , 1. +bpm0l09YP , -576.3 , 1. +bpm0l09YM , -616.0 , 1. +bpm0l10XP , 334.3 , 1. +bpm0l10XM , 366.2 , 1. +bpm0l10YP , 349.4 , 1. +bpm0l10YM , 302.5 , 1. +BPM0r01XP , 1914.3 , 1.0 +BPM0r01XM , 2019.5 , 1.0 +BPM0r01YP , 1786.1 , 1.0 +BPM0r01YM , 2379.9 , 1.0 +BPM0r01aXP , -1 , 1.0 +BPM0r01aXM , -1 , 1.0 +BPM0r01aYP , -1 , 1.0 +BPM0r01aYM , -1 , 1.0 +bpm0r03XP , -163.2 , 1. +bpm0r03XM , -549.4 , 1. +bpm0r03YP , 325.9 , 1. +bpm0r03YM , 384.5 , 1. +bpm0r04XP , 488.1 , 1. +bpm0r04XM , 442.6 , 1. +bpm0r04YP , -59.3 , 1. +bpm0r04YM , 36.6 , 1. +bpm0r05XP , -236.1 , 1. +bpm0r05XM , -288.7 , 1. +bpm0r05YP , -1193.8 , 1. +bpm0r05YM , -1088.4 , 1. +bpm0r06XP , 276.8 , 1. +bpm0r06XM , 701.3 , 1. +bpm0r06YP , 768.6 , 1. +bpm0r06YM , 738.3 , 1. +BCM0l02, -1989.81, 0.00150841 +Batery6 , -2.496e+06 , 1.0 +Batery7 , -5.735e+06 , 1.0 +Batext1 , -7.740e+06 , 1.0 +Batext2 , -3.733e+06 , 1.0 +PhaseMo , 0.0 1 , !END diff --git a/Parity/prminput/prexinj_helicity.4000-.map b/Parity/prminput/prexinj_helicity.4000-.map new file mode 100644 index 000000000..d3e073908 --- /dev/null +++ b/Parity/prminput/prexinj_helicity.4000-.map @@ -0,0 +1,83 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=8 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +MarkerWord=0x00003103 + +! +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END From d84930c251d27e1aa02d4dc6c2c96dde9603af61 Mon Sep 17 00:00:00 2001 From: Hall A Online Date: Mon, 30 Jul 2018 10:31:15 -0400 Subject: [PATCH 4/6] Fix in the CMakeLists to ensure that the QwDatabase is not included in the source list even if the MySQL libraries are found. Eventually the full DB support ought to be (optionally) re-enabled, but for now there are still missing classes. --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 026d78f84..f65b9103b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,9 +99,11 @@ IF(MYSQLPP_FOUND) ## KLUDGE: For now, do not define the __USE_DATABASE__ flag, because we're still missing some of the database support files. --- P.King, 05jun2018 message("-- The \"__USE_DATABASE__\" flag is commented out in CMakeLists.txt; database support is DISABLED.") # add_definitions(-D__USE_DATABASE__) - list(APPEND my_project_sources - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDatabase.cc - ) + # list(APPEND my_project_sources + # ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDatabase.cc + # ) + message("-- Forcing MYSQLPP_LIBRARIES to \"\".") + SET(MYSQLPP_LIBRARIES "") ELSE(MYSQLPP_FOUND) SET(MYSQLPP_LIBRARIES "") endif(MYSQLPP_FOUND) From 38d277f2587db5b24dae5162ac7828cb9eeda575 Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Wed, 1 Aug 2018 16:48:09 -0400 Subject: [PATCH 5/6] ClassDef needed for root6 as well. increased the if check. suggest removing it all-together --- Analysis/include/QwF1TDContainer.h | 8 ++++---- Analysis/include/QwPromptSummary.h | 4 ++-- Analysis/include/QwSIS3320_Samples.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Analysis/include/QwF1TDContainer.h b/Analysis/include/QwF1TDContainer.h index 13a6cb186..5ef2d4fa2 100755 --- a/Analysis/include/QwF1TDContainer.h +++ b/Analysis/include/QwF1TDContainer.h @@ -241,7 +241,7 @@ class QwF1TDC : public TObject UInt_t GetTotal(UInt_t* error_counter); - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(QwF1TDC,1); #endif @@ -377,7 +377,7 @@ class QwF1TDContainer : public TObject Bool_t CheckSlot20Chan30(Int_t slot, Int_t chan); - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(QwF1TDContainer,1); #endif @@ -461,7 +461,7 @@ class F1TDCReferenceSignal : public TObject void Clear() { fRefTimeArbUnit = (Double_t) fNoRefTimeArbUnit; fFirstHitFlag = false;}; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(F1TDCReferenceSignal,1); #endif @@ -506,7 +506,7 @@ class F1TDCReferenceContainer : public TObject private: TString fSystemName; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(F1TDCReferenceContainer,1); #endif diff --git a/Analysis/include/QwPromptSummary.h b/Analysis/include/QwPromptSummary.h index e80e7f0d5..092103526 100755 --- a/Analysis/include/QwPromptSummary.h +++ b/Analysis/include/QwPromptSummary.h @@ -113,7 +113,7 @@ class PromptSummaryElement : public TObject /* Double_t fAsymmetryWidthError; */ /* TString fAsymmetryWidthUnit; */ - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(PromptSummaryElement,0); #endif @@ -179,7 +179,7 @@ class QwPromptSummary : public TObject Bool_t fLocalDebug; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(QwPromptSummary,0); #endif diff --git a/Analysis/include/QwSIS3320_Samples.h b/Analysis/include/QwSIS3320_Samples.h index 02a70ad4a..fb84183a3 100755 --- a/Analysis/include/QwSIS3320_Samples.h +++ b/Analysis/include/QwSIS3320_Samples.h @@ -137,7 +137,7 @@ class QwSIS3320_Samples: public TObject { size_t fTreeArrayIndex; //!< Index of this data element in tree size_t fTreeArrayNumEntries; //!< Number of entries from this data element - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(QwSIS3320_Samples,1); #endif }; From ed856f67602e4252421217a46c62de9f5cc85da8 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 3 Aug 2018 17:19:14 -0400 Subject: [PATCH 6/6] Removed the ROOT version test wrapper around the ClassDef calls. Deleted the ClassImp calls entirely (these were used by THtml, so are not needed anymore, I think). Slight cleanup in teh dictionary building section of the CMakeLists. This needs to be checked on the ifarm and Hall A cluster machines. --- Analysis/include/QwF1TDContainer.h | 17 +++++------------ Analysis/include/QwPromptSummary.h | 8 ++------ Analysis/include/QwSIS3320_Samples.h | 2 -- Analysis/src/QwF1TDContainer.cc | 7 ------- Analysis/src/QwPromptSummary.cc | 5 ----- Analysis/src/QwSIS3320_Samples.cc | 3 --- CMakeLists.txt | 7 +------ evio/include/THaCodaData.h | 4 +--- evio/include/THaCodaFile.h | 4 +--- evio/include/THaEtClient.h | 4 +--- 10 files changed, 11 insertions(+), 50 deletions(-) diff --git a/Analysis/include/QwF1TDContainer.h b/Analysis/include/QwF1TDContainer.h index 5ef2d4fa2..53e971cc2 100755 --- a/Analysis/include/QwF1TDContainer.h +++ b/Analysis/include/QwF1TDContainer.h @@ -241,9 +241,7 @@ class QwF1TDC : public TObject UInt_t GetTotal(UInt_t* error_counter); - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) - ClassDef(QwF1TDC,1); - #endif + ClassDef(QwF1TDC,1); }; @@ -377,9 +375,7 @@ class QwF1TDContainer : public TObject Bool_t CheckSlot20Chan30(Int_t slot, Int_t chan); - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) - ClassDef(QwF1TDContainer,1); - #endif + ClassDef(QwF1TDContainer,1); }; @@ -461,9 +457,7 @@ class F1TDCReferenceSignal : public TObject void Clear() { fRefTimeArbUnit = (Double_t) fNoRefTimeArbUnit; fFirstHitFlag = false;}; - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) - ClassDef(F1TDCReferenceSignal,1); - #endif + ClassDef(F1TDCReferenceSignal,1); }; @@ -506,9 +500,8 @@ class F1TDCReferenceContainer : public TObject private: TString fSystemName; - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) - ClassDef(F1TDCReferenceContainer,1); - #endif + + ClassDef(F1TDCReferenceContainer,1); }; diff --git a/Analysis/include/QwPromptSummary.h b/Analysis/include/QwPromptSummary.h index 092103526..bc94efd6f 100755 --- a/Analysis/include/QwPromptSummary.h +++ b/Analysis/include/QwPromptSummary.h @@ -113,9 +113,7 @@ class PromptSummaryElement : public TObject /* Double_t fAsymmetryWidthError; */ /* TString fAsymmetryWidthUnit; */ - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) - ClassDef(PromptSummaryElement,0); - #endif + ClassDef(PromptSummaryElement,0); }; @@ -179,9 +177,7 @@ class QwPromptSummary : public TObject Bool_t fLocalDebug; - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) - ClassDef(QwPromptSummary,0); - #endif + ClassDef(QwPromptSummary,0); }; diff --git a/Analysis/include/QwSIS3320_Samples.h b/Analysis/include/QwSIS3320_Samples.h index fb84183a3..d825691ea 100755 --- a/Analysis/include/QwSIS3320_Samples.h +++ b/Analysis/include/QwSIS3320_Samples.h @@ -137,9 +137,7 @@ class QwSIS3320_Samples: public TObject { size_t fTreeArrayIndex; //!< Index of this data element in tree size_t fTreeArrayNumEntries; //!< Number of entries from this data element - #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0) ClassDef(QwSIS3320_Samples,1); - #endif }; // Output stream operator<< for the samples diff --git a/Analysis/src/QwF1TDContainer.cc b/Analysis/src/QwF1TDContainer.cc index f9ee1261a..b7097ab94 100755 --- a/Analysis/src/QwF1TDContainer.cc +++ b/Analysis/src/QwF1TDContainer.cc @@ -15,13 +15,6 @@ * \date Tuesday, September 14 23:04:36 EDT 2010 */ -#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) -ClassImp(QwF1TDC); -ClassImp(QwF1TDContainer); -ClassImp(F1TDCReferenceSignal); -ClassImp(F1TDCReferenceContainer); -#endif - // // // diff --git a/Analysis/src/QwPromptSummary.cc b/Analysis/src/QwPromptSummary.cc index 46c69a6f2..1947c90f2 100755 --- a/Analysis/src/QwPromptSummary.cc +++ b/Analysis/src/QwPromptSummary.cc @@ -23,11 +23,6 @@ // // -#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) -ClassImp(PromptSummaryElement) -ClassImp(QwPromptSummary) -#endif - PromptSummaryElement::PromptSummaryElement() { fElementName = ""; diff --git a/Analysis/src/QwSIS3320_Samples.cc b/Analysis/src/QwSIS3320_Samples.cc index 60e0bdbe4..9e3e80a3d 100755 --- a/Analysis/src/QwSIS3320_Samples.cc +++ b/Analysis/src/QwSIS3320_Samples.cc @@ -15,9 +15,6 @@ */ #include "QwSIS3320_Samples.h" -#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) -ClassImp(QwSIS3320_Samples); -#endif // System headers #include diff --git a/CMakeLists.txt b/CMakeLists.txt index f65b9103b..cde1a328a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,8 +118,7 @@ link_directories(${Boost_LIBRARY_DIR}) add_definitions(-std=c++11) -# Create dictionaries for headers that contain "ClassDef" if ROOT version < 5.90 -#### if(ROOT_VERSION VERSION_LESS 5.90) +# Create dictionaries for headers that contain "ClassDef" message("Generating evio dictionaries for ROOT ${ROOT_VERSION}...") foreach(file ${my_evio_headers}) # Find the header files that have uncommented ClassDef lines @@ -173,10 +172,6 @@ foreach(file ${my_project_headers}) endif() endif() endforeach() -####else() -####message("No QwAnalysis dictionaries needed for ROOT ${ROOT_VERSION}.") -####endif() - # Add target of QwGitVersion.h add_custom_command( diff --git a/evio/include/THaCodaData.h b/evio/include/THaCodaData.h index 1471f831b..a87ca3ed4 100755 --- a/evio/include/THaCodaData.h +++ b/evio/include/THaCodaData.h @@ -52,9 +52,7 @@ class THaCodaData { int fStatus; // Status from CODA calls #ifndef STANDALONE - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(THaCodaData,0) // Base class of CODA data (file, ET conn, etc) - #endif + ClassDef(THaCodaData,0) // Base class of CODA data (file, ET conn, etc) #endif }; diff --git a/evio/include/THaCodaFile.h b/evio/include/THaCodaFile.h index 794b80015..445fc7397 100755 --- a/evio/include/THaCodaFile.h +++ b/evio/include/THaCodaFile.h @@ -62,9 +62,7 @@ class THaCodaFile : public THaCodaData TArrayI evlist, evtypes; #ifndef STANDALONE - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(THaCodaFile,0) // File of CODA data - #endif + ClassDef(THaCodaFile,0) // File of CODA data #endif }; diff --git a/evio/include/THaEtClient.h b/evio/include/THaEtClient.h index 73fbaf396..bfe42c0d7 100755 --- a/evio/include/THaEtClient.h +++ b/evio/include/THaEtClient.h @@ -94,9 +94,7 @@ class THaEtClient : public THaCodaData // use ClassDef if using rootcint #ifndef STANDALONE - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(THaEtClient,0) // ET client connection for online data - #endif + ClassDef(THaEtClient,0) // ET client connection for online data #endif };