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

NtpSRSlice.cxx

Go to the documentation of this file.
00001 
00002 // NtpSRSlice
00003 //
00004 // NtpSRSlice is an ntuple class to hold the slice data
00005 //
00007 
00008 #include <iostream>
00009 using namespace std;
00010 
00011 #include "MessageService/MsgService.h"
00012 #include "CandNtupleSR/NtpSRSlice.h"
00013 
00014 ClassImp(NtpSRSlice)
00015 
00016 std::ostream& operator << (std::ostream& os, const NtpSRSlice& ntp) 
00017                                      { return ntp.Print(os); }
00018 
00019 CVSID("$Id: NtpSRSlice.cxx,v 1.7 2005/03/26 19:42:51 schubert Exp $");
00020 
00021 NtpSRSlice::NtpSRSlice(Int_t nstripinit):index(0),ndigit(0),
00022        nstpcnt(nstripinit),nstrip(nstripinit),stp(0) {
00023   // Purpose: Normal constructor
00024   //
00025 
00026   if ( nstrip ) {
00027     stp = new Int_t[nstrip]; 
00028     for ( Int_t i = 0; i < nstrip; i++ ) stp[i] = -1;
00029   }
00030 
00031 }
00032 
00033 void NtpSRSlice::AddStripAt(Int_t stripindex, Int_t ind) {
00034   //
00035   //  Purpose:  Add stripindex to stp array at position ind.
00036   //
00037   //  Arguments: stripindex: index of strip in assoc record strip TClonesArray.
00038   //             ind: index in stp array, cannot exceed bounds
00039   //                  0->nstrip-1.
00040   //
00041   //  Return:  none.
00042   //
00043   //  Contact:   S. Kasahara
00044   // 
00045 
00046   if ( ind < 0 || ind >= nstrip ) {
00047     MSG("NtpSR",Msg::kWarning) 
00048       << "Attempt to add strip at index " << ind
00049       << "outside of array size " << nstrip << "ignored." << endl;
00050     return;
00051   }
00052     
00053   stp[ind] = stripindex;
00054   return;
00055     
00056 }
00057 
00058 std::ostream& NtpSRSlice::Print(std::ostream& os) const {
00059   //
00060   //  Purpose:  Print slice data on ostream.
00061   //
00062 
00063   os << "NtpSRSlice::Print" << endl;
00064   os << "index " << index << " ndigit " << ndigit << " nstpcnt " << nstpcnt 
00065      << " nstrip " << nstrip << "\nplane" << plane 
00066      << "ph" << ph;
00067 
00068   return os;
00069 
00070 }
00071 
00072 void NtpSRSlice::Print(Option_t* /* option */) const {
00073   //
00074   //  Purpose:  Print slice in form supported by TObject::Print.
00075   //
00076   //  Arguments: option (not used)
00077   //
00078 
00079   Print(std::cout);
00080   return;
00081 
00082 }
00083 

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