CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TSOSHistogramMaker Class Reference

#include <TSOSHistogramMaker.h>

Public Member Functions

void fill (const TrajectoryStateOnSurface &tsos, TransientTrackingRecHit::ConstRecHitPointer hit) const
 
 TSOSHistogramMaker ()
 
 TSOSHistogramMaker (const edm::ParameterSet &iConfig)
 

Private Attributes

const bool m_2dhistos
 
std::vector< DetIdSelectorm_detsels
 
std::vector< TH2F * > m_histocluslenangle
 
std::vector< std::string > m_selnames
 
std::vector< std::string > m_seltitles
 
std::vector< TH1F * > m_tsosdx
 
std::vector< TH2F * > m_tsosdxdy
 
std::vector< TH1F * > m_tsosdy
 
std::vector< TH1F * > m_tsosprojx
 
std::vector< TH1F * > m_tsosprojy
 
std::vector< TH1F * > m_tsosx
 
std::vector< TH2F * > m_tsosxy
 
std::vector< TH1F * > m_tsosy
 
std::vector< TH1F * > m_ttrhx
 
std::vector< TH2F * > m_ttrhxy
 
std::vector< TH1F * > m_ttrhy
 

Detailed Description

Definition at line 14 of file TSOSHistogramMaker.h.

Constructor & Destructor Documentation

TSOSHistogramMaker::TSOSHistogramMaker ( )

Definition at line 11 of file TSOSHistogramMaker.cc.

11  :
12  m_2dhistos(false),
14  m_tsosy(), m_tsosx(), m_tsosxy(),
15  m_ttrhy(), m_ttrhx(), m_ttrhxy(),
17 {}
std::vector< std::string > m_selnames
std::vector< TH1F * > m_tsosdx
std::vector< TH2F * > m_tsosdxdy
std::vector< TH1F * > m_tsosdy
std::vector< TH1F * > m_tsosy
std::vector< std::string > m_seltitles
std::vector< TH1F * > m_tsosx
std::vector< TH1F * > m_ttrhx
std::vector< DetIdSelector > m_detsels
std::vector< TH2F * > m_tsosxy
std::vector< TH2F * > m_histocluslenangle
std::vector< TH2F * > m_ttrhxy
std::vector< TH1F * > m_ttrhy
TSOSHistogramMaker::TSOSHistogramMaker ( const edm::ParameterSet iConfig)

Definition at line 19 of file TSOSHistogramMaker.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), m_2dhistos, m_detsels, m_histocluslenangle, m_selnames, m_seltitles, m_tsosdx, m_tsosdxdy, m_tsosdy, m_tsosprojx, m_tsosprojy, m_tsosx, m_tsosxy, m_tsosy, m_ttrhx, m_ttrhxy, m_ttrhy, TFileDirectory::make(), TFileService::mkdir(), dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, and fftjetcommon_cfi::title.

