00001 00002 // AlgCalDetSI 00003 // 00004 // A class to fill CandCalDetSI 00005 // CalDetSI = "CalDet Specific Information" 00006 // 00007 // Tricia Vahle & Mike Kordosky 00008 // 00009 // Began: January 8, 2002 00010 // 00011 // About this class: 00012 // This class was originally designed to run on caldet data 00013 // taken without a beam trigger (the 2001 run). Most (99%) 00014 // of that data was crap due to asynchronous dead time, 00015 // poor beam focusing, etc. This class was used to skim the raw 00016 // data before any calibration or reconstruction and extract 00017 // some information on the event PID, dead chips, etc. That info 00018 // was made into a candidate: CandCalDetSI. 00019 // 00020 // The Cutter class read CandCalDetSI objects and made very simple 00021 // selections to extract the good events. 00022 // 00023 // With the advent of the beam trigger (2002) much of the original 00024 // motivation for this class was no longer relevant, because 00025 // 99% of that data was not crap. However, CalDetSI objects 00026 // are still used to extract caldet specific information from the data. 00027 // 00028 // Modified: many times since (this introduction modified 15 Feb, 2005) 00029 // 00031 00032 #ifndef ALGCALDETSI_H 00033 #define ALGCALDETSI_H 00034 #include <set> 00035 #include <vector> 00036 #include "Algorithm/AlgBase.h" 00037 #include "RawData/RawChannelId.h" 00038 00039 class RawDigitDataBlock; 00040 class RawDeadChipBlock; 00041 class RawOvershootBlock; 00042 class RawTOFBlock; 00043 class RawSnarlHeaderBlock; 00044 class RawDaqSnarlHeader; 00045 class RawVarcErrorInTfBlock; 00046 class RawChannelId; 00047 00048 class AlgCalDetSI : public AlgBase 00049 { 00050 00051 public: 00052 AlgCalDetSI(); //constructor 00053 virtual ~AlgCalDetSI(); //destructor 00054 00055 //get data and use CandCalDetSIHandle methods 00056 //to set CandCalDetSI member variables 00057 virtual void RunAlg(AlgConfig &ac, CandHandle &ch, CandContext &cx); 00058 00059 00060 private: 00061 Int_t fRunNumber; //the run number 00062 static Int_t fLastSnarlTick; //timestamp of last snarl 00063 static Int_t fLastSnarlSec; //timeframe of last snarl 00064 static Int_t fTimeFrame; //current timeframe 00065 RawDigitDataBlock *fRawDDB; 00066 RawDeadChipBlock *fRawDCB; 00067 RawOvershootBlock *fRawOSB; 00068 RawTOFBlock *fRawTOFB; 00069 RawSnarlHeaderBlock *fRawSDB;// MAK: 12 April, 2005 : not present in mc 00070 const RawDaqSnarlHeader* fRawDSH; // added due to above 00071 RawVarcErrorInTfBlock *fRawVErrB; 00072 00073 static RawChannelId kCerenkovChannel1; 00074 static RawChannelId kCerenkovChannel2; 00075 static RawChannelId kCerenkovChannel3; 00076 static RawChannelId kTriggerPMTChannel; 00077 static RawChannelId kTofADCChannel0; 00078 static RawChannelId kTofADCChannel1; 00079 static RawChannelId kTofADCChannel2; 00080 static RawChannelId kTofTimeStampChannel; 00081 static std::vector<RawChannelId> kTriggerORs; // VARC LEMO inputs 00082 static UInt_t kGoodTriggerORBits; // VARC LEMO inputs 00083 static const Int_t kNTIMEBLOCKS; 00084 static std::set<Int_t> fVarcErrSet;//a set to hold timeblocks with varc errors 00085 00086 void SetDataPointers(CandContext &cx); //set the above pointers 00087 void FillVarcErrs(); //fill the set of varc errors 00088 Bool_t IsCosmic(const RawChannelId&) const; 00089 00090 ClassDef(AlgCalDetSI, 4) //macro to rootify 00091 00092 }; 00093 00094 inline Bool_t AlgCalDetSI::IsCosmic(const RawChannelId& id) const 00095 { 00096 // returns kTRUE if the channel corresponds to a cosmic counter 00097 // returns kFALSE otherwise 00098 00099 Bool_t rvalue = kFALSE; 00100 Int_t varc = id.GetVarcId(); 00101 Int_t vmm = id.GetVmm(); 00102 Int_t vaadc = id.GetVaAdcSel(); 00103 //if we find a Cosmic Counter hit, event fails cut, return false 00104 if((varc==0||varc==1)&&vmm==5&&vaadc==0){ 00105 rvalue = kTRUE; 00106 } 00107 return rvalue; 00108 } 00109 00110 #endif // ALGCALDETSI_H 00111 00112 00113 00114 00115