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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual 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 &)
 
- 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 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 65 of file TrackCount.cc.

Constructor & Destructor Documentation

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

Definition at line 135 of file TrackCount.cc.

References reco::TrackBase::algoSize, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), diffTwoXMLs::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().

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

Definition at line 247 of file TrackCount.cc.

248 {
249 
250  // do anything here that needs to be done at desctruction time
251  // (e.g. close files, deallocate resources etc.)
252 
253 }

Member Function Documentation

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

Definition at line 262 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(), EnergyCorrector::pt, btvTracks_cfi::quality, reco::TrackBase::qualityByName(), mathSSE::sqrt(), reco::HitPattern::TRACK_HITS, and l1t::tracks.

263 {
264  using namespace edm;
266 
268  iEvent.getByToken(m_trkcollToken,tracks);
269 
270  //
271 
272  m_ntrk->Fill(tracks->size());
273 
274  // get luminosity
275 
278 
279  if(ld.isValid()) {
280  if(ld->isValid()) {
281  float lumi = ld->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
282  m_ntrkvslumi->Fill(lumi,tracks->size());
283  m_ntrkvslumi2D->Fill(lumi,tracks->size());
284  }
285  }
286 
287  if(m_runHisto) {
288  if(m_ntrkvsorbrun && *m_ntrkvsorbrun) (*m_ntrkvsorbrun)->Fill(iEvent.orbitNumber(),tracks->size());
289  }
290 
291  unsigned int nhptrk = 0;
292  double sumptsq = 0.;
293 
295 
296  if(m_dump) edm::LogInfo("TrackDump") << " isHP algo pt eta phi chi2N chi2 ndof nlay npxl n3dl nlost ";
297 
298  for(reco::TrackCollection::const_iterator it = tracks->begin();it!=tracks->end();it++) {
299 
300  if(m_dump) {
301  edm::LogVerbatim("TrackDump") << it->quality(quality) << " "
302  << it->algo() << " "
303  << it->pt() << " "
304  << it->eta() << " "
305  << it->phi() << " "
306  << it->normalizedChi2() << " "
307  << it->chi2() << " "
308  << it->ndof() << " "
309  << it->hitPattern().trackerLayersWithMeasurement() << " "
310  << it->hitPattern().pixelLayersWithMeasurement() << " "
311  << it->hitPattern().numberOfValidStripLayersWithMonoAndStereo() << " "
312  << it->hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS) << " ";
313 
314  }
315 
316  m_hnlosthits->Fill(it->hitPattern().numberOfLostTrackerHits(reco::HitPattern::TRACK_HITS));
317 
318  m_hnrhits->Fill(it->hitPattern().numberOfValidTrackerHits());
319  m_hnpixelrhits->Fill(it->hitPattern().numberOfValidPixelHits());
320  m_hnstriprhits->Fill(it->hitPattern().numberOfValidStripHits());
321  m_hnhitphieta->Fill(it->eta(),it->phi(),it->hitPattern().numberOfValidTrackerHits());
322 
323  m_hnlostlayers->Fill(it->hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS));
324 
325  m_hnlayers->Fill(it->hitPattern().trackerLayersWithMeasurement());
326  m_hnpixellayers->Fill(it->hitPattern().pixelLayersWithMeasurement());
327  m_hnstriplayers->Fill(it->hitPattern().stripLayersWithMeasurement());
328  m_hnlayerphieta->Fill(it->eta(),it->phi(),it->hitPattern().trackerLayersWithMeasurement());
329 
330  m_halgo->Fill(it->algo());
331 
332  m_hphi->Fill(it->phi());
333  m_heta->Fill(it->eta());
334  m_hphieta->Fill(it->eta(),it->phi());
335 
336  double pt = it->pt();
337  m_hpt->Fill(pt);
338  m_chisq->Fill(it->chi2());
339  m_chisqnorm->Fill(it->normalizedChi2());
340  m_ndof->Fill(it->ndof());
341  if(m_2dhistos) {
342  m_chisqvseta->Fill(it->eta(),it->chi2());
343  m_chisqnormvseta->Fill(it->eta(),it->normalizedChi2());
344  m_ndofvseta->Fill(it->eta(),it->ndof());
345  }
346  m_hptphieta->Fill(it->eta(),it->phi(),pt);
347  sumptsq += pt*pt;
348  if(it->p()) m_hcos->Fill(it->pz()/it->p());
349  if(it->quality(quality)) nhptrk++;
350  }
351 
352  m_nhptrk->Fill(nhptrk);
353 
354  const double hpfrac = tracks->size() > 0 ? double(nhptrk)/double(tracks->size()) : 0.;
355  m_hhpfrac->Fill(hpfrac);
356  m_hsqsumptsq->Fill(sqrt(sumptsq));
357 
358 }
TH1F * m_ntrk
Definition: TrackCount.cc:77
TH2F * m_chisqvseta
Definition: TrackCount.cc:90
TProfile2D * m_hnlayerphieta
Definition: TrackCount.cc:105
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
Definition: TrackBase.h:151
TProfile2D * m_hnhitphieta
Definition: TrackCount.cc:104
TProfile2D * m_hptphieta
Definition: TrackCount.cc:93
bool isValid() const
Definition: LumiDetails.cc:57
TH1D * m_halgo
Definition: TrackCount.cc:102
int bunchCrossing() const
Definition: EventBase.h:66
float lumiValue(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:92
edm::EDGetTokenT< reco::TrackCollection > m_trkcollToken
Definition: TrackCount.cc:117
TH1D * m_hnstriplayers
Definition: TrackCount.cc:101
TH1F * m_chisqnorm
Definition: TrackCount.cc:88
TH1F * m_chisq
Definition: TrackCount.cc:87
TH2F * m_chisqnormvseta
Definition: TrackCount.cc:91
TH1D * m_hnlostlayers
Definition: TrackCount.cc:98
T sqrt(T t)
Definition: SSEVec.h:18
TH1F * m_hpt
Definition: TrackCount.cc:86
TProfile ** m_ntrkvsorbrun
Definition: TrackCount.cc:107
TH1F * m_nhptrk
Definition: TrackCount.cc:80
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:86
TH1F * m_hsqsumptsq
Definition: TrackCount.cc:82
int orbitNumber() const
Definition: EventBase.h:67
bool isValid() const
Definition: HandleBase.h:74
TH1F * m_heta
Definition: TrackCount.cc:84
TH1D * m_hnlayers
Definition: TrackCount.cc:99
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
TH1D * m_hnpixelrhits
Definition: TrackCount.cc:96
TH1D * m_hnrhits
Definition: TrackCount.cc:95
TH1D * m_hnpixellayers
Definition: TrackCount.cc:100
HLT enums.
TH2F * m_ndofvseta
Definition: TrackCount.cc:92
TH1D * m_hnstriprhits
Definition: TrackCount.cc:97
TH1F * m_hcos
Definition: TrackCount.cc:85
TProfile * m_ntrkvslumi
Definition: TrackCount.cc:78
const bool m_dump
Definition: TrackCount.cc:116
TH2D * m_ntrkvslumi2D
Definition: TrackCount.cc:79
const bool m_2dhistos
Definition: TrackCount.cc:114
TH1D * m_hnlosthits
Definition: TrackCount.cc:94
TH1F * m_ndof
Definition: TrackCount.cc:89
TH1F * m_hphi
Definition: TrackCount.cc:83
TH2D * m_hphieta
Definition: TrackCount.cc:103
const bool m_runHisto
Definition: TrackCount.cc:115
edm::EDGetTokenT< LumiDetails > m_lumiProducerToken
Definition: TrackCount.cc:118
TH1F * m_hhpfrac
Definition: TrackCount.cc:81
void TrackCount::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Definition at line 361 of file TrackCount.cc.

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

362 {
363  m_rhm.beginRun(iRun);
364 
365  if(m_runHisto) {
366  (*m_ntrkvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*m_ntrkvsorbrun)->GetYaxis()->SetTitle("Ntracks");
367  (*m_ntrkvsorbrun)->SetCanExtend(TH1::kXaxis);
368  }
369 }
RunHistogramManager m_rhm
Definition: TrackCount.cc:111
void beginRun(const edm::Run &iRun)
const bool m_runHisto
Definition: TrackCount.cc:115

Member Data Documentation

const bool TrackCount::m_2dhistos
private

Definition at line 114 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_chisq
private

Definition at line 87 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_chisqnorm
private

Definition at line 88 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2F* TrackCount::m_chisqnormvseta
private

Definition at line 91 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2F* TrackCount::m_chisqvseta
private

Definition at line 90 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const bool TrackCount::m_dump
private

Definition at line 116 of file TrackCount.cc.

Referenced by analyze().

TH1D* TrackCount::m_halgo
private

Definition at line 102 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hcos
private

Definition at line 85 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_heta
private

Definition at line 84 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hhpfrac
private

Definition at line 81 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile2D* TrackCount::m_hnhitphieta
private

Definition at line 104 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile2D* TrackCount::m_hnlayerphieta
private

Definition at line 105 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnlayers
private

Definition at line 99 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnlosthits
private

Definition at line 94 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnlostlayers
private

Definition at line 98 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnpixellayers
private

Definition at line 100 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnpixelrhits
private

Definition at line 96 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnrhits
private

Definition at line 95 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnstriplayers
private

Definition at line 101 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1D* TrackCount::m_hnstriprhits
private

Definition at line 97 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hphi
private

Definition at line 83 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2D* TrackCount::m_hphieta
private

Definition at line 103 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hpt
private

Definition at line 86 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile2D* TrackCount::m_hptphieta
private

Definition at line 93 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_hsqsumptsq
private

Definition at line 82 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const unsigned int TrackCount::m_LSfrac
private

Definition at line 113 of file TrackCount.cc.

Referenced by TrackCount().

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

Definition at line 118 of file TrackCount.cc.

Referenced by analyze().

const unsigned int TrackCount::m_maxLS
private

Definition at line 112 of file TrackCount.cc.

Referenced by TrackCount().

TH1F* TrackCount::m_ndof
private

Definition at line 89 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2F* TrackCount::m_ndofvseta
private

Definition at line 92 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH1F* TrackCount::m_nhptrk
private

Definition at line 80 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const unsigned int TrackCount::m_nptbin
private

Definition at line 119 of file TrackCount.cc.

Referenced by TrackCount().

TH1F* TrackCount::m_ntrk
private

Definition at line 77 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile* TrackCount::m_ntrkvslumi
private

Definition at line 78 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TH2D* TrackCount::m_ntrkvslumi2D
private

Definition at line 79 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

TProfile** TrackCount::m_ntrkvsorbrun
private

Definition at line 107 of file TrackCount.cc.

Referenced by analyze(), and TrackCount().

const double TrackCount::m_ptmax
private

Definition at line 121 of file TrackCount.cc.

Referenced by TrackCount().

const double TrackCount::m_ptmin
private

Definition at line 120 of file TrackCount.cc.

Referenced by TrackCount().

RunHistogramManager TrackCount::m_rhm
private

Definition at line 111 of file TrackCount.cc.

Referenced by beginRun(), and TrackCount().

const bool TrackCount::m_runHisto
private

Definition at line 115 of file TrackCount.cc.

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

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

Definition at line 117 of file TrackCount.cc.

Referenced by analyze().