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

NtpSRCluster.cxx

Go to the documentation of this file.
00001 
00002 // NtpSRCluster
00003 //
00004 // NtpSRCluster is an ntuple class to hold the cluster data
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   //  Purpose:  Add stripindex to fStripInd array at position ind.
00023   //
00024   //  Arguments: stripindex: index of strip in assoc fStrips TClonesArray. 
00025   //             ind: index in fStripInd array, cannot exceed bounds
00026   //                  0->fNStrip-1.
00027   //
00028   //  Return:  none.
00029   //
00030   //  Contact:   S. Kasahara
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   // Normal constructor
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   //  Purpose:  Print strip data on ostream.
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* /* option */) const {
00080   //
00081   //  Purpose:  Print strip in form supported by TObject::Print.
00082   //
00083   //  Arguments: option (not used)
00084   //
00085 
00086   Print(std::cout);
00087   return;
00088 
00089 }

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