CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Member Functions
HIPTrackMonitorVariables Class Reference

#include <HIPMonitorConfig.h>

Inheritance diagram for HIPTrackMonitorVariables:
HIPMonitorVariables

Public Member Functions

void bookBranches ()
 
void fill ()
 
 HIPTrackMonitorVariables (int maxNEvents_=-1, int maxTracksRcd_=-1)
 
- Public Member Functions inherited from HIPMonitorVariables
 HIPMonitorVariables ()
 
void setTree (TTree *tree_)
 
virtual ~HIPMonitorVariables ()
 

Public Attributes

std::vector< float > m_Chi2n
 
std::vector< float > m_d0
 
std::vector< float > m_dz
 
std::vector< float > m_Eta
 
std::vector< int > m_Nhits
 
std::vector< int > m_nhPXB
 
std::vector< int > m_nhPXF
 
std::vector< int > m_nhTEC
 
std::vector< int > m_nhTIB
 
std::vector< int > m_nhTID
 
std::vector< int > m_nhTOB
 
int m_Ntracks
 
std::vector< float > m_P
 
std::vector< float > m_Phi
 
std::vector< float > m_Pt
 
std::vector< float > m_wt
 
const int maxNEvents
 
const int maxTracksRcd
 
int nEvents
 
int nTracks
 

Protected Member Functions

void resetPerEvent ()
 
void resizeVectors (int NewSize)
 

Additional Inherited Members

- Protected Attributes inherited from HIPMonitorVariables
TTree * tree
 

Detailed Description

Definition at line 26 of file HIPMonitorConfig.h.

Constructor & Destructor Documentation

HIPTrackMonitorVariables::HIPTrackMonitorVariables ( int  maxNEvents_ = -1,
int  maxTracksRcd_ = -1 
)
inline

Member Function Documentation

void HIPTrackMonitorVariables::bookBranches ( )
virtual

Implements HIPMonitorVariables.

Definition at line 37 of file HIPMonitorConfig.cc.

Referenced by HIPAlignmentAlgorithm::bookRoot().

37  {
38  if (tree!=nullptr){
39  tree->Branch("Ntracks", &m_Ntracks);
40  tree->Branch("Nhits", &m_Nhits);
41  //tree->Branch("DataType", &m_datatype); This is done in HIPAlignmentAlgorithm
42  tree->Branch("nhPXB", &m_nhPXB);
43  tree->Branch("nhPXF", &m_nhPXF);
44  tree->Branch("nhTIB", &m_nhTIB);
45  tree->Branch("nhTOB", &m_nhTOB);
46  tree->Branch("nhTID", &m_nhTID);
47  tree->Branch("nhTEC", &m_nhTEC);
48  tree->Branch("Pt", &m_Pt);
49  tree->Branch("P", &m_P);
50  tree->Branch("Eta", &m_Eta);
51  tree->Branch("Phi", &m_Phi);
52  tree->Branch("Chi2n", &m_Chi2n);
53  tree->Branch("d0", &m_d0);
54  tree->Branch("dz", &m_dz);
55  tree->Branch("wt", &m_wt);
56  }
57 }
std::vector< float > m_P
std::vector< int > m_nhTIB
std::vector< float > m_Eta
std::vector< float > m_d0
std::vector< int > m_Nhits
std::vector< float > m_Pt
std::vector< int > m_nhPXB
std::vector< float > m_wt
std::vector< int > m_nhTID
std::vector< float > m_Phi
std::vector< int > m_nhTEC
std::vector< int > m_nhTOB
std::vector< int > m_nhPXF
std::vector< float > m_dz
Definition: tree.py:1
std::vector< float > m_Chi2n
void HIPTrackMonitorVariables::fill ( )
virtual

Implements HIPMonitorVariables.

Definition at line 70 of file HIPMonitorConfig.cc.

References cuy::doFill, nEvents, and nTracks().

Referenced by HIPAlignmentAlgorithm::run().

