00001
00002
00003
00004
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
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
00036
00037
00038
00039
00040
00041
00042
00043
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
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* ) const {
00073
00074
00075
00076
00077
00078
00079 Print(std::cout);
00080 return;
00081
00082 }
00083