Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CalLog.cxx

Go to the documentation of this file.
00001 
00002 #include "digiRootData/CalLog.h"
00003 
00004 ClassImp(CalLog)
00005 
00006 CalLog::CalTrigMode CalLog::m_mode;
00007 
00008 CalLog::CalLog() {
00009     // Default constructor
00010     m_mode = ALLRANGE;
00011     m_log.setTag(UInt_t(0));
00012 }
00013 
00014 CalLog::CalLog(LogId &id) {
00015     m_mode = ALLRANGE;
00016     m_log.setTag(UInt_t(0));
00017     m_log = id;
00018 }
00019 
00020 CalLog::~CalLog() {
00021     // Destructor
00022 }
00023 
00024 Int_t CalLog::Compare(const TObject *obj) const {
00025     if (this == obj) return 0;
00026     if (CalLog::Class() != obj->IsA()) return -1;
00027     UInt_t id_this = m_log.getId();
00028     UInt_t id_hit = ((CalLog*)obj)->getLogId()->getId();
00029     if (id_this == id_hit)
00030         return 0;
00031     else
00032         return (id_this > id_hit) ? 1 : -1;
00033 }
00034 
00035 Bool_t CalLog::IsSortable() const {
00036     return kTRUE; 
00037 }
00038 
00039 Bool_t CalLog::setAdcValue(UShort_t newVal, LogFace face, AdcRange range) {
00040     // Allows user to set the ADC Value for a particular log end and 
00041     // digitization.  Returns kTRUE if successful, kFALSE if not.
00042     if (newVal & ~ADC_M_VAL) {
00043         return kFALSE;
00044     } 
00045     else {
00046         m_AdcValues[face * 4 + range] &= ~(ADC_M_VAL << ADC_V_VAL);
00047         m_AdcValues[face * 4 + range] |= newVal << ADC_V_VAL;
00048         //        m_AdcValues[end][gain] &= ~(ADC_M_VAL << ADC_V_VAL);
00049         //        m_AdcValues[end][gain] |= newVal << ADC_V_VAL;
00050         return kTRUE;
00051     }
00052 }
00053 
00054 Bool_t CalLog::setAdcId(UShort_t newVal, LogFace face, AdcRange range) {
00055     // Allows user to set the ADC ID for a particular log end and 
00056     // digitization.  Returns kTRUE if successful, kFALSE if not.
00057     if (newVal & ~ADC_M_VAL) {
00058         return kFALSE;
00059     } 
00060     else {
00061         m_AdcValues[face * 4 + range] &= ~(ADC_M_ID << ADC_V_ID);
00062         m_AdcValues[face * 4 + range] |= newVal << ADC_V_ID;
00063         //        m_AdcValues[end][gain] &= ~(ADC_M_ID << ADC_V_ID);
00064         //        m_AdcValues[end][gain] |= newVal << ADC_V_ID;
00065         return kTRUE;
00066     }
00067 }
00068 
00069 Bool_t CalLog::setAdcPinId(UShort_t newVal, LogFace face, AdcRange range) {
00070     // Allows user to set the ADC Pin ID for a particular log end and 
00071     // digitization.  Returns kTRUE if successful, kFALSE if not.
00072     if (newVal & ~ADC_M_VAL) {
00073         return kFALSE;
00074     } 
00075     else {
00076         m_AdcValues[face * 4 + range] &= ~(ADC_M_PIN << ADC_V_PIN);
00077         m_AdcValues[face * 4 + range] |= newVal << ADC_V_PIN;
00078         //        m_AdcValues[end][gain] &= ~(ADC_M_PIN << ADC_V_PIN);
00079         //        m_AdcValues[end][gain] |= newVal << ADC_V_PIN;
00080         return kTRUE;
00081     }
00082 }
00083 
00084 Bool_t CalLog::setAdcRangeScale(UShort_t newVal, LogFace face, AdcRange range) {
00085     // Allows user to set the ADC Range Scale for a particular log end and 
00086     // digitization.  Returns kTRUE if successful, kFALSE if not.
00087     if (newVal & ~ADC_M_VAL) {
00088         return kFALSE;
00089     } 
00090     else {
00091         m_AdcValues[face * 4 + range] &= ~(ADC_M_RS << ADC_V_RS);
00092         m_AdcValues[face * 4 + range] |= newVal << ADC_V_RS;
00093         //        m_AdcValues[end][gain] &= ~(ADC_M_RS << ADC_V_RS);
00094         //        m_AdcValues[end][gain] |= newVal << ADC_V_RS;
00095         return kTRUE;
00096     }
00097 }

Generated at Wed Nov 21 12:22:44 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000