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

AlgDIConvert.cxx

Go to the documentation of this file.
00001 
00002 #include <cassert>
00003 
00004 #include "Calibrator/Calibrator.h"
00005 #include "CandData/CandRecord.h"
00006 #include "MuonRemoval/AlgDIConvert.h"
00007 #include "CandDigit/CandDigitHandle.h"
00008 #include "Candidate/CandContext.h"
00009 
00010 #include "MessageService/MsgService.h"
00011 #include "Plex/PlexHandle.h"
00012 #include "Plex/PlexSEIdAltL.h"
00013 #include "RawData/RawChannelId.h"
00014 #include "Validity/VldContext.h"
00015 
00016 #include "Algorithm/AlgConfig.h"
00017 
00018 #include "PmtMap.h"
00019 
00020 ClassImp(AlgDIConvert)
00021 
00022 CVSID("$Id: AlgDIConvert.cxx,v 1.2 2006/08/31 23:52:30 cbs Exp $");
00023 
00024 
00025 AlgDIConvert::AlgDIConvert()
00026 {
00027 }
00028 
00029 AlgDIConvert::~AlgDIConvert()
00030 {
00031 }
00032 
00033 void AlgDIConvert::RunAlg(AlgConfig & /*ac*/ , CandHandle &ch, CandContext &cx)
00034 {
00035  
00036   MSG("RmMu", Msg::kDebug) << " AlgDIConvert::RunAlg() " << endl;   
00037   assert(ch.InheritsFrom("CandDigitHandle"));
00038     
00039   //
00040   //Setup output digit
00041   //
00042   CandDigitHandle &digitout = (CandDigitHandle &) ch;
00043   
00044   //
00045   //Get the input data
00046   //
00047   const ElecChannel* input = dynamic_cast<const ElecChannel*>(cx.GetDataIn());
00048   if(input==NULL){
00049     MSG("RmMu", Msg::kError) << " Unable to get input data "<<endl;
00050     return;
00051   }
00052   
00053   //
00054   //Set up calibrator
00055   //
00056   Calibrator& calibrator = Calibrator::Instance();
00057   const VldContext &vldc = *(cx.GetCandRecord()->GetVldContext());
00058   calibrator.ReInitialise(vldc);
00059 
00060   //
00061   //Set the CandDigit parameters
00062   //
00063   
00064   // channel ID
00065   RawChannelId channel(input->rcid);
00066   digitout.SetChannelId(channel);
00067 
00068   // Charge
00069   Double_t adc_offset  = 0.;
00070   if (channel.GetElecType()==ElecType::kQIE) {
00071     adc_offset = 50.;
00072   }
00073   digitout.SetCharge(input->adc - adc_offset);
00074   
00075   // Time
00076   Double_t t = calibrator.GetTimeFromTDC(input->tdc, channel);
00077   digitout.SetTime(t);
00078 
00079   
00080   //
00081   //Plex solutions
00082   PlexHandle ph(vldc);
00083   PlexSEIdAltL altlist = ph.GetSEIdAltL(channel, 
00084                                         &(calibrator), 
00085                                         (int)(input->adc - adc_offset), 
00086                                         digitout.GetTime());
00087   digitout.SetPlexSEIdAltL(altlist);
00088   digitout.SetRawDigitIndex(input->index);
00089   
00090 }
00091 
00092 //______________________________________________________________________
00093 void AlgDIConvert::Trace(const char * /* c */) const
00094 {
00095 }

Generated on Mon Feb 15 11:06:17 2010 for loon by  doxygen 1.3.9.1