PEGainStripHisto Class Reference

#include <PEGainStripHisto.h>

List of all members.

Public Member Functions

 PEGainStripHisto ()
virtual ~PEGainStripHisto ()
void AddToNearEnd (Int_t adc, const PlexStripEndId &seid, Int_t box=0, Int_t led=0, Int_t height=0)
void AddToFarEnd (Int_t adc, const PlexStripEndId &seid, Int_t box=0, Int_t led=0, Int_t height=0)
PlexStripEndId GetStripEndId () const
TH1F * GetNearHisto ()
TH1F * GetFarHistop ()
void WriteHistos (TFile *fp) const
void FillHistos ()

Private Attributes

PlexStripEndId fSeid
TH1F * fHistNear
TH1F * fHistFar
Int_t fEncodedStrip
Int_t fTempNearHits
Int_t fTempFarHits
Int_t fTempFarSum
Int_t fTempNearSum
Char_t fFarHistName [80]
Char_t fNearHistName [80]

Detailed Description

Definition at line 13 of file PEGainStripHisto.h.


Constructor & Destructor Documentation

PEGainStripHisto::PEGainStripHisto (  ) 

Definition at line 17 of file PEGainStripHisto.cxx.

References Msg::kVerbose, and MSG.

00018    :fHistNear(0),fHistFar(0),fEncodedStrip(-1),fTempNearHits(0),fTempFarHits(0),fTempFarSum(0),fTempNearSum(0)//,fBestSide(-1)
00019 {
00020 
00021    MSG("PEGain",Msg::kVerbose) << "PEGainStripHisto::PEGainStripHisto()\n";
00022 
00023 }

PEGainStripHisto::~PEGainStripHisto (  )  [virtual]

Definition at line 26 of file PEGainStripHisto.cxx.

References fHistFar, fHistNear, Msg::kVerbose, and MSG.

00027 {
00028    MSG("PEGain",Msg::kVerbose) << "PEGainStripHisto::~PEGainStripHisto()\n";
00029    if(fHistFar) delete fHistFar;
00030    if(fHistNear) delete fHistNear;
00031 
00032 }


Member Function Documentation

void PEGainStripHisto::AddToFarEnd ( Int_t  adc,
const PlexStripEndId seid,
Int_t  box = 0,
Int_t  led = 0,
Int_t  height = 0 
)

Definition at line 63 of file PEGainStripHisto.cxx.

References PlexStripEndId::BuildPlnStripEndKey(), fEncodedStrip, fFarHistName, fHistFar, fSeid, fTempFarHits, fTempFarSum, PlexStripEndId::GetEnd(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), Msg::kVerbose, and MSG.

00068 {
00069    MSG("PEGain",Msg::kVerbose) << "PEGainStripHisto::AddToFarEnd()\n";
00070    if(fEncodedStrip==-1) {
00071       fSeid=seid;
00072       fEncodedStrip=seid.BuildPlnStripEndKey();
00073    }
00074    else assert(seid.BuildPlnStripEndKey()==fEncodedStrip);
00075    
00076    if(!fHistFar) {
00077       Char_t histname[80];
00078       sprintf(histname,"pl%d_st%d_end%d_box%d_led%d_h%d",
00079               seid.GetPlane(), seid.GetStrip(),
00080               int(seid.GetEnd()), box,led,height);
00081       sprintf(fFarHistName,"%s",histname);
00082       
00083       fHistFar = new TH1F(histname,histname,17000,-500.5,16499.5);
00084    }
00085    fTempFarHits++;
00086    fTempFarSum+=adc;
00087    //fHistFar->Fill(adc);
00088 
00089 }

void PEGainStripHisto::AddToNearEnd ( Int_t  adc,
const PlexStripEndId seid,
Int_t  box = 0,
Int_t  led = 0,
Int_t  height = 0 
)

Definition at line 34 of file PEGainStripHisto.cxx.

References PlexStripEndId::BuildPlnStripEndKey(), fEncodedStrip, fHistNear, fNearHistName, fSeid, fTempNearHits, fTempNearSum, PlexStripEndId::GetEnd(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), Msg::kVerbose, and MSG.

