CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
hTimes< hTime > Class Template Reference

#include <Histograms.h>

Public Member Functions

void Fill (float t_True, float t_WC, float t_hitpos, int wheel_type, int sltype)
 
 hTimes (std::string name)
 
 hTimes (std::string name_, TFile *file)
 
hTime * WheelHistos (int wheel)
 
void Write ()
 
 ~hTimes ()
 

Private Attributes

TString name
 
std::shared_ptr< hTime > RPhi
 
std::shared_ptr< hTime > RZ
 
std::shared_ptr< hTime > W0
 
std::shared_ptr< hTime > W1
 
std::shared_ptr< hTime > W2
 

Detailed Description

template<class hTime>
class hTimes< hTime >

Definition at line 726 of file Histograms.h.

Constructor & Destructor Documentation

◆ hTimes() [1/2]

template<class hTime >
hTimes< hTime >::hTimes ( std::string  name)
inline

Definition at line 728 of file Histograms.h.

References hTimes< hTime >::name, hTimes< hTime >::RPhi, hTimes< hTime >::RZ, hTimes< hTime >::W0, hTimes< hTime >::W1, and hTimes< hTime >::W2.

728  {
729  RZ = std::make_shared<hTime>(name + "_RZ");
730  RPhi = std::make_shared<hTime>(name + "_RPhi");
731  W0 = std::make_shared<hTime>(name + "_Wheel0");
732  W1 = std::make_shared<hTime>(name + "_Wheel1");
733  W2 = std::make_shared<hTime>(name + "_Wheel2");
734  }
std::shared_ptr< hTime > RPhi
Definition: Histograms.h:788
std::shared_ptr< hTime > RZ
Definition: Histograms.h:787
TString name
Definition: Histograms.h:794
std::shared_ptr< hTime > W2
Definition: Histograms.h:791
std::shared_ptr< hTime > W0
Definition: Histograms.h:789
std::shared_ptr< hTime > W1
Definition: Histograms.h:790

◆ hTimes() [2/2]

template<class hTime >
hTimes< hTime >::hTimes ( std::string  name_,
TFile *  file 
)
inline

Definition at line 736 of file Histograms.h.

References geometryDiff::file, hist_helper::make_non_owning_cast(), hTimes< hTime >::name, hTimes< hTime >::RPhi, hTimes< hTime >::RZ, hTimes< hTime >::W0, hTimes< hTime >::W1, and hTimes< hTime >::W2.

736  {
737  name = name_.c_str();
738 
739  RZ = hist_helper::make_non_owning_cast<hTime>(file->Get(name + "_RZ"));
740  RPhi = hist_helper::make_non_owning_cast<hTime>(file->Get(name + "_RPhi"));
741  W0 = hist_helper::make_non_owning_cast<hTime>(file->Get(name + "_Wheel0"));
742  W1 = hist_helper::make_non_owning_cast<hTime>(file->Get(name + "_Wheel1"));
743  W2 = hist_helper::make_non_owning_cast<hTime>(file->Get(name + "_Wheel2"));
744  }
std::shared_ptr< T > make_non_owning_cast(TObject *iT)
Definition: Histograms.h:30
std::shared_ptr< hTime > RPhi
Definition: Histograms.h:788
std::shared_ptr< hTime > RZ
Definition: Histograms.h:787
TString name
Definition: Histograms.h:794
std::shared_ptr< hTime > W2
Definition: Histograms.h:791
std::shared_ptr< hTime > W0
Definition: Histograms.h:789
std::shared_ptr< hTime > W1
Definition: Histograms.h:790

◆ ~hTimes()

template<class hTime >
hTimes< hTime >::~hTimes ( )
inline

Definition at line 746 of file Histograms.h.

746  {
747  // delete RZ;
748  // delete RPhi;
749  // delete W0;
750  // delete W1;
751  // delete W2;
752  }

Member Function Documentation

◆ Fill()

template<class hTime >
void hTimes< hTime >::Fill ( float  t_True,
float  t_WC,
float  t_hitpos,
int  wheel_type,
int  sltype 
)
inline

Definition at line 754 of file Histograms.h.

References hTimes< hTime >::RPhi, hTimes< hTime >::RZ, and hTimes< hTime >::WheelHistos().

754  {
755  if (sltype == 2)
756  RZ->Fill(t_True, t_WC, t_hitpos);
757  else
758  RPhi->Fill(t_True, t_WC, t_hitpos);
759  WheelHistos(wheel_type)->Fill(t_True, t_WC, t_hitpos);
760  }
std::shared_ptr< hTime > RPhi
Definition: Histograms.h:788
std::shared_ptr< hTime > RZ
Definition: Histograms.h:787
hTime * WheelHistos(int wheel)
Definition: Histograms.h:770

◆ WheelHistos()

template<class hTime >
hTime* hTimes< hTime >::WheelHistos ( int  wheel)
inline

Definition at line 770 of file Histograms.h.

References funct::abs(), definitions::NULL, hTimes< hTime >::W0, hTimes< hTime >::W1, hTimes< hTime >::W2, and makeMuonMisalignmentScenario::wheel.

Referenced by hTimes< hTime >::Fill().

770  {
771  switch (abs(wheel)) {
772  case 0:
773  return W0;
774 
775  case 1:
776  return W1;
777 
778  case 2:
779  return W2;
780 
781  default:
782  return NULL;
783  }
784  }
std::shared_ptr< hTime > W2
Definition: Histograms.h:791
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::shared_ptr< hTime > W0
Definition: Histograms.h:789
std::shared_ptr< hTime > W1
Definition: Histograms.h:790

◆ Write()

template<class hTime >
void hTimes< hTime >::Write ( )
inline

Definition at line 762 of file Histograms.h.

References hTimes< hTime >::RPhi, hTimes< hTime >::RZ, hTimes< hTime >::W0, hTimes< hTime >::W1, and hTimes< hTime >::W2.

762  {
763  RZ->Write();
764  RPhi->Write();
765  W0->Write();
766  W1->Write();
767  W2->Write();
768  }
std::shared_ptr< hTime > RPhi
Definition: Histograms.h:788
std::shared_ptr< hTime > RZ
Definition: Histograms.h:787
std::shared_ptr< hTime > W2
Definition: Histograms.h:791
std::shared_ptr< hTime > W0
Definition: Histograms.h:789
std::shared_ptr< hTime > W1
Definition: Histograms.h:790

Member Data Documentation

◆ name

template<class hTime >
TString hTimes< hTime >::name
private

◆ RPhi

template<class hTime >
std::shared_ptr<hTime> hTimes< hTime >::RPhi
private

◆ RZ

template<class hTime >
std::shared_ptr<hTime> hTimes< hTime >::RZ
private

◆ W0

template<class hTime >
std::shared_ptr<hTime> hTimes< hTime >::W0
private

◆ W1

template<class hTime >
std::shared_ptr<hTime> hTimes< hTime >::W1
private

◆ W2

template<class hTime >
std::shared_ptr<hTime> hTimes< hTime >::W2
private