19  :
20  m_2dhistos(iConfig.getUntrackedParameter<bool>("wanted2DHistos",false)),
22  m_tsosy(), m_tsosx(), m_tsosxy(),
23  m_ttrhy(), m_ttrhx(), m_ttrhxy(),
25 {
26 
28 
29  std::vector<edm::ParameterSet> wantedsubds(iConfig.getParameter<std::vector<edm::ParameterSet> >("wantedSubDets"));
30 
31  std::cout << "selections found: " << wantedsubds.size() << std::endl;
32 
33  for(std::vector<edm::ParameterSet>::iterator ps=wantedsubds.begin();ps!=wantedsubds.end();++ps) {
34  m_selnames.push_back(ps->getParameter<std::string>("detLabel"));
35  if(ps->existsAs<std::string>("title")) {
36  m_seltitles.push_back(ps->getParameter<std::string>("title"));
37  }
38  else {
39  m_seltitles.push_back(ps->getParameter<std::string>("detLabel"));
40  }
41  m_detsels.push_back(DetIdSelector(ps->getUntrackedParameter<std::vector<std::string> >("selection")));
42  }
43 
44  for(unsigned int isel=0;isel<m_detsels.size();++isel) {
45 
46  TFileDirectory subdir = tfserv->mkdir(m_selnames[isel]);
47 
48  std::string name = "tsosy_" + m_selnames[isel];
49  std::string title = "TSOS y " + m_seltitles[isel];
50  m_tsosy.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),200,-20.,20.));
51  name = "tsosx_" + m_selnames[isel];
52  title = "TSOS x " + m_seltitles[isel];
53  m_tsosx.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),200,-20.,20.));
54  if(m_2dhistos) {
55  name = "tsosxy_" + m_selnames[isel];
56  title = "TSOS y vs x " + m_seltitles[isel];
57  m_tsosxy.push_back(subdir.make<TH2F>(name.c_str(),title.c_str(),200,-20.,20.,200,-20.,20.));
58  }
59 
60  name = "tsosprojx_" + m_selnames[isel];
61  title = "TSOS x projection " + m_seltitles[isel];
62  m_tsosprojx.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),400,-2.,2.));
63  name = "tsosprojy_" + m_selnames[isel];
64  title = "TSOS y projection " + m_seltitles[isel];
65  m_tsosprojy.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),400,-2.,2.));
66 
67  name = "ttrhy_" + m_selnames[isel];
68  title = "TT RecHit y " + m_seltitles[isel];
69  m_ttrhy.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),200,-20.,20.));
70  name = "ttrhx_" + m_selnames[isel];
71  title = "TT RecHit x " + m_seltitles[isel];
72  m_ttrhx.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),200,-20.,20.));
73  if(m_2dhistos) {
74  name = "ttrhxy_" + m_selnames[isel];
75  title = "TT RecHit y vs x " + m_seltitles[isel];
76  m_ttrhxy.push_back(subdir.make<TH2F>(name.c_str(),title.c_str(),200,-20.,20.,200,-20.,20.));
77  }
78 
79  name = "tsosdy_" + m_selnames[isel];
80  title = "TSOS-TTRH y " + m_seltitles[isel];
81  m_tsosdy.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),200,-5.,5.));
82  name = "tsosdx_" + m_selnames[isel];
83  title = "TSOS-TTRH x " + m_seltitles[isel];
84  m_tsosdx.push_back(subdir.make<TH1F>(name.c_str(),title.c_str(),200,-0.1,0.1));
85  if(m_2dhistos) {
86  name = "tsosdxdy_" + m_selnames[isel];
87  title = "TSOS-TTRH dy vs dy " + m_seltitles[isel];
88  m_tsosdxdy.push_back(subdir.make<TH2F>(name.c_str(),title.c_str(),200,-0.1,0.1,200,-5.,5.));
89  }
90 
91  name = "cluslenangle_" + m_selnames[isel];
92  title = "Cluster Length vs Track Angle " + m_seltitles[isel];
93  m_histocluslenangle.push_back(subdir.make<TH2F>(name.c_str(),title.c_str(),200,-1.,1.,40,-0.5,39.5));
94 
95  }
96 }
T getParameter(std::string const &) const
std::vector< std::string > m_selnames
T getUntrackedParameter(std::string const &, T const &) const
std::vector< TH1F * > m_tsosprojy
std::vector< TH1F * > m_tsosdx
std::vector< TH2F * > m_tsosdxdy
std::vector< TH1F * > m_tsosdy
std::vector< TH1F * > m_tsosprojx
std::vector< TH1F * > m_tsosy
std::vector< std::string > m_seltitles
T * make(const Args &...args) const
make new ROOT object
std::vector< TH1F * > m_tsosx
std::vector< TH1F * > m_ttrhx
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
std::vector< DetIdSelector > m_detsels
std::vector< TH2F * > m_tsosxy
std::vector< TH2F * > m_histocluslenangle
std::vector< TH2F * > m_ttrhxy
std::vector< TH1F * > m_ttrhy

Member Function Documentation

void TSOSHistogramMaker::fill ( const TrajectoryStateOnSurface tsos,
TransientTrackingRecHit::ConstRecHitPointer  hit 
) const

Definition at line 98 of file TSOSHistogramMaker.cc.

