CMS 3D CMS Logo

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

#include <trackCount/TrackCount/src/TrackCount.cc>

Inheritance diagram for TrackCount:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 TrackCount (const edm::ParameterSet &)
 
 ~TrackCount () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

const bool m_2dhistos
 
TH1F * m_chisq
 
TH1F * m_chisqnorm
 
TH2F * m_chisqnormvseta
 
TH2F * m_chisqvseta
 
const bool m_dump
 
TH1D * m_halgo
 
TH1F * m_hcos
 
TH1F * m_heta
 
TH1F * m_hhpfrac
 
TProfile2D * m_hnhitphieta
 
TProfile2D * m_hnlayerphieta
 
TH1D * m_hnlayers
 
TH1D * m_hnlosthits
 
TH1D * m_hnlostlayers
 
TH1D * m_hnpixellayers
 
TH1D * m_hnpixelrhits
 
TH1D * m_hnrhits
 
TH1D * m_hnstriplayers
 
TH1D * m_hnstriprhits
 
TH1F * m_hphi
 
TH2D * m_hphieta
 
TH1F * m_hpt
 
TProfile2D * m_hptphieta
 
TH1F * m_hsqsumptsq
 
const unsigned int m_LSfrac
 
edm::EDGetTokenT< LumiDetailsm_lumiProducerToken
 
const unsigned int m_maxLS
 
TH1F * m_ndof
 
TH2F * m_ndofvseta
 
TH1F * m_nhptrk
 
const unsigned int m_nptbin
 
TH1F * m_ntrk
 
TProfile * m_ntrkvslumi
 
TH2D * m_ntrkvslumi2D
 
TProfile ** m_ntrkvsorbrun
 
const double m_ptmax
 
const double m_ptmin
 
RunHistogramManager m_rhm
 
const bool m_runHisto
 
edm::EDGetTokenT< reco::TrackCollectionm_trkcollToken
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 64 of file TrackCount.cc.

Constructor & Destructor Documentation

TrackCount::TrackCount ( const edm::ParameterSet iConfig)
explicit

Definition at line 132 of file TrackCount.cc.

References reco::TrackBase::algoSize, muonTiming_cfi::etamax, muonTiming_cfi::etamin, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), label, m_2dhistos, m_chisq, m_chisqnorm, m_chisqnormvseta, m_chisqvseta, m_halgo, m_hcos, m_heta, m_hhpfrac, m_hnhitphieta, m_hnlayerphieta, m_hnlayers, m_hnlosthits, m_hnlostlayers, m_hnpixellayers, m_hnpixelrhits, m_hnrhits, m_hnstriplayers, m_hnstriprhits, m_hphi, m_hphieta, m_hpt, m_hptphieta, m_hsqsumptsq, m_LSfrac, m_maxLS, m_ndof, m_ndofvseta, m_nhptrk, m_nptbin, m_ntrk, m_ntrkvslumi, m_ntrkvslumi2D, m_ntrkvsorbrun, M_PI, m_ptmax, m_ptmin, m_rhm, m_runHisto, TFileService::make(), and RunHistogramManager::makeTProfile().

