00001 #include <TMath.h> 00002 #include "MessageService/MsgService.h" 00003 #include "SimElectronics.h" 00004 00005 CVSID("$Id: SimElectronics.cxx,v 1.7 2005/02/02 16:00:32 tagg Exp $"); 00006 ClassImp(SimElectronics) 00007 00008 SimElectronics::SimElectronics ( VldContext context, TRandom* random ) 00009 : fContext(context), 00010 fRandom(random) 00011 { 00012 if(random == NULL) fRandom = gRandom; 00013 this->Reset(context); 00014 } 00015 00016 00017 void SimElectronics::SetRandom( TRandom* random ) 00018 { 00019 if(random) fRandom = random; 00020 else fRandom = gRandom; 00021 } 00022 00023 void SimElectronics::Reset( const VldContext& context ) 00024 { 00025 // Do anything that needs doing to reset the electronics 00026 // between events. 00027 // This also should activate the update of any database tables 00028 // that the class uses. 00029 00030 fContext = context; 00031 fDigits.clear(); 00032 for(UInt_t i = 0; i<fSignals.size(); i++) delete fSignals[i]; 00033 fSignals.clear(); 00034 00035 fDigitsAfterFETrigger = 0; 00036 fDigitsAfterSpars = 0; 00037 fAdcsAfterFETrigger = 0; 00038 fAdcsAfterSpars = 0; 00039 } 00040 00041 void SimElectronics::AddDigit( SimDigit& digit ) 00042 { 00043 fDigits.push_back(digit); 00044 MSG("DetSim",Msg::kVerbose) 00045 << "SimElectronics read out digit: " 00046 << digit.AsString() << std::endl;; 00047 } 00048 00049 void SimElectronics::ReadoutDetector( SimPmtList& ) 00050 { 00051 // Read out the detector. 00052 // It is the Electronics job to read out only those 00053 // PMTs which are wired to the electronics type in question 00054 // (for mixed cases like CalDet). 00055 // Results are SimDigits: to enter a valid SimDigit, 00056 // use SimElectronics::AddDigit(digit); 00057 00058 MSG("DetSim",Msg::kError) << "Error: SimElectronics() is a base class." 00059 << " Detector is not being read out! " << endl; 00060 } 00061 00062 00063 void 00064 SimElectronics::Print( Option_t* ) const 00065 { 00066 printf(" SimElectronics: Dummy Electronics.\n"); 00067 } 00068 00069 void 00070 SimElectronics::Config( Registry& ) 00071 { 00072 // Modify the configuration. 00073 // 00074 // Use this method to set static members with the class configuration. 00075 }
1.3.9.1