70  {
71  if (tree==nullptr) return;
72  if (maxNEvents>=0 && nEvents>=maxNEvents) return;
73 
74  bool doFill=false;
75  m_Ntracks=m_Pt.size();
76  if (m_Ntracks==0) return;
77 
78  if (maxTracksRcd<0) doFill=true;
79  else if (nTracks<maxTracksRcd){
80  if ((nTracks+m_Ntracks)<maxTracksRcd) doFill=true;
81  else{
82  int NewSize = maxTracksRcd - nTracks;
83  if ((int)m_Pt.size()<NewSize) NewSize=m_Pt.size();
84 
85  // Do not touch m_Ntracks, just resize these vectors
86  resizeVectors(NewSize);
87 
88  doFill=true;
89  }
90  }
91  else{
92  // Record only m_Ntracks
93  int tmpNtracks = m_Ntracks;
94  resetPerEvent();
95  m_Ntracks=tmpNtracks;
96 
97  doFill=true;
98  }
99 
100  if (doFill){
101  tree->Fill();
102  nEvents++;
103  nTracks+=m_Ntracks;
104  }
105 
106  resetPerEvent();
107 }
std::vector< float > m_Pt
doFill
Definition: cuy.py:576
Definition: tree.py:1
void resizeVectors(int NewSize)
void HIPTrackMonitorVariables::resetPerEvent ( )
inlineprotected

Definition at line 44 of file HIPMonitorConfig.h.

44  {
45  // Do not reset nTracks
46  m_Ntracks=0;
47  m_Pt.clear(); m_Eta.clear(); m_Phi.clear(); m_Chi2n.clear(); m_P.clear(); m_d0.clear(); m_dz.clear(); m_wt.clear();
48  m_Nhits.clear(); m_nhPXB.clear(); m_nhPXF.clear(); m_nhTIB.clear(); m_nhTOB.clear(); m_nhTID.clear(); m_nhTEC.clear();
49  }
std::vector< float > m_P
std::vector< int > m_nhTIB
std::vector< float > m_Eta
std::vector< float > m_d0
std::vector< int > m_Nhits
std::vector< float > m_Pt
std::vector< int > m_nhPXB
std::vector< float > m_wt
std::vector< int > m_nhTID
std::vector< float > m_Phi
std::vector< int > m_nhTEC
std::vector< int > m_nhTOB
std::vector< int > m_nhPXF
std::vector< float > m_dz
std::vector< float > m_Chi2n
void HIPTrackMonitorVariables::resizeVectors ( int  NewSize)
inlineprotected

Definition at line 50 of file HIPMonitorConfig.h.

50  {
51  m_Pt.resize(NewSize); m_Eta.resize(NewSize); m_Phi.resize(NewSize); m_Chi2n.resize(NewSize); m_P.resize(NewSize); m_d0.resize(NewSize); m_dz.resize(NewSize); m_wt.resize(NewSize);
52  m_Nhits.resize(NewSize); m_nhPXB.resize(NewSize); m_nhPXF.resize(NewSize); m_nhTIB.resize(NewSize); m_nhTOB.resize(NewSize); m_nhTID.resize(NewSize); m_nhTEC.resize(NewSize);
53  }
std::vector< float > m_P
std::vector< int > m_nhTIB
std::vector< float > m_Eta
std::vector< float > m_d0
std::vector< int > m_Nhits
std::vector< float > m_Pt
std::vector< int > m_nhPXB
std::vector< float > m_wt
std::vector< int > m_nhTID
std::vector< float > m_Phi
std::vector< int > m_nhTEC
std::vector< int > m_nhTOB
std::vector< int > m_nhPXF
std::vector< float > m_dz
std::vector< float > m_Chi2n

Member Data Documentation

std::vector<float> HIPTrackMonitorVariables::m_Chi2n

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<float> HIPTrackMonitorVariables::m_d0

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<float> HIPTrackMonitorVariables::m_dz

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<float> HIPTrackMonitorVariables::m_Eta

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_Nhits

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_nhPXB

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_nhPXF

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_nhTEC

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_nhTIB

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_nhTID

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<int> HIPTrackMonitorVariables::m_nhTOB

Definition at line 35 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

int HIPTrackMonitorVariables::m_Ntracks

Definition at line 33 of file HIPMonitorConfig.h.

std::vector<float> HIPTrackMonitorVariables::m_P

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<float> HIPTrackMonitorVariables::m_Phi

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<float> HIPTrackMonitorVariables::m_Pt

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

std::vector<float> HIPTrackMonitorVariables::m_wt

Definition at line 34 of file HIPMonitorConfig.h.

Referenced by HIPAlignmentAlgorithm::run().

const int HIPTrackMonitorVariables::maxNEvents

Definition at line 29 of file HIPMonitorConfig.h.

const int HIPTrackMonitorVariables::maxTracksRcd

Definition at line 30 of file HIPMonitorConfig.h.

int HIPTrackMonitorVariables::nEvents

Definition at line 31 of file HIPMonitorConfig.h.

Referenced by looper.Looper::loop().

int HIPTrackMonitorVariables::nTracks

Definition at line 32 of file HIPMonitorConfig.h.