Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawLILooker.cxx

Go to the documentation of this file.
00001 
00002 
00003 #include "LISummary/RawLILooker.h"
00004 #include "JobControl/JobCModuleRegistry.h"
00005 #include "JobControl/JobCommand.h"
00006 #include "MessageService/MsgService.h"
00007 #include "MinosObjectMap/MomNavigator.h"
00008 #include "CandDigit/CandDigitListHandle.h"
00009 #include "CandDigit/CandDigitHandle.h"
00010 #include "Algorithm/AlgFactory.h"
00011 #include "Algorithm/AlgHandle.h"
00012 #include "CandData/CandRecord.h"
00013 #include "CandData/CandHeader.h"
00014 #include "Candidate/CandContext.h"
00015 #include "Navigation/NavKey.h"
00016 #include "Navigation/NavSet.h"
00017 #include "Conventions/PlaneView.h"
00018 #include "CandTrackSR/CandTrackSR.h"
00019 #include "Navigation/XxxItr.h"
00020 #include "RecoBase/CandTrackHandle.h"
00021 #include "RecoBase/CandTrackListHandle.h"
00022 #include "RawData/RawLIAdcSummary.h"
00023 
00024 #include "RawData/RawLIAdcSummaryBlock.h"
00025 #include "RawData/RawRecord.h"
00026 #include "RawData/RawLIHeader.h" 
00027 #include "Plex/PlexHandle.h"
00028 #include "Plex/PlexSEIdAltL.h"
00029 #include "Plex/Plexus.h"
00030 #include "TParticle.h"
00031 #include "TFile.h"
00032 #include "TH1.h"
00033 #include "TH2.h"
00034 #include "TClonesArray.h"
00035 
00036 ClassImp(RawLILooker)
00037 
00038 
00039 // Declare this module to JobControll. Arguments are:
00040 //  (1) The class name 
00041 //  (2) The human-readable name 
00042 //  (3) A short, human-readable description of what the module does
00043 JOBMODULE(RawLILooker,"RawLILooker","A module used for looking at LI stuff");
00044 
00045 //......................................................................
00046 RawLILooker::RawLILooker() {
00047 
00048   // Constructor stuff..
00049 
00050   //MSG("JobC", Msg::kDebug) << "RawLILooker::Constructor" << endl;
00051  }
00052 
00053 //----------------------------------------------------------------------
00054 RawLILooker::~RawLILooker()
00055 {
00056 // Destructor
00057 
00058   //MSG("JobC", Msg::kDebug) << "RawLILooker::Destructor" << endl;
00059 }
00060 
00061 void RawLILooker::BeginJob()
00062 {
00063 
00064 }
00065 
00066 
00067 int RawLILooker::GetPixel(Int_t vachannel)
00068 {
00069   Int_t pixelmap[] = {-1, -1, 15, 1, 16, 2, 11, 5, 12, 
00070                        6, 7, 9, 8, 10, 3, 14, 4, 13};
00071  
00072   return pixelmap[vachannel];
00073 }
00074 
00075 
00076 //......................................................................
00077 JobCResult RawLILooker::Ana(const MomNavigator *mom)
00078 {
00079   JobCResult result(JobCResult::kPassed);
00080 
00081   // Check that mom exists.
00082   assert(mom);
00083   
00084   // Find Raw Record in MOM
00085   RawRecord *rawrec = dynamic_cast<RawRecord *>
00086     (mom->GetFragment("RawRecord"));
00087   
00088 
00089   //Get LI Summary block from rawdatablock
00090   const RawLIAdcSummaryBlock *rawLIadcblock = 
00091     dynamic_cast<const RawLIAdcSummaryBlock*>
00092     (rawrec->FindRawBlock("RawLIAdcSummaryBlock"));
00093   
00094   if (rawrec == 0) {
00095     result.SetError().SetFailed();
00096     return result;
00097   }
00098   
00099   // Work through  rawliadcblock..  
00100   if(rawLIadcblock){  
00101 
00102     //unused: Int_t crate;
00103     //unused: Int_t chAd;
00104     
00105     Double_t mean;
00106     Double_t rms;
00107     Int_t no_entries;
00108     Int_t timesec;
00109     Int_t timens;
00110     
00111     Int_t calibtype;
00112     Int_t calibpoint;
00113     Int_t pulserbox;
00114     Int_t led;
00115     Int_t pulseheight;
00116     Int_t pulsewidth;
00117     Int_t pulses;
00118     Int_t period;
00119 
00120     
00121     timesec =0;
00122 
00123     
00124     timesec = rawLIadcblock->GetTimeStamp().GetSec();
00125     timens = rawLIadcblock->GetTimeStamp().GetNanoSec();
00126     calibpoint = rawLIadcblock->GetCalibPoint();
00127     calibtype = rawLIadcblock->GetCalibType();
00128     pulserbox = rawLIadcblock->GetPulserBox();
00129     led = rawLIadcblock->GetLed();
00130     pulseheight = rawLIadcblock->GetPulseHeight();
00131     pulsewidth = rawLIadcblock->GetPulseWidth();
00132     pulses = rawLIadcblock->GetPulses();
00133     period = rawLIadcblock->GetPeriod();
00134     
00135     detector.validity = rawLIadcblock->GetVldContext();
00136     
00137 
00138     detector.Update(led,
00139                     pulseheight,
00140                     pulsewidth,
00141                     pulserbox,
00142                     calibpoint,
00143                     rawLIadcblock->GetTimeStamp(),
00144                     calibtype,
00145                     pulses,
00146                     period);
00147 
00148     //Work through all summaries
00149     for(Int_t n=0;n<rawLIadcblock->GetNumberOfSummaries();n++){
00150       const RawLIAdcSummary *rawLIadcsummary = rawLIadcblock->At(n);
00151       
00152       mean = rawLIadcsummary->GetMean();
00153       rms = rawLIadcsummary->GetRms();
00154       no_entries = rawLIadcsummary->GetEntries();
00155 
00156       detector.AddEntry(rawLIadcsummary->GetChannel(),mean,rms,no_entries);
00157       
00158     }
00159 
00160 
00161     
00162     return result;
00163     
00164   }
00165 
00166   return result;
00167 }
00168 
00169 //......................................................................
00170 
00171 void RawLILooker::Help() 
00172 {
00173   // MSG("JobC", Msg::kInfo) 
00174   // << "RawLILooker::Help\n"
00175   //  << endl;
00176 }
00177 
00178 void RawLILooker::EndJob() 
00179 {
00180  
00181   //Stuff to do at end of job
00182   
00183   return;
00184 }
00185 
00186 

Generated on Mon Jun 16 14:58:25 2008 for loon by  doxygen 1.3.9.1