AlignmentStripHistograms Class Reference

#include <AlignmentStripHistograms.h>

List of all members.

Public Member Functions

 AlignmentStripHistograms (TDirectory *ResidualDir, TDirectory *ChargeDir, TDirectory *AttenDir, TDirectory *OccupancyDir, TDirectory *RotResDir, const AlignmentStrip &astrip)
virtual ~AlignmentStripHistograms ()
void FillHistograms (const AlignmentStrip &astrip)
TH1D * GetChargeHistogram () const
TH1D * GetChargePathCorrHistogram () const
TH1D * GetResidualHistogram () const
TH1D * GetOccupancyHistogram () const
TProfile * GetAttenHistogram () const
TProfile * GetAttenPigCorrHistogram () const
TProfile * GetRotationalHistogram () const

Private Member Functions

TH1D * InitChargeHistogram (TDirectory *dir)
TH1D * InitPathCorrChargeHistogram (TDirectory *dir)
TH1D * InitResidualHistogram (TDirectory *dir)
TH1D * InitOccupancyHistogram (TDirectory *dir)
TProfile * InitAttenHistogram (TDirectory *dir)
TProfile * InitRotResidualHistogram (TDirectory *dir)
TProfile * InitPigtailAttenHistogram (TDirectory *dir)

Private Attributes

const int fPlane
const int fStrip
const UInt_t fPlexSEId
const double fLength
const double fPigTail
TH1D * fhCharge
TH1D * fhChargePathCorr
TH1D * fhResidual
TH1D * fhOccupancy
TProfile * fpAtten
TProfile * fpAttenPigCorr
TProfile * fpRotationalResidual
const Int_t fNChargeBins
const Int_t fNResidualBins
const Double_t fChargeLimit
const Double_t fResidualLimit
const Double_t fOccupancyBinWidth
const Double_t fAttenuationBinWidth
const Double_t fRotationalResidualBinWidth

Detailed Description

Definition at line 30 of file AlignmentStripHistograms.h.


Constructor & Destructor Documentation

AlignmentStripHistograms::AlignmentStripHistograms ( TDirectory *  ResidualDir,
TDirectory *  ChargeDir,
TDirectory *  AttenDir,
TDirectory *  OccupancyDir,
TDirectory *  RotResDir,
const AlignmentStrip astrip 
)

Definition at line 42 of file AlignmentStripHistograms.cxx.

References fhCharge, fhChargePathCorr, fhOccupancy, fhResidual, fpAtten, fpAttenPigCorr, fpRotationalResidual, InitAttenHistogram(), InitChargeHistogram(), InitOccupancyHistogram(), InitPathCorrChargeHistogram(), InitPigtailAttenHistogram(), InitResidualHistogram(), InitRotResidualHistogram(), Msg::kFatal, Msg::kVerbose, and MSG.

00048    :fPlane(astrip.plane),
00049     fStrip(astrip.strip),
00050     fPlexSEId(astrip.plexseid),
00051     fLength(astrip.length),
00052     fPigTail(astrip.pigtail),
00053     fhCharge(0),
00054     fhChargePathCorr(0), 
00055     fhResidual(0), 
00056     fhOccupancy(0),
00057     fpAtten(0),
00058     fpAttenPigCorr(0),
00059     fpRotationalResidual(0),
00060     fNChargeBins(200),
00061     fNResidualBins(60),
00062     fChargeLimit(5000.0),
00063     fResidualLimit(0.12),
00064     fOccupancyBinWidth(0.04),
00065     fAttenuationBinWidth(0.4),
00066     fRotationalResidualBinWidth(0.5)
00067 {
00068 
00069    MSG("Align", Msg::kVerbose) << "Constructor AlignmentStripHistograms() " << endl;
00070 
00071    if(!ResidualDir || !ChargeDir || !AttenDir || !OccupancyDir || !RotResDir)
00072    {
00073       MSG("Align", Msg::kFatal) << "AlignmentStripHistograms ctor: TDirectory pointer is zero." << endl;
00074       abort();
00075    }
00076 
00077    fhCharge             = InitChargeHistogram(ChargeDir);
00078    fhChargePathCorr     = InitPathCorrChargeHistogram(ChargeDir);
00079    fhResidual           = InitResidualHistogram(ResidualDir);
00080    fhOccupancy          = InitOccupancyHistogram(OccupancyDir);
00081    fpAtten              = InitAttenHistogram(AttenDir);
00082    fpAttenPigCorr       = InitPigtailAttenHistogram(AttenDir);
00083    fpRotationalResidual = InitRotResidualHistogram(RotResDir);
00084 }

