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

NtpSREvent.h

Go to the documentation of this file.
00001 
00002 //
00003 // NtpSREvent
00004 //
00005 // NtpSREvent is an ntuple class to hold event data
00006 //
00007 // Based on Roy Lee's CandEventSR/EventSRTTree class
00009 
00010 #ifndef NTPSREVENT_H
00011 #define NTPSREVENT_H
00012 
00013 #include <iosfwd> // ostream fwd decl'
00014 #include "CandNtupleSR/NtpSRVertex.h"
00015 #include "CandNtupleSR/NtpSRPlane.h"
00016 #include "CandNtupleSR/NtpSRBleach.h"
00017 #include "CandNtupleSR/NtpSRWindow.h"
00018 #include "CandNtupleSR/NtpSRStripPulseHeight.h"
00019 
00020 class NtpSREvent;
00021 std::ostream &operator << (std::ostream& os, const NtpSREvent& event);
00022 
00023 class NtpSREvent : public TObject {
00024 
00025  public:
00026   NtpSREvent(): index(0),slc(0),ndigit(0),nstpcnt(0),nstrip(0),stp(0),
00027        stpph0sigmap(0),stpph0mip(0),stpph0gev(0),stpph1sigmap(0),
00028        stpph1mip(0),stpph1gev(0),nshower(0),shw(0),ntrack(0),trk(0),
00029        contained(1) {} // def const'r
00030   NtpSREvent(Int_t nstripinit,Int_t nshowerinit, Int_t ntrackinit); 
00031   virtual ~NtpSREvent() { this -> Clear(); }
00032 
00033   // State testing methods
00034   virtual std::ostream& Print(std::ostream& os) const;
00035   virtual void Print(Option_t* option = "") const; 
00036 
00037   // State changing methods
00038   void AddStripAt(Int_t stripindex,Int_t ind);
00039   void AddShowerAt(Int_t showerindex,Int_t ind);
00040   void AddTrackAt(Int_t trackindex,Int_t ind);
00041 
00042   void Clear(Option_t* = "") { ClearStrips(); 
00043                                nshower = 0; if ( shw ) delete [] shw; shw = 0;
00044                                ntrack = 0; if ( trk ) delete [] trk; trk = 0; }
00045   void ClearStrips() { nstrip = 0; if ( stp ) delete [] stp; stp = 0; }
00046 
00047   void SetPh(Float_t sigmap,Float_t mip,Float_t gev,
00048              UInt_t istrip,UShort_t iend);
00049 
00050  public:
00051   // Ntuple is treated like a C-struct with public data members and
00052   // rule-breaking field data members not prefaced by "f" and all
00053   // lowercase, by popular demand.
00054 
00055   UShort_t index; // index of this event in event array
00056   Short_t slc;    // index of associated slice in slice array
00057   Int_t ndigit;   // number of digits in event
00058   // nstpcnt will represent the number of strips in track even in "slim"
00059   // ntuple output file for which nstrip is set to 0 and the strip
00060   // array (stp) has been deleted.
00061   Int_t nstpcnt;  // number of strips in event
00062   Int_t nstrip;   // number of strips in strip array
00063   Int_t* stp;     //[nstrip] indices to associated strips in strip array
00064   Float_t* stpph0sigmap;//[nstrip] ph corrected for fiber attenuation (east)
00065   Float_t* stpph0mip;   //[nstrip] ph in MIPs      (east)
00066   Float_t* stpph0gev;   //[nstrip] ph in GeV       (east)
00067   Float_t* stpph1sigmap;//[nstrip] ph corrected for fiber attenuation (west)
00068   Float_t* stpph1mip;   //[nstrip] ph in MIPs      (west)
00069   Float_t* stpph1gev;   //[nstrip] ph in GeV       (west)
00070   Int_t nshower;  // number of showers in event
00071   Int_t* shw;     //[nshower] indices to associated showers in shower array
00072   Int_t ntrack;   // number of tracks in event
00073   Int_t* trk;     //[ntrack] indices to associated tracks in track array
00074   Int_t primshw;  // index to primary shower in shw array
00075   // Further description of primshw from Jim's commit notes:
00076   // Normally, this index is zero (primary is first element of array).  
00077   // However, if the index is less than 0, no shower is identified as the 
00078   // primary.  In the current primary shower algorithm, this means that 
00079   // there are no showers either with energies greater than 2 GeV, or, if 
00080   // a track exists, with a vertex within 0.5 m of the track vertex.
00081   Int_t primtrk;  // index to primary track in trk array
00082   Int_t contained;
00083 
00084   NtpSRStripPulseHeight ph; // summed strip pulse height
00085   NtpSRPlane    plane;    // range of planes 
00086   NtpSRVertex   vtx;      // vertex  
00087   NtpSRVertex   end;      // event end point, set to end of primary track
00088   NtpSRBleach   bleach;   // values used to cut low ph near detector evts
00089   NtpSRWindow   win;      // total+unassigned charge info in pln+time window around evt
00090 
00091   ClassDef(NtpSREvent,8)
00092 };
00093 
00094 inline void NtpSREvent::SetPh(Float_t sigmap, Float_t mip, Float_t gev,
00095                                UInt_t istrip, UShort_t iend) {
00096   if ( (Int_t)istrip >= nstrip ) return;
00097   if ( iend == 0 ) {
00098     stpph0sigmap[istrip] = sigmap;
00099     stpph0mip[istrip] = mip;
00100     stpph0gev[istrip] = gev;
00101   }
00102   else if ( iend == 1 ) {
00103     stpph1sigmap[istrip] = sigmap;
00104     stpph1mip[istrip] = mip;
00105     stpph1gev[istrip] = gev;
00106   }
00107   return;
00108 }
00109 
00110 #endif // NTPSREVENT_H

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