00001
00002
00003
00004
00006
00007 #include <iostream>
00008 using namespace std;
00009
00010 #include "MessageService/MsgService.h"
00011 #include "CandNtupleSR/NtpSRCluster.h"
00012
00013 ClassImp(NtpSRCluster)
00014
00015 std::ostream& operator << (std::ostream& os, const NtpSRCluster& ntp)
00016 { return ntp.Print(os); }
00017
00018 CVSID("$Id: NtpSRCluster.cxx,v 1.3 2005/03/26 19:42:51 schubert Exp $");
00019
00020 void NtpSRCluster::AddStripAt(Int_t stripindex, Int_t ind) {
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 if ( ind < 0 || ind >= nstrip ) {
00034 MSG("NtpSR",Msg::kWarning)
00035 << "Attempt to add strip at index " << ind
00036 << " outside of array size " << nstrip << " ignored." << endl;
00037 return;
00038 }
00039
00040 stp[ind] = stripindex;
00041 return;
00042
00043 }
00044
00045 NtpSRCluster::NtpSRCluster(Int_t nstripinit): index(0),planeview(0),nplane(0),
00046 begplane(0),endplane(0),id(0),slc(0),ndigit(0),nstpcnt(nstripinit),
00047 nstrip(nstripinit),stp(0),probem(0),zvtx(0),tposvtx(0),slope(0),
00048 avgdev(0) {
00049
00050
00051 if ( nstrip ) {
00052 stp = new Int_t[nstrip];
00053 for ( Int_t i = 0; i < nstrip; i++ ) stp[i] = -1;
00054 }
00055 else {
00056 MSG("NtpSR",Msg::kWarning) << "NtpSRCluster called with nstrip = 0" << endl;
00057 }
00058
00059 }
00060
00061 std::ostream& NtpSRCluster::Print(std::ostream& os) const {
00062
00063
00064
00065
00066 os << "NtpSRCluster::Print" << endl;
00067 os << "index " << index << " slc " << slc << " ndigit " << ndigit
00068 << " nstpcnt " << nstpcnt << " nstrip " << nstrip << " planeview "
00069 << planeview << " id " << id << endl;
00070 os << "plane(n,beg,end)(" << nplane << "," << begplane << ","
00071 << endplane << ")" << " vtx(z,tpos)(" << zvtx << ","
00072 << tposvtx << ") slope " << slope
00073 << " avgdev " << avgdev << endl;
00074 os << ph;
00075 return os;
00076
00077 }
00078
00079 void NtpSRCluster::Print(Option_t* ) const {
00080
00081
00082
00083
00084
00085
00086 Print(std::cout);
00087 return;
00088
00089 }