AlignmentStripHistograms::~AlignmentStripHistograms (  )  [virtual]

Definition at line 223 of file AlignmentStripHistograms.cxx.

References Msg::kVerbose, and MSG.

00224 {
00225    MSG("Align", Msg::kVerbose) << "Destructor ~AlignmentStripHistograms()..." << endl;
00226 }


Member Function Documentation

void AlignmentStripHistograms::FillHistograms ( const AlignmentStrip astrip  ) 

Definition at line 88 of file AlignmentStripHistograms.cxx.

References AlignmentStrip::charge, AlignmentStrip::charge_pc, fhCharge, fhChargePathCorr, fhOccupancy, fhResidual, fpAtten, fpAttenPigCorr, fpRotationalResidual, AlignmentStrip::goodhit, AlignmentStrip::length, AlignmentStrip::lhitpos, AlignmentStrip::lposrelmdl, AlignmentStrip::pigtail, AlignmentStrip::residual, and AlignmentStrip::wlsbypass.

Referenced by AlignmentAlgorithm::Fill().

00089 {
00090    fhCharge         -> Fill(astrip.charge);
00091    fhChargePathCorr -> Fill(astrip.charge_pc);
00092    fhResidual       -> Fill(astrip.residual);
00093    fhOccupancy      -> Fill(astrip.lhitpos);
00094    
00095    if(!astrip.goodhit)
00096       return;
00097    
00098    fpRotationalResidual -> Fill(astrip.lhitpos+astrip.lposrelmdl, astrip.residual);
00099 
00100    if(astrip.wlsbypass > 0.001)
00101       return;
00102 
00103    fpAtten        -> Fill(fabs(astrip.lhitpos - astrip.length/2.0), astrip.charge_pc);
00104    fpAttenPigCorr -> Fill(astrip.pigtail + fabs(astrip.lhitpos - astrip.length/2.0), astrip.charge_pc);  
00105 }

TProfile* AlignmentStripHistograms::GetAttenHistogram (  )  const [inline]

Definition at line 51 of file AlignmentStripHistograms.h.

References fpAtten.

00051 {return fpAtten;};

TProfile* AlignmentStripHistograms::GetAttenPigCorrHistogram (  )  const [inline]

Definition at line 52 of file AlignmentStripHistograms.h.

References fpAttenPigCorr.

00052 {return fpAttenPigCorr;};

TH1D* AlignmentStripHistograms::GetChargeHistogram (  )  const [inline]

Definition at line 46 of file AlignmentStripHistograms.h.

References fhCharge.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00046 {return fhCharge;};

TH1D* AlignmentStripHistograms::GetChargePathCorrHistogram (  )  const [inline]

Definition at line 47 of file AlignmentStripHistograms.h.

References fhChargePathCorr.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00047 {return fhChargePathCorr;};

TH1D* AlignmentStripHistograms::GetOccupancyHistogram (  )  const [inline]

Definition at line 49 of file AlignmentStripHistograms.h.

References fhOccupancy.

00049 {return fhOccupancy;};

TH1D* AlignmentStripHistograms::GetResidualHistogram (  )  const [inline]

Definition at line 48 of file AlignmentStripHistograms.h.

References fhResidual.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00048 {return fhResidual;};

TProfile* AlignmentStripHistograms::GetRotationalHistogram (  )  const [inline]

Definition at line 53 of file AlignmentStripHistograms.h.

References fpRotationalResidual.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00053 {return fpRotationalResidual;};

TProfile * AlignmentStripHistograms::InitAttenHistogram ( TDirectory *  dir  )  [private]

Definition at line 164 of file AlignmentStripHistograms.cxx.

References fAttenuationBinWidth, fLength, fPlane, fStrip, Msg::kVerbose, and MSG.

Referenced by AlignmentStripHistograms().

