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

ANtpSliceManipulator.cxx

Go to the documentation of this file.
00001 
00002 //$Id: ANtpSliceManipulator.cxx,v 1.1 2005/05/04 14:06:54 minoscvs Exp $
00003 //
00004 //ANtpSliceManipulator.cxx
00005 //
00006 //B. Rebel 10/2004
00008 
00009 #include "AnalysisNtuples/Module/ANtpSliceManipulator.h"
00010 #include "MessageService/MsgService.h"
00011 
00012 #include <cassert>
00013 #include <algorithm>
00014 
00015 ClassImp(ANtpSliceManipulator)
00016 
00017 CVSID("$Id: ANtpSliceManipulator.cxx,v 1.1 2005/05/04 14:06:54 minoscvs Exp $");
00018 
00019 //-------------------------------------------------------------------
00020 ANtpSliceManipulator::ANtpSliceManipulator() :
00021   fNtpSRSlice(0),
00022   fSliceArray(0),
00023   fStripArray(0)
00024 {    
00025   MSG("ANtpSliceManipulator", Msg::kDebug) << "ANtpSliceManipulator::Constructor" << endl; 
00026 }
00027 
00028 //-------------------------------------------------------------------
00029 void ANtpSliceManipulator::Initialize(TClonesArray  *sliceArray, TClonesArray *stripArray)
00030 {
00031   fSliceArray = sliceArray;
00032   fStripArray = stripArray;
00033   MSG("ANtpSliceManipulator", Msg::kDebug) << "ANtpSliceManipulator::Constructor" << endl;    
00034 }
00035 
00036 
00037 //----------------------------------------------------------------------
00038 ANtpSliceManipulator::~ANtpSliceManipulator()
00039 { 
00040   MSG("ANtpSliceManipulator", Msg::kDebug) << "ANtpSliceManipulator::Destructor" << endl; 
00041 }
00042 
00043 //------------------------------------------------------------------------
00044 NtpSRSlice *ANtpSliceManipulator::GetSlice()
00045 {
00046   return fNtpSRSlice;
00047 }
00048 
00049 
00050 //------------------------------------------------------------------------
00051 NtpSRStrip *ANtpSliceManipulator::GetStrip(Int_t index) 
00052 {
00053   NtpSRStrip *ntpStrip = 0;
00054 
00055   if(!fNtpSRSlice){
00056     MSG("ANtpSliceManipulator", Msg::kWarning) << "No NtpSRSlice to get a NtpSRStrip from"
00057                                                << " - returning empty pointer" << endl;
00058     return ntpStrip;
00059   }
00060   
00061   if(index < fNtpSRSlice->nstrip)
00062     ntpStrip = dynamic_cast<NtpSRStrip *>(fStripArray->At(fNtpSRSlice->stp[index]));
00063   
00064   return ntpStrip;
00065 }
00066 
00067 //--------------------------------------------------------------------------
00068 void ANtpSliceManipulator::SetSliceInSnarl(Int_t sliceIndex)
00069 {
00070   //check that such an event exists
00071   if(sliceIndex < fSliceArray->GetLast()+1) 
00072     fNtpSRSlice = dynamic_cast<NtpSRSlice *>(fSliceArray->At(sliceIndex));
00073   else{
00074     MSG("ANtpSliceManipulator", Msg::kWarning) << "invalid event index, set to first event in array" << endl;
00075     fNtpSRSlice = dynamic_cast<NtpSRSlice *>(fSliceArray->At(0));
00076   }
00077 
00078   return;
00079 }

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