emcClusterContentv1S.C

Go to the documentation of this file.
00001 #include "emcClusterContentv1S.h"
00002 
00003 ClassImp(emcClusterContentv1S)
00004 
00005   using namespace std;
00006 
00007 //_____________________________________________________________________________
00008 emcClusterContentv1S::emcClusterContentv1S() :
00009   fTowerid(0),
00010   fPartesum(0)
00011 {
00012   Reset();
00013 }
00014 
00015 //_____________________________________________________________________________
00016 emcClusterContentv1S::emcClusterContentv1S(const emcClusterContentv1S& to)
00017   : fTowerid(0),
00018     fPartesum(0)
00019 {
00020   to.copy(*this);
00021 }
00022 
00023 //_____________________________________________________________________________
00024 emcClusterContentv1S&
00025 emcClusterContentv1S::operator=(const emcClusterContentv1S& to)
00026 {
00027   if ( this != &to ) 
00028     {
00029       Reset();
00030       to.copy(*this);
00031     }
00032   return *this;
00033 }
00034 
00035 //_____________________________________________________________________________
00036 emcClusterContentv1S*
00037 emcClusterContentv1S::clone(void) const
00038 {
00039   return new emcClusterContentv1S(*this);
00040 }
00041 
00042 //_____________________________________________________________________________
00043 emcClusterContentv1S*
00044 emcClusterContentv1S::create(void) const
00045 {
00046   return new emcClusterContentv1S;
00047 }
00048 
00049 //_____________________________________________________________________________
00050 emcClusterContentv1S::~emcClusterContentv1S()
00051 {
00052   Clear();
00053 }
00054 
00055 //_____________________________________________________________________________
00056 void emcClusterContentv1S::Clear(Option_t*)
00057 {
00058   delete[] fPartesum;
00059   fPartesum=0;
00060   delete[] fTowerid;
00061   fTowerid=0;
00062 }
00063 
00064 //_____________________________________________________________________________
00065 void
00066 emcClusterContentv1S::copy(emcClusterContentv1S& to) const
00067 {
00068   to.fDeadmap = fDeadmap;
00069   to.fWarnmap = fWarnmap;
00070   to.fCutword = fCutword;
00071 
00072   to.fArm = fArm;
00073   to.fId = fId;
00074   to.fMultiplicity = fMultiplicity;
00075   to.fPid = fPid;
00076   to.fSector = fSector;
00077   to.fIypos = fIypos;
00078   to.fIzpos = fIzpos;
00079   to.fType = fType;
00080 
00081   to.fX = fX;
00082   to.fY = fY;
00083   to.fZ = fZ;
00084   to.fDx = fDx;
00085   to.fDy = fDy;
00086   to.fDz = fDz;
00087   to.fDispy = fDispy;
00088   to.fDispz = fDispz;
00089   to.fE = fE;
00090   to.fE9 = fE9;
00091   to.fEcent = fEcent;
00092   to.fEcore = fEcore;
00093   to.fEtofmin = fEtofmin;
00094   to.fEtofmax = fEtofmax;
00095   to.fChi2 = fChi2;
00096   to.fQuality = fQuality;
00097   to.fPadispy = fPadispy;
00098   to.fPadispz = fPadispz;
00099   to.fProb_photon = fProb_photon;
00100   to.fPhi = fPhi;
00101   to.fSimFrac = fSimFrac;
00102   to.fTof = fTof;
00103   to.fTofHad = fTofHad;
00104   to.fTofmin = fTofmin;
00105   to.fTofmax = fTofmax;
00106   to.fTofcorr = fTofcorr;
00107   to.fTofcorrmin = fTofcorrmin;
00108   to.fTofcorrmax = fTofcorrmax;
00109   to.fTofdisp = fTofdisp; // typo??
00110   to.fTheta = fTheta;
00111 
00112   to.fYcg = fYcg;
00113   to.fZcg = fZcg;
00114 
00115   to.fCorrDispy = fCorrDispy;
00116   to.fCorrDispz = fCorrDispz;
00117 
00118   to.femcpc3         = femcpc3       ;
00119   to.femcpc3neartrk  = femcpc3neartrk;
00120   to.femcpc3dz       = femcpc3dz     ;
00121   to.femcpc3dphi     = femcpc3dphi   ;
00122   to.femctrk         = femctrk       ;
00123   to.femctrkdz       = femctrkdz     ;
00124   to.femctrkdphi     = femctrkdphi   ;
00125   to.fpemctrk        = fpemctrk      ;
00126   to.femctrkquality  = femctrkquality;
00127 
00128   to.Clear();
00129 
00130   to.fTowerid = new int[to.fMultiplicity];
00131   to.fPartesum = new float[to.fMultiplicity];
00132   for ( int i = 0; i < to.fMultiplicity; ++i )
00133     {
00134       to.fTowerid[i] = fTowerid[i];
00135       to.fPartesum[i] = fPartesum[i];
00136     }
00137 }
00138 
00139 //_____________________________________________________________________________
00140 void
00141 emcClusterContentv1S::identify(std::ostream& os) const
00142 {
00143   os << "emcClusterContentv1S::identify" << endl;
00144 }
00145 
00146 //_____________________________________________________________________________
00147 int
00148 emcClusterContentv1S::isValid() const
00149 {
00150   return 1;
00151 } 
00152  
00153 //_____________________________________________________________________________
00154 float
00155 emcClusterContentv1S::partesum(int index) const
00156 {
00157   if (index>=0 && index<fMultiplicity)
00158     {
00159       return fPartesum[index];
00160     }
00161   else
00162     {
00163       cerr << "emcClusterContentv1S::partesum : index out of bounds ("
00164            << index << " out of " << fMultiplicity << ")" << endl;
00165       return 0;
00166     }
00167 }
00168 
00169 //_____________________________________________________________________________
00170 void
00171 emcClusterContentv1S::print(std::ostream& out) const
00172 { 
00173   std::ostream::fmtflags oldflags = out.flags();
00174   
00175   out << "ARM " << arm() << " SECT " << sector()
00176       << " ID " << id() << " TYPE " << type()
00177       << " POS(Z,Y) " << izpos() << " " << iypos()
00178       << " MULT " << multiplicity() 
00179       << endl;
00180   out.setf(ios::scientific);
00181   out.precision(3);
00182   out << " (X,Y,Z)" << x() << " " << y() << " " << z() 
00183       << " (CY,CZ)" << ycg() << " " << zcg() 
00184       << endl
00185       << " (THETA,PHI)" << theta() << " " << phi() 
00186       << endl
00187       << " (E,ECENT,ECORE) " << e() << " " << ecent() << " " << ecore() 
00188       << endl
00189       << " (SIMFRAC) " << simfrac()
00190       << endl
00191       << " (TOF,min,max,disp) " << tof() << " " << tofmin() << " " << tofmax()
00192       << " " << tofdisp()
00193       << endl
00194       << " CHI2 " << chi2() 
00195       << endl
00196       << " DISP(Z,Y) " << " " << dispz() << " " << dispy()
00197       << " PADISP(Z,Y) " << " " << padispz() << " " << padispy() 
00198       << endl   
00199       << " CORRDISP(Z,Y) " << " " << corrdispz() << " " << corrdispy()
00200       << endl;
00201 
00202   out.setf(oldflags);
00203   out << " Dead " << deadmap() << " Warn " << warnmap()
00204       << endl;
00205   out.setf(oldflags);
00206 }
00207 
00208 //_____________________________________________________________________________
00209 void
00210 emcClusterContentv1S::Reset()
00211 {
00212   fArm=-1;
00213   fChi2=0;
00214   fDeadmap=0;
00215   fDispy=0;
00216   fDispz=0;
00217   fE=fE9=fEcent=fEcore=fEtofmin=fEtofmax=0;
00218   fId=0;
00219   fQuality=0;
00220   fMultiplicity=0;
00221   fPadispy=fPadispz=0;
00222   fProb_photon=0;
00223   fPhi=0;
00224   fPid=0;
00225   fSector=0;
00226   fTof=fTofHad=fTofmin=fTofmax=0;
00227   fTofcorr=fTofcorrmin=fTofcorrmax=0;
00228   fTofdisp=0;
00229   fTheta=0;
00230   fType=0;
00231   fWarnmap=0;
00232   fX=fY=fZ=0;
00233   fDx=fDy=fDz=0;
00234   fIypos=fIzpos=0;
00235   fYcg=fZcg=0;
00236   fCutword=0;
00237   fCorrDispy=fCorrDispz=0;
00238   femcpc3         = -100;
00239   femcpc3neartrk  = -100;
00240   femcpc3dz       = -100;
00241   femcpc3dphi     = -100;
00242   femctrk         = -100;
00243   femctrkdz       = -100;
00244   femctrkdphi     = -100;
00245   fpemctrk        = -100;
00246   femctrkquality  = -100;
00247   fSimFrac = 0;
00248 
00249   Clear();
00250 }
00251 
00252 //_____________________________________________________________________________
00253 int
00254 emcClusterContentv1S::towerid(int index) const
00255 {
00256   if (index>=0 && index<fMultiplicity)
00257     {
00258       return fTowerid[index];
00259     }
00260   else
00261     {
00262       cerr << "emcClusterContentv1S::towerid : index out of bounds ("
00263            << index << " out of " << fMultiplicity << ")" << endl;
00264       return 0;
00265     }
00266 }
00267 
00268 //_____________________________________________________________________________
00269 void
00270 emcClusterContentv1S::set_multiplicity(int mul)
00271 {
00272   fMultiplicity=mul;
00273 
00274   Clear();
00275 
00276   fTowerid = new int[fMultiplicity];
00277   for (int i = 0; i < fMultiplicity; ++i )
00278     {
00279       fTowerid[i]=-1;
00280     }
00281   fPartesum = new float[fMultiplicity];
00282   for (int i = 0; i < fMultiplicity; ++i )
00283     {
00284       fPartesum[i]=0.0;
00285     }
00286 }
00287 
00288 //_____________________________________________________________________________
00289 void
00290 emcClusterContentv1S::set_partesum(int index, float value)
00291 {
00292   if ( !fPartesum ) 
00293     {
00294       cerr << "emcClusterContentv1S::set_partesum : internal array is null."
00295            << " Did you forgot to specify the multiplicity ?"
00296            << endl;
00297       return;
00298     }
00299 
00300   if (index>=0 && index<fMultiplicity)
00301     {
00302       fPartesum[index] = value;
00303     }
00304   else
00305     {
00306       cerr << "emcClusterContentv1S::set_partesum : index out of bounds ("
00307            << index << " out of " << fMultiplicity << ")" << endl;
00308     }
00309 }
00310 
00311 //_____________________________________________________________________________
00312 void
00313 emcClusterContentv1S::set_towerid(int index, int value)
00314 { 
00315   if ( !fTowerid ) 
00316     {
00317       cerr << "emcClusterContentv1S::set_towerid : internal array is null."
00318            << " Did you forgot to specify the multiplicity ?"
00319            << endl;
00320       return;
00321     }
00322 
00323   if (index>=0 && index<fMultiplicity)
00324     {
00325       fTowerid[index] = value;
00326     }
00327   else
00328     {
00329       cerr << "emcClusterContentv1S::set_towerid : index out of bounds ("
00330            << index << " out of " << fMultiplicity << ")" << endl;
00331     }
00332 }
00333 
00334 
00335 
00336 
00337 
00338