00165 {       
00166    char name[100], title[100];
00167    int nbin = int(fLength/fAttenuationBinWidth);
00168    sprintf(name,"ProfileStripAtten%03d_%03d", fPlane, fStrip);
00169    sprintf(title,"Strip attenuation plane %03d and strip %03d", fPlane, fStrip);
00170    MSG("Align", Msg::kVerbose) << "Creating " << name << " histogram with "<< nbin << " bins"<<endl;
00171    TProfile *p = new TProfile(name, title, nbin, 0.0, fLength);
00172    p -> SetDirectory(dir);
00173    p -> GetXaxis() -> SetTitle("wls fiber length (m)");
00174    p -> GetXaxis() -> CenterTitle();
00175    p -> GetYaxis() -> SetTitle("charge (ADC)");
00176    p -> GetYaxis() -> CenterTitle();
00177    return p;
00178 }   

TH1D * AlignmentStripHistograms::InitChargeHistogram ( TDirectory *  dir  )  [private]

Definition at line 108 of file AlignmentStripHistograms.cxx.

References fChargeLimit, fNChargeBins, fPlane, fStrip, Msg::kVerbose, and MSG.

Referenced by AlignmentStripHistograms().

00109 {
00110    char name[100], title[100];
00111    sprintf(name,"ChargeInPlane%03dStrip%03d", fPlane, fStrip);
00112    sprintf(title,"Charge plane %03d, strip %03d", fPlane, fStrip);
00113    MSG("Align", Msg::kVerbose) << "Creating histogram " << name << endl;
00114    TH1D *h = new TH1D(name, title, fNChargeBins, 0, fChargeLimit);
00115    h -> SetDirectory(dir);
00116    h -> GetXaxis() -> SetTitle("Raw ADC");
00117    h -> GetXaxis() -> CenterTitle();      
00118    return h;
00119 }

TH1D * AlignmentStripHistograms::InitOccupancyHistogram ( TDirectory *  dir  )  [private]

Definition at line 150 of file AlignmentStripHistograms.cxx.

References fAttenuationBinWidth, fLength, fPlane, and fStrip.

Referenced by AlignmentStripHistograms().

00151 {
00152    int nbin = int(fLength/fAttenuationBinWidth);
00153    char name[100], title[100];
00154    sprintf(name,"OccupancyInPlane%03dStrip%03d", fPlane, fStrip);
00155    sprintf(title,"Longitudinal occupancy, plane %03d, strip %03d", fPlane, fStrip);
00156    TH1D *h = new TH1D(name, title, nbin, -fLength/2.0, fLength/2.0);
00157    h -> SetDirectory(dir);
00158    h -> GetXaxis() -> SetTitle("residual (m)");
00159    h -> GetXaxis() -> CenterTitle();
00160    return h;
00161 }

TH1D * AlignmentStripHistograms::InitPathCorrChargeHistogram ( TDirectory *  dir  )  [private]

Definition at line 122 of file AlignmentStripHistograms.cxx.

References fChargeLimit, fNChargeBins, fPlane, fStrip, Msg::kVerbose, and MSG.

Referenced by AlignmentStripHistograms().

00123 {
00124    char name[100], title[100];
00125    sprintf(name,"PathCorrChargeInPlane%03dStrip%03d", fPlane, fStrip);
00126    sprintf(title,"Path corrected charge plane %03d, strip %03d", fPlane, fStrip);
00127    MSG("Align", Msg::kVerbose) << "Creating histogram " << name << endl;
00128    TH1D *h = new TH1D(name, title, fNChargeBins, 0, fChargeLimit);
00129    h -> SetDirectory(dir);
00130    h -> GetXaxis() -> SetTitle("Raw ADC");
00131    h -> GetXaxis() -> CenterTitle();      
00132    return h;
00133 }

TProfile * AlignmentStripHistograms::InitPigtailAttenHistogram ( TDirectory *  dir  )  [private]

Definition at line 181 of file AlignmentStripHistograms.cxx.

References fAttenuationBinWidth, fLength, fPigTail, fPlane, fStrip, Msg::kVerbose, and MSG.

Referenced by AlignmentStripHistograms().