References mps_fire::i, TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localPosition(), m_2dhistos, m_detsels, m_tsosdx, m_tsosdxdy, m_tsosdy, m_tsosprojx, m_tsosprojy, m_tsosx, m_tsosxy, m_tsosy, m_ttrhx, m_ttrhxy, m_ttrhy, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by OverlapProblemTSOSAnalyzer::analyze().

98  {
99 
100  if(hit==nullptr || !hit->isValid()) return;
101 
102  for(unsigned int i=0; i<m_detsels.size() ; ++i) {
103 
104  if(m_detsels[i].isSelected(hit->geographicalId())) {
105 
106  m_tsosy[i]->Fill(tsos.localPosition().y());
107  m_tsosx[i]->Fill(tsos.localPosition().x());
108  if(m_2dhistos) m_tsosxy[i]->Fill(tsos.localPosition().x(),tsos.localPosition().y());
109  m_ttrhy[i]->Fill(hit->localPosition().y());
110  m_ttrhx[i]->Fill(hit->localPosition().x());
111  if(m_2dhistos) m_ttrhxy[i]->Fill(hit->localPosition().x(),hit->localPosition().y());
112  m_tsosdy[i]->Fill(tsos.localPosition().y()-hit->localPosition().y());
113  m_tsosdx[i]->Fill(tsos.localPosition().x()-hit->localPosition().x());
114  if(m_2dhistos) m_tsosdxdy[i]->Fill(tsos.localPosition().x()-hit->localPosition().x(),tsos.localPosition().y()-hit->localPosition().y());
115 
116  if(tsos.localDirection().z() != 0) {
117  m_tsosprojx[i]->Fill(tsos.localDirection().x()/tsos.localDirection().z());
118  m_tsosprojy[i]->Fill(tsos.localDirection().y()/tsos.localDirection().z());
119  }
120 
121  }
122 
123  }
124 
125 
126 }
std::vector< TH1F * > m_tsosprojy
std::vector< TH1F * > m_tsosdx
std::vector< TH2F * > m_tsosdxdy
LocalVector localDirection() const
std::vector< TH1F * > m_tsosdy
T y() const
Definition: PV3DBase.h:63
std::vector< TH1F * > m_tsosprojx
std::vector< TH1F * > m_tsosy
T z() const
Definition: PV3DBase.h:64
std::vector< TH1F * > m_tsosx
std::vector< TH1F * > m_ttrhx
std::vector< DetIdSelector > m_detsels
std::vector< TH2F * > m_tsosxy
std::vector< TH2F * > m_ttrhxy
std::vector< TH1F * > m_ttrhy
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

const bool TSOSHistogramMaker::m_2dhistos
private

Definition at line 24 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<DetIdSelector> TSOSHistogramMaker::m_detsels
private

Definition at line 25 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH2F*> TSOSHistogramMaker::m_histocluslenangle
private

Definition at line 29 of file TSOSHistogramMaker.h.

Referenced by TSOSHistogramMaker().

std::vector<std::string> TSOSHistogramMaker::m_selnames
private

Definition at line 26 of file TSOSHistogramMaker.h.

Referenced by TSOSHistogramMaker().

std::vector<std::string> TSOSHistogramMaker::m_seltitles
private

Definition at line 27 of file TSOSHistogramMaker.h.

Referenced by TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_tsosdx
private

Definition at line 39 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH2F*> TSOSHistogramMaker::m_tsosdxdy
private

Definition at line 40 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_tsosdy
private

Definition at line 38 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_tsosprojx
private

Definition at line 33 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_tsosprojy
private

Definition at line 34 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_tsosx
private

Definition at line 31 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH2F*> TSOSHistogramMaker::m_tsosxy
private

Definition at line 32 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_tsosy
private

Definition at line 30 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_ttrhx
private

Definition at line 36 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH2F*> TSOSHistogramMaker::m_ttrhxy
private

Definition at line 37 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().

std::vector<TH1F*> TSOSHistogramMaker::m_ttrhy
private

Definition at line 35 of file TSOSHistogramMaker.h.

Referenced by fill(), and TSOSHistogramMaker().