134  m_maxLS(100),
135  m_LSfrac(16),
136  m_2dhistos(iConfig.getUntrackedParameter<bool>("wanted2DHistos", false)),
137  m_runHisto(iConfig.getUntrackedParameter<bool>("runHisto", false)),
138  m_dump(iConfig.getUntrackedParameter<bool>("dumpTracks", false)),
139  m_trkcollToken(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("trackCollection"))),
140  m_lumiProducerToken(consumes<LumiDetails, edm::InLumi>(edm::InputTag("lumiProducer"))),
141  m_nptbin(iConfig.getUntrackedParameter<unsigned int>("numberPtBins", 200)),
142  m_ptmin(iConfig.getUntrackedParameter<double>("ptMin", 0.)),
143  m_ptmax(iConfig.getUntrackedParameter<double>("ptMax", 20.))
144 
145 {
146  //now do what ever initialization is needed
147 
148  // histogram parameters
149 
150  const unsigned int netabin1d = iConfig.getUntrackedParameter<unsigned int>("netabin1D", 120);
151  const unsigned int netabin2d = iConfig.getUntrackedParameter<unsigned int>("netabin2D", 40);
152  const float etamin = iConfig.getUntrackedParameter<double>("etaMin", -3.);
153  const float etamax = iConfig.getUntrackedParameter<double>("etaMax", 3.);
154  const unsigned int nchisqbin1d = iConfig.getUntrackedParameter<unsigned int>("nchi2bin1D", 50);
155  const unsigned int nndofbin1d = iConfig.getUntrackedParameter<unsigned int>("nndofbin1D", 50);
156  const unsigned int nchisqbin2d = iConfig.getUntrackedParameter<unsigned int>("nchi2bin2D", 50);
157  const unsigned int nndofbin2d = iConfig.getUntrackedParameter<unsigned int>("nndofbin2D", 50);
158 
159  edm::LogInfo("TrackCollection") << "Using collection "
160  << iConfig.getParameter<edm::InputTag>("trackCollection").label().c_str();
161 
163 
164  m_ntrk = tfserv->make<TH1F>("ntrk", "Number of Tracks", 2500, -0.5, 2499.5);
165  m_ntrk->GetXaxis()->SetTitle("Tracks");
166  m_ntrk->GetYaxis()->SetTitle("Events");
167  m_ntrkvslumi = tfserv->make<TProfile>("ntrkvslumi", "Number of Tracks vs Luminosity", 250, 0., 10.);
168  m_ntrkvslumi->GetXaxis()->SetTitle("BX lumi [10^{30}cm^{-2}s^{-1}]");
169  m_ntrkvslumi->GetYaxis()->SetTitle("Ntracks");
170  m_ntrkvslumi2D = tfserv->make<TH2D>("ntrkvslumi2D", "Number of Tracks vs Luminosity", 80, 0., 10., 125, -0.5, 2499.5);
171  m_ntrkvslumi2D->GetXaxis()->SetTitle("BX lumi [10^{30}cm^{-2}s^{-1}]");
172  m_ntrkvslumi2D->GetYaxis()->SetTitle("Ntracks");
173 
174  m_nhptrk = tfserv->make<TH1F>("nhptrk", "Number of High Purity Tracks", 2500, -0.5, 2499.5);
175  m_nhptrk->GetXaxis()->SetTitle("Tracks");
176  m_nhptrk->GetYaxis()->SetTitle("Events");
177  m_hhpfrac = tfserv->make<TH1F>("hhpfrac", "Fraction of High Purity Tracks", 51, 0., 1.02);
178  m_hhpfrac->GetXaxis()->SetTitle("hp/all");
179  m_hhpfrac->GetYaxis()->SetTitle("Events");
180  m_hsqsumptsq = tfserv->make<TH1F>("hsqsumptsq", "Sqrt(Sum pt**2)", 1000, 0., 200.);
181  m_hsqsumptsq->GetXaxis()->SetTitle("#sqrt(#Sigma pt^2) (GeV)");
182  m_hsqsumptsq->GetYaxis()->SetTitle("Events");
183 
184  m_hphi = tfserv->make<TH1F>("phi", "Track azimuth", 40, -M_PI, M_PI);
185  m_hphi->GetXaxis()->SetTitle("#phi (rad)");
186  m_hphi->GetYaxis()->SetTitle("Tracks");
187  m_heta = tfserv->make<TH1F>("eta", "Track pseudorapidity", netabin1d, etamin, etamax);
188  m_heta->GetXaxis()->SetTitle("#eta");
189  m_heta->GetYaxis()->SetTitle("Tracks");
190  m_hcos = tfserv->make<TH1F>("cos", "Track polar angle", 50, -1., 1.);
191  m_hcos->GetXaxis()->SetTitle("cos(#theta)");
192  m_hcos->GetYaxis()->SetTitle("Tracks");
193  m_hpt = tfserv->make<TH1F>("pt", "Track pt", m_nptbin, m_ptmin, m_ptmax);
194  m_hpt->GetXaxis()->SetTitle("pt (GeV)");
195  m_hpt->GetYaxis()->SetTitle("Tracks");
196 
197  m_chisq = tfserv->make<TH1F>("chisq", "Track Chi2", nchisqbin1d, 0., 100.);
198  m_chisq->GetXaxis()->SetTitle("chi2");
199  m_chisq->GetYaxis()->SetTitle("Tracks");
200  m_chisqnorm = tfserv->make<TH1F>("chisqnorm", "Track normalized Chi2", nchisqbin1d, 0., 10.);
201  m_chisqnorm->GetXaxis()->SetTitle("normalized chi2");
202  m_chisqnorm->GetYaxis()->SetTitle("Tracks");
203  m_ndof = tfserv->make<TH1F>("ndof", "Track ndof", nndofbin1d, 0., 100.);
204  m_ndof->GetXaxis()->SetTitle("ndof");
205  m_ndof->GetYaxis()->SetTitle("Tracks");
206  if (m_2dhistos) {
207  m_chisqvseta =
208  tfserv->make<TH2F>("chisqvseta", "Track Chi2 vs #eta", netabin2d, etamin, etamax, nchisqbin2d, 0., 100.);
209  m_chisqvseta->GetXaxis()->SetTitle("#eta");
210  m_chisqvseta->GetYaxis()->SetTitle("#chi2");
211  m_chisqnormvseta = tfserv->make<TH2F>(
212  "chisqnormvseta", "Track normalized Chi2 vs #eta", netabin2d, etamin, etamax, nchisqbin2d, 0., 10.);
213  m_chisqnormvseta->GetXaxis()->SetTitle("#eta");
214  m_chisqnormvseta->GetYaxis()->SetTitle("normalized #chi2");
215  m_ndofvseta =
216  tfserv->make<TH2F>("ndofvseta", "Track ndof vs #eta", netabin2d, etamin, etamax, nndofbin2d, 0., 100.);
217  m_ndofvseta->GetXaxis()->SetTitle("#eta");
218  m_ndofvseta->GetYaxis()->SetTitle("ndof");
219  }
220 
221  m_hptphieta =
222  tfserv->make<TProfile2D>("ptphivseta", "Average pt vs #phi vs #eta", netabin2d, etamin, etamax, 40, -M_PI, M_PI);
223  m_hptphieta->GetXaxis()->SetTitle("#eta");
224  m_hptphieta->GetYaxis()->SetTitle("#phi");
225 
226  m_hnlosthits = tfserv->make<TH1D>("nlosthits", "Number of Lost Hits", 10, -0.5, 9.5);
227  m_hnlosthits->GetXaxis()->SetTitle("Nlost");
228  m_hnlosthits->GetYaxis()->SetTitle("Tracks");
229 
230  m_hnrhits = tfserv->make<TH1D>("nrhits", "Number of Valid Hits", 55, -0.5, 54.5);
231  m_hnrhits->GetXaxis()->SetTitle("Nvalid");
232  m_hnrhits->GetYaxis()->SetTitle("Tracks");
233  m_hnpixelrhits = tfserv->make<TH1D>("npixelrhits", "Number of Valid Pixel Hits", 20, -0.5, 19.5);
234  m_hnpixelrhits->GetXaxis()->SetTitle("Nvalid");
235  m_hnpixelrhits->GetYaxis()->SetTitle("Tracks");
236  m_hnstriprhits = tfserv->make<TH1D>("nstriprhits", "Number of Valid Strip Hits", 45, -0.5, 44.5);
237  m_hnstriprhits->GetXaxis()->SetTitle("Nvalid");
238  m_hnstriprhits->GetYaxis()->SetTitle("Tracks");
239 
240  m_hnlostlayers = tfserv->make<TH1D>("nlostlayers", "Number of Layers w/o measurement", 10, -0.5, 9.5);
241  m_hnlostlayers->GetXaxis()->SetTitle("Nlostlay");
242  m_hnlostlayers->GetYaxis()->SetTitle("Tracks");
243 
244  m_hnlayers = tfserv->make<TH1D>("nlayers", "Number of Layers", 20, -0.5, 19.5);
245  m_hnlayers->GetXaxis()->SetTitle("Nlayers");
246  m_hnlayers->GetYaxis()->SetTitle("Tracks");
247  m_hnpixellayers = tfserv->make<TH1D>("npixellayers", "Number of Pixel Layers", 10, -0.5, 9.5);
248  m_hnpixellayers->GetXaxis()->SetTitle("Nlayers");
249  m_hnpixellayers->GetYaxis()->SetTitle("Tracks");
250  m_hnstriplayers = tfserv->make<TH1D>("nstriplayers", "Number of Strip Layers", 20, -0.5, 19.5);
251  m_hnstriplayers->GetXaxis()->SetTitle("Nlayers");
252  m_hnstriplayers->GetYaxis()->SetTitle("Tracks");
253 
254  m_hnhitphieta = tfserv->make<TProfile2D>(
255  "nhitphivseta", "N valid hits vs #phi vs #eta", netabin2d, etamin, etamax, 40, -M_PI, M_PI);
256  m_hnhitphieta->GetXaxis()->SetTitle("#eta");
257  m_hnhitphieta->GetYaxis()->SetTitle("#phi");
258  m_hnlayerphieta = tfserv->make<TProfile2D>(
259  "nlayerphivseta", "N layers vs #phi vs #eta", netabin2d, etamin, etamax, 40, -M_PI, M_PI);
260  m_hnlayerphieta->GetXaxis()->SetTitle("#eta");
261  m_hnlayerphieta->GetYaxis()->SetTitle("#phi");
262 
263  m_halgo =
264  tfserv->make<TH1D>("algo", "Algorithm number", reco::TrackBase::algoSize, -0.5, reco::TrackBase::algoSize - 0.5);
265  m_halgo->GetXaxis()->SetTitle("algorithm");
266  m_halgo->GetYaxis()->SetTitle("Tracks");
267  m_hphieta = tfserv->make<TH2D>("phivseta", "#phi vs #eta", netabin2d, etamin, etamax, 40, -M_PI, M_PI);
268  m_hphieta->GetXaxis()->SetTitle("#eta");
269  m_hphieta->GetYaxis()->SetTitle("#phi");
270 
271  if (m_runHisto) {
273  m_rhm.makeTProfile("ntrkvsorbrun", "Number of tracks vs orbit number", m_maxLS * m_LSfrac, 0, m_maxLS * 262144);
274  }
275 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
TH1F * m_ntrk
Definition: TrackCount.cc:75
TH2F * m_chisqvseta
Definition: TrackCount.cc:88
RunHistogramManager m_rhm
Definition: TrackCount.cc:108
TProfile2D * m_hnlayerphieta
Definition: TrackCount.cc:103
TProfile2D * m_hnhitphieta
Definition: TrackCount.cc:102
TProfile2D * m_hptphieta
Definition: TrackCount.cc:91
TH1D * m_halgo
Definition: TrackCount.cc:100
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
const double m_ptmax
Definition: TrackCount.cc:118
edm::EDGetTokenT< reco::TrackCollection > m_trkcollToken
Definition: TrackCount.cc:114
char const * label
TH1D * m_hnstriplayers
Definition: TrackCount.cc:99
TH1F * m_chisqnorm
Definition: TrackCount.cc:86
TH1F * m_chisq
Definition: TrackCount.cc:85
TH2F * m_chisqnormvseta
Definition: TrackCount.cc:89
TH1D * m_hnlostlayers
Definition: TrackCount.cc:96
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
TH1F * m_hpt
Definition: TrackCount.cc:84
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
TProfile ** m_ntrkvsorbrun
Definition: TrackCount.cc:105
TH1F * m_nhptrk
Definition: TrackCount.cc:78
TH1F * m_hsqsumptsq
Definition: TrackCount.cc:80
#define M_PI
const unsigned int m_maxLS
Definition: TrackCount.cc:109
TH1F * m_heta
Definition: TrackCount.cc:82
TH1D * m_hnlayers
Definition: TrackCount.cc:97
TH1D * m_hnpixelrhits
Definition: TrackCount.cc:94
TH1D * m_hnrhits
Definition: TrackCount.cc:93
TH1D * m_hnpixellayers
Definition: TrackCount.cc:98
TH2F * m_ndofvseta
Definition: TrackCount.cc:90
TH1D * m_hnstriprhits
Definition: TrackCount.cc:95
const unsigned int m_LSfrac
Definition: TrackCount.cc:110
const double m_ptmin
Definition: TrackCount.cc:117
TH1F * m_hcos
Definition: TrackCount.cc:83
TProfile * m_ntrkvslumi
Definition: TrackCount.cc:76
const bool m_dump
Definition: TrackCount.cc:113
TH2D * m_ntrkvslumi2D
Definition: TrackCount.cc:77
const bool m_2dhistos
Definition: TrackCount.cc:111
TH1D * m_hnlosthits
Definition: TrackCount.cc:92
TH1F * m_ndof
Definition: TrackCount.cc:87
TH1F * m_hphi
Definition: TrackCount.cc:81
TH2D * m_hphieta
Definition: TrackCount.cc:101
const bool m_runHisto
Definition: TrackCount.cc:112
edm::EDGetTokenT< LumiDetails > m_lumiProducerToken
Definition: TrackCount.cc:115
const unsigned int m_nptbin
Definition: TrackCount.cc:116
TH1F * m_hhpfrac
Definition: TrackCount.cc:79
TrackCount::~TrackCount ( )
override

Definition at line 277 of file TrackCount.cc.

277  {
278  // do anything here that needs to be done at desctruction time
279  // (e.g. close files, deallocate resources etc.)
280 }

Member Function Documentation

void TrackCount::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 287 of file TrackCount.cc.

References edm::EventBase::bunchCrossing(), edm::LuminosityBlock::getByToken(), edm::Event::getByToken(), edm::Event::getLuminosityBlock(), LumiDetails::isValid(), edm::HandleBase::isValid(), LumiDetails::kOCC1, LumiDetails::lumiValue(), m_2dhistos, m_chisq, m_chisqnorm, m_chisqnormvseta, m_chisqvseta, m_dump, m_halgo, m_hcos, m_heta, m_hhpfrac, m_hnhitphieta, m_hnlayerphieta, m_hnlayers, m_hnlosthits, m_hnlostlayers, m_hnpixellayers, m_hnpixelrhits, m_hnrhits, m_hnstriplayers, m_hnstriprhits, m_hphi, m_hphieta, m_hpt, m_hptphieta, m_hsqsumptsq, m_lumiProducerToken, m_ndof, m_ndofvseta, m_nhptrk, m_ntrk, m_ntrkvslumi, m_ntrkvslumi2D, m_ntrkvsorbrun, m_runHisto, m_trkcollToken, edm::EventBase::orbitNumber(), DiDispStaMuonMonitor_cfi::pt, qcdUeDQM_cfi::quality, reco::TrackBase::qualityByName(), mathSSE::sqrt(), reco::HitPattern::TRACK_HITS, and PDWG_EXOHSCP_cff::tracks.

287  {
288  using namespace edm;
290 
292  iEvent.getByToken(m_trkcollToken, tracks);
293 
294  //
295 
296  m_ntrk->Fill(tracks->size());
297 
298  // get luminosity
299 
302 
303  if (ld.isValid()) {
304  if (ld->isValid()) {
305  float lumi = ld->lumiValue(LumiDetails::kOCC1, iEvent.bunchCrossing()) * 6.37;
306  m_ntrkvslumi->Fill(lumi, tracks->size());
307  m_ntrkvslumi2D->Fill(lumi, tracks->size());
308  }
309  }
310 
311  if (m_runHisto) {
313  (*m_ntrkvsorbrun)->Fill(iEvent.orbitNumber(), tracks->size());
314  }
315 
316  unsigned int nhptrk = 0;
317  double sumptsq = 0.;
318 
320 
321  if (m_dump)
322  edm::LogInfo("TrackDump") << " isHP algo pt eta phi chi2N chi2 ndof nlay npxl n3dl nlost ";
323 
324  for (reco::TrackCollection::const_iterator it = tracks->begin(); it != tracks->end(); it++) {
325  if (m_dump) {
326  edm::LogVerbatim("TrackDump") << it->quality(quality) << " " << it->algo() << " " << it->pt() << " " << it->eta()
327  << " " << it->phi() << " " << it->normalizedChi2() << " " << it->chi2() << " "
328  << it->ndof() << " " << it->hitPattern().trackerLayersWithMeasurement() << " "
329  << it->hitPattern().pixelLayersWithMeasurement() << " "
330  << it->hitPattern().numberOfValidStripLayersWithMonoAndStereo() << " "
331  << it->hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS)
332  << " ";
333  }
334 
335  m_hnlosthits->Fill(it->hitPattern().numberOfLostTrackerHits(reco::HitPattern::TRACK_HITS));
336 
337  m_hnrhits->Fill(it->hitPattern().numberOfValidTrackerHits());
338  m_hnpixelrhits->Fill(it->hitPattern().numberOfValidPixelHits());
339  m_hnstriprhits->Fill(it->hitPattern().numberOfValidStripHits());
340  m_hnhitphieta->Fill(it->eta(), it->phi(), it->hitPattern().numberOfValidTrackerHits());
341 
342  m_hnlostlayers->Fill(it->hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS));
343 
344  m_hnlayers->Fill(it->hitPattern().trackerLayersWithMeasurement());
345  m_hnpixellayers->Fill(it->hitPattern().pixelLayersWithMeasurement());
346  m_hnstriplayers->Fill(it->hitPattern().stripLayersWithMeasurement());
347  m_hnlayerphieta->Fill(it->eta(), it->phi(), it->hitPattern().trackerLayersWithMeasurement());
348 
349  m_halgo->Fill(it->algo());
350 
351  m_hphi->Fill(it->phi());
352  m_heta->Fill(it->eta());
353  m_hphieta->Fill(it->eta(), it->phi());
354 
355  double pt = it->pt();
356  m_hpt->Fill(pt);
357  m_chisq->Fill(it->chi2());
358  m_chisqnorm->Fill(it->normalizedChi2());
359  m_ndof->Fill(it->ndof());
360  if (m_2dhistos) {
361  m_chisqvseta->Fill(it->eta(), it->chi2());
362  m_chisqnormvseta->Fill(it->eta(), it->normalizedChi2());
363  m_ndofvseta->Fill(it->eta(), it->ndof());
364  }
365  m_hptphieta->Fill(it->eta(), it->phi(), pt);
366  sumptsq += pt * pt;
367  if (it->p())
368  m_hcos->Fill(it->pz() / it->p());
369  if (it->quality(quality))
370  nhptrk++;
371  }
372 
373  m_nhptrk->Fill(nhptrk);
374 
375  const double hpfrac = !tracks->empty() ? double(nhptrk) / double(tracks->size()) : 0.;
376  m_hhpfrac->Fill(hpfrac);
377  m_hsqsumptsq->Fill(sqrt(sumptsq));
378 }
TH1F * m_ntrk
Definition: TrackCount.cc:75
TH2F * m_chisqvseta
Definition: TrackCount.cc:88
TProfile2D * m_hnlayerphieta
Definition: TrackCount.cc:103
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
Definition: TrackBase.h:150
TProfile2D * m_hnhitphieta
Definition: TrackCount.cc:102
TProfile2D * m_hptphieta
Definition: TrackCount.cc:91
bool isValid() const
Definition: LumiDetails.cc:44
TH1D * m_halgo
Definition: TrackCount.cc:100
int bunchCrossing() const
Definition: EventBase.h:64
float lumiValue(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:72
edm::EDGetTokenT< reco::TrackCollection > m_trkcollToken
Definition: TrackCount.cc:114
TH1D * m_hnstriplayers
Definition: TrackCount.cc:99
TH1F * m_chisqnorm
Definition: TrackCount.cc:86
TH1F * m_chisq
Definition: TrackCount.cc:85
TH2F * m_chisqnormvseta
Definition: TrackCount.cc:89
TH1D * m_hnlostlayers
Definition: TrackCount.cc:96
T sqrt(T t)
Definition: SSEVec.h:19
TH1F * m_hpt
Definition: TrackCount.cc:84
TProfile ** m_ntrkvsorbrun
Definition: TrackCount.cc:105
TH1F * m_nhptrk
Definition: TrackCount.cc:78
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:98
TH1F * m_hsqsumptsq
Definition: TrackCount.cc:80
int orbitNumber() const
Definition: EventBase.h:65
bool isValid() const
Definition: HandleBase.h:70
TH1F * m_heta
Definition: TrackCount.cc:82
TH1D * m_hnlayers
Definition: TrackCount.cc:97
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
TH1D * m_hnpixelrhits
Definition: TrackCount.cc:94
TH1D * m_hnrhits
Definition: TrackCount.cc:93
TH1D * m_hnpixellayers
Definition: TrackCount.cc:98
HLT enums.
TH2F * m_ndofvseta
Definition: TrackCount.cc:90
TH1D * m_hnstriprhits
Definition: TrackCount.cc:95
TH1F * m_hcos
Definition: TrackCount.cc:83
TProfile * m_ntrkvslumi
Definition: TrackCount.cc:76
const bool m_dump
Definition: TrackCount.cc:113
TH2D * m_ntrkvslumi2D
Definition: TrackCount.cc:77
const bool m_2dhistos
Definition: TrackCount.cc:111
TH1D * m_hnlosthits
Definition: TrackCount.cc:92
TH1F * m_ndof
Definition: TrackCount.cc:87
TH1F * m_hphi
Definition: TrackCount.cc:81
TH2D * m_hphieta
Definition: TrackCount.cc:101
const bool m_runHisto
Definition: TrackCount.cc:112
edm::EDGetTokenT< LumiDetails > m_lumiProducerToken
Definition: TrackCount.cc:115
TH1F * m_hhpfrac
Definition: TrackCount.cc:79
void TrackCount::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivate

Definition at line 380 of file TrackCount.cc.

References RunHistogramManager::beginRun(), DEFINE_FWK_MODULE, m_rhm, and m_runHisto.

380  {
381  m_rhm.beginRun(iRun);
382 
383  if (m_runHisto) {
384  (*m_ntrkvsorbrun)->GetXaxis()->SetTitle("time [orbit#]");
385  (*m_ntrkvsorbrun)->GetYaxis()->SetTitle("Ntracks");
386  (*m_ntrkvsorbrun)->SetCanExtend(TH1::kXaxis);
387  }
388 }
RunHistogramManager m_rhm
Definition: TrackCount.cc:108
void beginRun(const edm::Run &iRun)
const bool m_runHisto
Definition: TrackCount.cc:112

Member Data Documentation

const bool TrackCount::m_2dhistos
private

Definition at line 111 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_chisq
private

Definition at line 85 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_chisqnorm
private

Definition at line 86 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2F* TrackCount::m_chisqnormvseta
private

Definition at line 89 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2F* TrackCount::m_chisqvseta
private

Definition at line 88 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const bool TrackCount::m_dump
private

Definition at line 113 of file TrackCount.cc.

Referenced by analyze().

TH1D* TrackCount::m_halgo
private

Definition at line 100 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hcos
private

Definition at line 83 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_heta
private

Definition at line 82 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hhpfrac
private

Definition at line 79 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile2D* TrackCount::m_hnhitphieta
private

Definition at line 102 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile2D* TrackCount::m_hnlayerphieta
private

Definition at line 103 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnlayers
private

Definition at line 97 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnlosthits
private

Definition at line 92 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnlostlayers
private

Definition at line 96 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnpixellayers
private

Definition at line 98 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnpixelrhits
private

Definition at line 94 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnrhits
private

Definition at line 93 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnstriplayers
private

Definition at line 99 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnstriprhits
private

Definition at line 95 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hphi
private

Definition at line 81 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2D* TrackCount::m_hphieta
private

Definition at line 101 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hpt
private

Definition at line 84 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile2D* TrackCount::m_hptphieta
private

Definition at line 91 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hsqsumptsq
private

Definition at line 80 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const unsigned int TrackCount::m_LSfrac
private

Definition at line 110 of file TrackCount.cc.

Referenced by TrackCount().

edm::EDGetTokenT<LumiDetails> TrackCount::m_lumiProducerToken
private

Definition at line 115 of file TrackCount.cc.

Referenced by analyze().

const unsigned int TrackCount::m_maxLS
private

Definition at line 109 of file TrackCount.cc.

Referenced by TrackCount().

TH1F* TrackCount::m_ndof
private

Definition at line 87 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2F* TrackCount::m_ndofvseta
private

Definition at line 90 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_nhptrk
private

Definition at line 78 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const unsigned int TrackCount::m_nptbin
private

Definition at line 116 of file TrackCount.cc.

Referenced by TrackCount().

TH1F* TrackCount::m_ntrk
private

Definition at line 75 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile* TrackCount::m_ntrkvslumi
private

Definition at line 76 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2D* TrackCount::m_ntrkvslumi2D
private

Definition at line 77 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile** TrackCount::m_ntrkvsorbrun
private

Definition at line 105 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const double TrackCount::m_ptmax
private

Definition at line 118 of file TrackCount.cc.

Referenced by TrackCount().

const double TrackCount::m_ptmin
private

Definition at line 117 of file TrackCount.cc.

Referenced by TrackCount().

RunHistogramManager TrackCount::m_rhm
private

Definition at line 108 of file TrackCount.cc.

Referenced by beginRun(), and TrackCount().

const bool TrackCount::m_runHisto
private

Definition at line 112 of file TrackCount.cc.

Referenced by analyze(), beginRun(), and TrackCount().

edm::EDGetTokenT<reco::TrackCollection> TrackCount::m_trkcollToken
private

Definition at line 114 of file TrackCount.cc.

Referenced by analyze().