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

NtpSRShower.h

Go to the documentation of this file.
00001 
00002 //
00003 // NtpSRShower
00004 //
00005 // NtpSRShower is an ntuple class to hold shower data
00006 //
00007 // Based Roy Lee's CandEventSR/ShowerSRTTree class
00009 
00010 #ifndef NTPSRSHOWER_H
00011 #define NTPSRSHOWER_H
00012 
00013 #include <iosfwd> // ostream fwd decl'
00014 
00015 #include "CandNtupleSR/NtpSRVertex.h"
00016 #include "CandNtupleSR/NtpSRPlane.h"
00017 #include "CandNtupleSR/NtpSRShowerPulseHeight.h"
00018 #include "CandNtupleSR/NtpSRSubShowerSummary.h"
00019 
00020 class NtpSRShower;
00021 std::ostream &operator << (std::ostream& os, const NtpSRShower& shower);
00022 
00023 class NtpSRShower : public TObject {
00024 
00025  public:
00026   NtpSRShower(): index(0),slc(0),ndigit(0),nstpcnt(0),nstrip(0),stp(0),
00027                         stpu(0),stpv(0),stpx(0),stpy(0),stpz(0),
00028                         stpph0sigmap(0),stpph0mip(0),stpph0gev(0),
00029                         stpph1sigmap(0),stpph1mip(0),stpph1gev(0),
00030                         stpattn0c0(0),stpattn1c0(0),
00031                         stpt0(0),stpt1(0),stptcal0t0(0),stptcal1t0(0),
00032                         nUcluster(0),nVcluster(0),ncluster(0),clu(0),contained(0) {} // def const'r
00033   NtpSRShower(Int_t nstripinit,Int_t nclusterinit=0); // normal const'r
00034 
00035   virtual ~NtpSRShower() { this -> Clear(); }
00036 
00037   // State testing methods
00038   virtual std::ostream& Print(std::ostream& os) const;
00039   virtual void Print(Option_t* option = "") const; 
00040 
00041   // State changing methods
00042   void AddStripAt(Int_t stripindex, Int_t ind);
00043   void AddClusterAt(Int_t clusterindex, Int_t ind);
00044   void Clear(Option_t* = "") { ClearStrips(); ClearClusters(); }
00045   void ClearStrips();
00046   void ClearClusters() { ncluster = 0; if ( clu ) delete [] clu; clu = 0; }
00047 
00048   void SetPh(Float_t sigmap,Float_t mip,Float_t gev,
00049              UInt_t istrip,UShort_t iend);
00050   void SetTime(Double_t time, UInt_t istrip, UShort_t iend);
00051   void SetCalT0(Double_t calt0, UInt_t istrip, UShort_t iend);
00052   void SetAttnC0(Double_t attnc0, UInt_t istrip, UShort_t iend);
00053 
00054  private:
00055   // Avoid copy and assignment ctor by making them private and w/no imp
00056   NtpSRShower(const NtpSRShower& that);
00057   NtpSRShower& operator=(const NtpSRShower& that);
00058   
00059  public:
00060   // Ntuple is treated like a C-struct with public data members and
00061   // rule-breaking field data members not prefaced by "f" and all
00062   // lowercase, by popular demand.
00063 
00064   UShort_t index; // index of this shower in shower array
00065   Short_t slc;    // index of associated slice in slice array
00066   Int_t ndigit;   // number of digits in shower
00067   // nstpcnt will represent the number of strips in track even in "slim"
00068   // ntuple output file for which nstrip is set to 0 and the strip
00069   // array (stp) has been deleted.
00070   Int_t nstpcnt;  // number of strips in shower
00071   Int_t nstrip;   // number of strips in strip array
00072   Int_t* stp;     //[nstrip]  indices to associated strips in strip array
00073   Float_t *stpu;        //[nstrip] U-position of track at strip plane (m) 
00074   Float_t *stpv;        //[nstrip] V-position of track at strip plane (m)
00075   Float_t *stpx;        //[nstrip] Z-position of track at strip plane (m)
00076   Float_t *stpy;        //[nstrip] Y-position of track at strip plane (m)
00077   Float_t *stpz;        //[nstrip] Z-position of track at strip plane (m)
00078   Float_t *stpph0sigmap;//[nstrip] ph corrected for fiber attenuation (east)
00079   Float_t *stpph0mip;   //[nstrip] ph in MIPs      (east)
00080   Float_t *stpph0gev;   //[nstrip] ph in GeV       (east)
00081   Float_t *stpph1sigmap;//[nstrip] ph corrected for fiber attenuation (west)
00082   Float_t *stpph1mip;   //[nstrip] ph in MIPs      (west)
00083   Float_t *stpph1gev;   //[nstrip] ph in GeV       (west)
00084   Float_t *stpattn0c0;  //[nstrip] C0 from mapper results (east)
00085   Float_t *stpattn1c0;  //[nstrip] C0 from mapper results (west)
00086   Double_t *stpt0; //[nstrip] 3-d time corr. for propagation delays (sec) (E)
00087   Double_t *stpt1; //[nstrip] 3-d time corr. for propagation delays (sec) (W)
00088   Double_t *stptcal0t0; //[nstrip] T0 offset (sec) (east)
00089   Double_t *stptcal1t0; //[nstrip] T0 offset (sec) (west)
00090   Short_t nUcluster; // number of U clusters in shower
00091   Short_t nVcluster; // number of V clusters in shower
00092   Int_t  ncluster; // number of clusters in shower
00093   Int_t* clu;     //[ncluster]  indices to associated clusters in cluster array
00094   Int_t contained;
00095   NtpSRStripPulseHeight ph; // summed strip pulse height 
00096   NtpSRShowerPulseHeight shwph; // shower energy members 
00097   NtpSRPlane  plane;        // range of planes 
00098   NtpSRVertex vtx;          // vertex - not filled? 
00099   NtpSRSubShowerSummary sss; //subshower summary block
00100 
00101   ClassDef(NtpSRShower,12)
00102 };
00103 
00104 inline void NtpSRShower::SetTime(Double_t time, UInt_t istrip, UShort_t iend) {
00105   if ( (Int_t)istrip >= nstrip ) return; 
00106   if      ( iend == 0 ) stpt0[istrip] = time;
00107   else if ( iend == 1 ) stpt1[istrip] = time;
00108   return;
00109 }
00110 inline void NtpSRShower::SetCalT0(Double_t calt0, UInt_t istrip,UShort_t iend) {
00111   if ( (Int_t)istrip >= nstrip ) return; 
00112   if      ( iend == 0 ) stptcal0t0[istrip] = calt0;
00113   else if ( iend == 1 ) stptcal1t0[istrip] = calt0;
00114   return;
00115 }
00116 inline void NtpSRShower::SetAttnC0(Double_t attnc0,UInt_t istrip,UShort_t iend){
00117   if ( (Int_t)istrip >= nstrip ) return; 
00118   if      ( iend == 0 ) stpattn0c0[istrip] = attnc0;
00119   else if ( iend == 1 ) stpattn1c0[istrip] = attnc0;
00120   return;
00121 }
00122 inline void NtpSRShower::SetPh(Float_t sigmap, Float_t mip, Float_t gev, 
00123                                UInt_t istrip, UShort_t iend) {
00124   if ( (Int_t)istrip >= nstrip ) return; 
00125   if ( iend == 0 ) {
00126     stpph0sigmap[istrip] = sigmap;
00127     stpph0mip[istrip] = mip;
00128     stpph0gev[istrip] = gev;
00129   }
00130   else if ( iend == 1 ) {
00131     stpph1sigmap[istrip] = sigmap;
00132     stpph1mip[istrip] = mip;
00133     stpph1gev[istrip] = gev;
00134   }
00135   return;
00136 }
00137 
00138 #endif // NTPSRSHOWER_H

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