00039 {
00040    MSG("PEGain",Msg::kVerbose) << "PEGainStripHisto::AddToNearEnd( "
00041                                << adc  << " , " << seid << " , " 
00042                                << box << " , " << led  << " , "
00043                                << height << " )\n";
00044    if(fEncodedStrip==-1) {
00045       fSeid=seid;
00046       fEncodedStrip=seid.BuildPlnStripEndKey();
00047    }
00048    else assert(seid.BuildPlnStripEndKey()==fEncodedStrip);
00049    
00050    if(!fHistNear) {
00051       Char_t histname[80];
00052       sprintf(histname,"pl%d_st%d_end%d_box%d_led%d_h%d",
00053               seid.GetPlane(), seid.GetStrip(),
00054               int(seid.GetEnd()), box,led,height);
00055       sprintf(fNearHistName,"%s",histname);
00056       fHistNear = new TH1F(histname,histname,17000,-500.5,16499.5);
00057    }
00058    //fHistNear->Fill(adc);
00059    fTempNearHits++;
00060    fTempNearSum+=adc;
00061 }

void PEGainStripHisto::FillHistos (  ) 

Definition at line 90 of file PEGainStripHisto.cxx.

References fFarHistName, fHistFar, fHistNear, fNearHistName, fTempFarHits, fTempFarSum, fTempNearHits, fTempNearSum, Msg::kVerbose, and MSG.

00090                                   {
00091    MSG("PEGain",Msg::kVerbose) 
00092       << "PEGainStripHisto::FillHistos() for histos " 
00093       << fFarHistName << " & " << fNearHistName << "\n";
00094    if(fTempFarHits>0) {
00095       fHistFar->Fill(fTempFarSum);
00096       fTempFarHits=0;
00097       fTempFarSum=0;
00098    }
00099    if(fTempNearHits>0) {
00100       fHistNear->Fill(fTempNearSum);
00101       fTempNearHits=0;
00102       fTempNearSum=0;
00103    }
00104 }

TH1F* PEGainStripHisto::GetFarHistop (  )  [inline]

Definition at line 25 of file PEGainStripHisto.h.

References fHistFar.

00025 {return fHistFar;}

TH1F* PEGainStripHisto::GetNearHisto (  )  [inline]

Definition at line 24 of file PEGainStripHisto.h.

References fHistNear.

00024 {return fHistNear;}

PlexStripEndId PEGainStripHisto::GetStripEndId (  )  const [inline]

Definition at line 23 of file PEGainStripHisto.h.

References fSeid.

00023 {return fSeid;}

void PEGainStripHisto::WriteHistos ( TFile *  fp  )  const

Definition at line 107 of file PEGainStripHisto.cxx.

References fHistFar, and fHistNear.

00107                                                   {
00108    fp->cd();
00109    if(fHistFar) fHistFar->Write();
00110    if(fHistNear) fHistNear->Write();
00111 }


Member Data Documentation

Definition at line 55 of file PEGainStripHisto.h.

Referenced by AddToFarEnd(), and AddToNearEnd().

Char_t PEGainStripHisto::fFarHistName[80] [private]

Definition at line 60 of file PEGainStripHisto.h.

Referenced by AddToFarEnd(), and FillHistos().

TH1F* PEGainStripHisto::fHistFar [private]
TH1F* PEGainStripHisto::fHistNear [private]
Char_t PEGainStripHisto::fNearHistName[80] [private]

Definition at line 61 of file PEGainStripHisto.h.

Referenced by AddToNearEnd(), and FillHistos().

Definition at line 48 of file PEGainStripHisto.h.

Referenced by AddToFarEnd(), AddToNearEnd(), and GetStripEndId().

Definition at line 57 of file PEGainStripHisto.h.

Referenced by AddToFarEnd(), and FillHistos().

Definition at line 58 of file PEGainStripHisto.h.

Referenced by AddToFarEnd(), and FillHistos().

Definition at line 56 of file PEGainStripHisto.h.

Referenced by AddToNearEnd(), and FillHistos().

Definition at line 59 of file PEGainStripHisto.h.

Referenced by AddToNearEnd(), and FillHistos().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1