00182 {       
00183    char name[100], title[100];
00184    const int nbin = int(floor(fLength/fAttenuationBinWidth));
00185    sprintf(name,"ProfileStripPigAtten%03d_%03d", fPlane, fStrip);
00186    sprintf(title,"Strip attenuation plane %03d and strip %03d", fPlane, fStrip);
00187    MSG("Align", Msg::kVerbose) << "Creating " << name << " histogram with "<< nbin << " bins"<<endl;
00188    Double_t bins[10];
00189    bins[0] = 0.0;
00190    bins[1] = fPigTail;
00191    for(int i = 1; i <= 8; ++i)
00192    {
00193       double bin = i;
00194       bins[i+1] = bin*fAttenuationBinWidth + fPigTail;
00195    }
00196    TProfile *p = new TProfile(name, title, 9, bins);
00197    p -> SetDirectory(dir);
00198    p -> GetXaxis() -> SetTitle("wls fiber length (m)");
00199    p -> GetXaxis() -> CenterTitle();
00200    p -> GetYaxis() -> SetTitle("charge (ADC)");
00201    p -> GetYaxis() -> CenterTitle();
00202    return p;
00203 }   

TH1D * AlignmentStripHistograms::InitResidualHistogram ( TDirectory *  dir  )  [private]

Definition at line 136 of file AlignmentStripHistograms.cxx.

References fNResidualBins, fPlane, fResidualLimit, and fStrip.

Referenced by AlignmentStripHistograms().

00137 {
00138    char name[100], title[100];
00139    sprintf(name,"ResidualInPlane%03dStrip%03d", fPlane, fStrip);
00140    sprintf(title,"Residual in hit strip, plane %03d, strip %03d", fPlane, fStrip);
00141    TH1D *h = new TH1D(name, title, 2*fNResidualBins, -fResidualLimit, fResidualLimit);
00142    h -> SetDirectory(dir);
00143    h -> GetXaxis() -> SetTitle("residual (m)");
00144    h -> GetXaxis() -> CenterTitle();
00145    return h;
00146 }

TProfile * AlignmentStripHistograms::InitRotResidualHistogram ( TDirectory *  dir  )  [private]

Definition at line 206 of file AlignmentStripHistograms.cxx.

References fLength, fPlane, fRotationalResidualBinWidth, and fStrip.

Referenced by AlignmentStripHistograms().

00207 {
00208    char name[100], title[100];   
00209    sprintf(name,"RotResidualInPlane%03dStrip%03d", fPlane, fStrip);
00210    sprintf(title,"Profile rotational residuals plane %03d strip %03d", fPlane, fStrip);
00211    unsigned int nbin = int(floor(fLength/fRotationalResidualBinWidth));
00212    TProfile *p = new TProfile(name, title, nbin, -fLength/2.0, fLength/2.0);
00213    p -> SetDirectory(dir);
00214    p -> GetXaxis() -> SetTitle("position (m)");
00215    p -> GetXaxis() -> CenterTitle();
00216    p -> GetYaxis() -> SetTitle("residual (m)");
00217    p -> GetYaxis() -> CenterTitle();   
00218    return p;
00219 }


Member Data Documentation

const Double_t AlignmentStripHistograms::fChargeLimit [private]

Definition at line 91 of file AlignmentStripHistograms.h.

Referenced by InitChargeHistogram(), and InitPathCorrChargeHistogram().

const double AlignmentStripHistograms::fLength [private]

Definition at line 88 of file AlignmentStripHistograms.h.

Referenced by InitChargeHistogram(), and InitPathCorrChargeHistogram().

Definition at line 89 of file AlignmentStripHistograms.h.

Referenced by InitResidualHistogram().

Definition at line 93 of file AlignmentStripHistograms.h.

TProfile* AlignmentStripHistograms::fpAtten [private]
const double AlignmentStripHistograms::fPigTail [private]

Definition at line 75 of file AlignmentStripHistograms.h.

Referenced by InitPigtailAttenHistogram().

const int AlignmentStripHistograms::fPlane [private]
const UInt_t AlignmentStripHistograms::fPlexSEId [private]

Definition at line 73 of file AlignmentStripHistograms.h.

const Double_t AlignmentStripHistograms::fResidualLimit [private]

Definition at line 92 of file AlignmentStripHistograms.h.

Referenced by InitResidualHistogram().

Definition at line 95 of file AlignmentStripHistograms.h.

Referenced by InitRotResidualHistogram().

const int AlignmentStripHistograms::fStrip [private]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1